You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
5.1 KiB
156 lines
5.1 KiB
" Vim with all enhancements
|
|
source $VIMRUNTIME/vimrc_example.vim
|
|
|
|
" Mouse behavior (the Unix way)
|
|
behave xterm
|
|
|
|
" Use the internal diff if available.
|
|
" Otherwise use the special 'diffexpr' for Windows.
|
|
if &diffopt !~# 'internal'
|
|
set diffexpr=MyDiff()
|
|
endif
|
|
function MyDiff()
|
|
let opt = '-a --binary '
|
|
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
|
|
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
|
|
let arg1 = v:fname_in
|
|
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
|
|
let arg1 = substitute(arg1, '!', '\!', 'g')
|
|
let arg2 = v:fname_new
|
|
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
|
|
let arg2 = substitute(arg2, '!', '\!', 'g')
|
|
let arg3 = v:fname_out
|
|
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
|
|
let arg3 = substitute(arg3, '!', '\!', 'g')
|
|
if $VIMRUNTIME =~ ' '
|
|
if &sh =~ '\<cmd'
|
|
if empty(&shellxquote)
|
|
let l:shxq_sav = ''
|
|
set shellxquote&
|
|
endif
|
|
let cmd = '"' . $VIMRUNTIME . '\diff"'
|
|
else
|
|
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
|
|
endif
|
|
else
|
|
let cmd = $VIMRUNTIME . '\diff'
|
|
endif
|
|
let cmd = substitute(cmd, '!', '\!', 'g')
|
|
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
|
|
if exists('l:shxq_sav')
|
|
let &shellxquote=l:shxq_sav
|
|
endif
|
|
endfunction
|
|
|
|
|
|
language en_US.utf8
|
|
|
|
|
|
|
|
|
|
"BASICS--------------------------------------------------------------
|
|
set exrc ""You can get some cuntomizations if therre is a vimrc on the local eare that you are it wiil use it.
|
|
set guicursor= ""Bi cursor for oldstyle lovers.
|
|
set relativenumber ""Show the line beofre and ofetr starting from your line
|
|
set noerrorbells ""No sound effects.
|
|
set tabstop=4 ""TabSize of 4
|
|
set shiftwidth=4 ""Indentation fo 4
|
|
set softtabstop=4 ""Enabeling it will remplace tabs by spaces in insert mode
|
|
set noexpandtab ""Enabeling it will remplace tabs by spaces
|
|
set smartindent ""will try it's best to indent for you.
|
|
set nowrap ""Will continue to go right when line is too long
|
|
set incsearch ""incremental searching as i am typing the words will be highligted.
|
|
set number ""Self explanatory
|
|
set scrolloff=8 ""Will start to scroll down wehn there is still 8 Lines before end of page.
|
|
:autocmd InsertEnter,InsertLeave * set cul!
|
|
|
|
"Backup and Undo
|
|
set noswapfile ""No swap file. they are anoying
|
|
set nobackup ""Nobackup because we will do a undo dir
|
|
set undodir=~/vimfiles/undodir
|
|
set undofile
|
|
|
|
packadd termdebug
|
|
let g:termdebug_wide=1
|
|
|
|
filetype plugin indent on
|
|
syntax enable
|
|
|
|
"PLUGINS-------------------------------------------------------------
|
|
call plug#begin('~/vimfiles/pluggin/')
|
|
Plug 'gruvbox-community/gruvbox'
|
|
Plug 'arcticicestudio/nord-vim'
|
|
Plug 'vim-utils/vim-man'
|
|
Plug 'mbbill/undotree'
|
|
call plug#end()
|
|
"--------------------------------------------------------------------
|
|
|
|
"VISUALS-------------------------------------------------------------
|
|
set colorcolumn=100
|
|
highlight ColorColumn ctermbg=0 guibg=lightgrey
|
|
set signcolumn=yes
|
|
colorscheme gruvbox
|
|
"https://vi.stackexchange.com/questions/27599/colorscheme-displayed-wrongly-with-neovim
|
|
let g:gruvbox_termcolors=16
|
|
set termguicolors
|
|
set background=dark
|
|
|
|
|
|
"REMAPS--------------------------------------------------------------
|
|
let mapleader=" "
|
|
"Ease of window jumg intead of ^wj etc..
|
|
map <leader>h :wincmd h<CR>
|
|
map <leader>j :wincmd j<CR>
|
|
map <leader>k :wincmd k<CR>
|
|
map <leader>l :wincmd l<CR>
|
|
map <leader>u :UndotreeShow<CR>
|
|
map <leader>db :Termdebug <bar> :vertical resize 30<CR>
|
|
noremap <silent> <leader>ts :Step<cr>
|
|
noremap <silent> <leader>to :Over<cr>
|
|
noremap <silent> <leader>tn :Next<cr>
|
|
noremap <silent> <leader>tc :Cont<cr>
|
|
map <leader>pv :Sex! <bar> :vertical resize 30<CR>
|
|
map ,/ :s/^/\/\//<CR>
|
|
map ,{ :s/);/)\r{\r\t\r}\r/g<CR>
|
|
"--------------------------------------------------------------------
|
|
|
|
"FILE BROWSING-------------------------------------------------------
|
|
let g:netrw_banner=0 " disable annoying banner
|
|
let g:netrw_browse_split=4 " open in prior window
|
|
let g:netrw_altv=1 " open splits to the right
|
|
let g:netrw_liststyle=3 " tree view
|
|
|
|
" NOW WE CAN:
|
|
" - :edit a folder to open a file browser
|
|
" - <CR>/v/t to open in an h-split/v-split/tab
|
|
" - check |netrw-browse-maps| for more mappings
|
|
"PLUGINS-------------------------------------------------------------
|
|
"--------------------------------------------------------------------
|
|
|
|
"SNIPPETS------------------------------------------------------------
|
|
" Command Read template move cursor
|
|
nnoremap ,html :-1read $HOME/.vim/.skeleton.html<CR>3jwf>a
|
|
|
|
" NOW WE CAN:
|
|
" - Take over the world!
|
|
" (with much fewer keystrokes)
|
|
"--------------------------------------------------------------------
|
|
|
|
"BUILD INTEGRATION---------------------------------------------------
|
|
" Steal Mr. Bradley's formatter & add it to our spec_helper
|
|
" http://philipbradley.net/rspec-into-vim-with-quickfix
|
|
" Configure the `make` command to run RSpec
|
|
set makeprg=bundle\ exec\ rspec\ -f\ QuickfixFormatter
|
|
|
|
" NOW WE CAN:
|
|
" - Run :make to run RSpec
|
|
" - :cl to list errors
|
|
" - :cc# to jump to error by number
|
|
" - :cn and :cp to navigate forward and back
|
|
"--------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|