diff options
Diffstat (limited to '.config/nvim')
-rwxr-xr-x | .config/nvim/init.vim | 57 |
1 files changed, 20 insertions, 37 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 06992d0..2bb1324 100755 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim | |||
@@ -42,8 +42,11 @@ Plug 'godlygeek/tabular' | |||
42 | Plug 'dbeniamine/cheat.sh-vim' | 42 | Plug 'dbeniamine/cheat.sh-vim' |
43 | "color code highlight | 43 | "color code highlight |
44 | Plug 'chrisbra/Colorizer' | 44 | Plug 'chrisbra/Colorizer' |
45 | |||
45 | "comment helper | 46 | "comment helper |
46 | Plug 'scrooloose/nerdcommenter' | 47 | "Plug 'scrooloose/nerdcommenter' |
48 | Plug 'tpope/vim-commentary' | ||
49 | |||
47 | "folding ledger files | 50 | "folding ledger files |
48 | Plug 'ledger/vim-ledger' | 51 | Plug 'ledger/vim-ledger' |
49 | "reporen files at your last edit position | 52 | "reporen files at your last edit position |
@@ -52,9 +55,14 @@ Plug 'farmergreg/vim-lastplace' | |||
52 | Plug 'kshenoy/vim-signature' | 55 | Plug 'kshenoy/vim-signature' |
53 | "git diff in the sign column | 56 | "git diff in the sign column |
54 | Plug 'airblade/vim-gitgutter' | 57 | Plug 'airblade/vim-gitgutter' |
58 | "jump to location by 2 characters | ||
59 | Plug 'justinmk/vim-sneak' | ||
55 | 60 | ||
61 | "splits delete into cut and delete | ||
56 | Plug 'svermeulen/vim-cutlass' | 62 | Plug 'svermeulen/vim-cutlass' |
63 | "change text with yank | ||
57 | Plug 'svermeulen/vim-subversive' | 64 | Plug 'svermeulen/vim-subversive' |
65 | "yank history | ||
58 | Plug 'svermeulen/vim-yoink' | 66 | Plug 'svermeulen/vim-yoink' |
59 | 67 | ||
60 | "enable repeating supported plugin maps with '.' | 68 | "enable repeating supported plugin maps with '.' |
@@ -69,9 +77,7 @@ Plug 'tpope/vim-fugitive' | |||
69 | Plug 'tpope/vim-speeddating' | 77 | Plug 'tpope/vim-speeddating' |
70 | "search, substitute and abbreviate | 78 | "search, substitute and abbreviate |
71 | Plug 'tpope/vim-abolish' | 79 | Plug 'tpope/vim-abolish' |
72 | "helpers for unix | 80 | "provides ga, show unicode stuff of char under cursor |
73 | Plug 'tpope/vim-eunuch' | ||
74 | "unicode character metadata | ||
75 | Plug 'tpope/vim-characterize' | 81 | Plug 'tpope/vim-characterize' |
76 | 82 | ||
77 | "fancy start screen | 83 | "fancy start screen |
@@ -98,18 +104,14 @@ autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isT | |||
98 | "{{{Misc Settings | 104 | "{{{Misc Settings |
99 | 105 | ||
100 | let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' | 106 | let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' |
101 | |||
102 | " necesary for lots of cool vim things | 107 | " necesary for lots of cool vim things |
103 | set nocompatible | 108 | set nocompatible |
104 | |||
105 | " See below | 109 | " See below |
106 | " https://stackoverflow.com/a/33380495 | 110 | " https://stackoverflow.com/a/33380495 |
107 | if !exists("g:syntax_on") | 111 | if !exists("g:syntax_on") |
108 | syntax enable | 112 | syntax enable |
109 | endif | 113 | endif |
110 | |||
111 | set grepprg=grep\ -nH\ $* " DONT KNOW WHAT THIS DOES | 114 | set grepprg=grep\ -nH\ $* " DONT KNOW WHAT THIS DOES |
112 | |||
113 | " Tab stuff | 115 | " Tab stuff |
114 | set autoindent | 116 | set autoindent |
115 | set expandtab " Use appropriate number of spaces to insert a <Tab> | 117 | set expandtab " Use appropriate number of spaces to insert a <Tab> |
@@ -117,16 +119,13 @@ set smarttab | |||
117 | set shiftwidth=4 | 119 | set shiftwidth=4 |
118 | set softtabstop=4 | 120 | set softtabstop=4 |
119 | set tabstop=8 | 121 | set tabstop=8 |
120 | |||
121 | " Use english for spellchecking, but don't spellcheck by default | 122 | " Use english for spellchecking, but don't spellcheck by default |
122 | set spell spelllang=en_us | 123 | set spell spelllang=en_us |
123 | set nospell | 124 | set nospell |
124 | |||
125 | " Cool tab completion stuff | 125 | " Cool tab completion stuff |
126 | set wildmenu | 126 | set wildmenu |
127 | set wildmode=list:longest,full | 127 | set wildmode=list:longest,full |
128 | set wildignore=*.o,*.obj,*.class | 128 | set wildignore=*.o,*.obj,*.class |
129 | |||
130 | set encoding=utf-8 | 129 | set encoding=utf-8 |
131 | set scrolloff=4 " Keep n lines above/below cursor | 130 | set scrolloff=4 " Keep n lines above/below cursor |
132 | set mouse=c | 131 | set mouse=c |
@@ -143,19 +142,12 @@ set showmatch " jump to the matching bracket briefly, REMOVE AFTER TESTING | |||
143 | set linebreak " wrap using 'breakat' character | 142 | set linebreak " wrap using 'breakat' character |
144 | set splitbelow " new split panes will split to below and right | 143 | set splitbelow " new split panes will split to below and right |
145 | set splitright | 144 | set splitright |
146 | |||
147 | " persistent undo | 145 | " persistent undo |
148 | set undodir=~/.vim/undodir | 146 | set undodir=~/.vim/undodir |
149 | set undofile | 147 | set undofile |
150 | |||
151 | " lower case searches ignore case, upper case searches do not | 148 | " lower case searches ignore case, upper case searches do not |
152 | set ignorecase | 149 | set ignorecase |
153 | set smartcase | 150 | set smartcase |
154 | |||
155 | " This is totally awesome - remap jj to escape in insert mode. You'll never type jj anyway, so it's great! | ||
156 | inoremap jj <Esc> | ||
157 | nnoremap JJJJ <Nop> | ||
158 | |||
159 | " https://stackoverflow.com/a/3445040/ | 151 | " https://stackoverflow.com/a/3445040/ |
160 | " switch case labels | 152 | " switch case labels |
161 | set cinoptions=l1 | 153 | set cinoptions=l1 |
@@ -216,60 +208,47 @@ endfunction | |||
216 | 208 | ||
217 | " Open Url on this line with the browser \w | 209 | " Open Url on this line with the browser \w |
218 | map <Leader>w :call Browser ()<CR> | 210 | map <Leader>w :call Browser ()<CR> |
219 | |||
220 | " Open the TagBar Plugin <F3> | 211 | " Open the TagBar Plugin <F3> |
221 | nnoremap <silent> <F3> :TagbarToggle<CR> | 212 | nnoremap <silent> <F3> :TagbarToggle<CR> |
222 | |||
223 | " Open NERDTree <F4> | 213 | " Open NERDTree <F4> |
224 | nnoremap <silent> <F4> :NERDTreeToggle<CR> | 214 | nnoremap <silent> <F4> :NERDTreeToggle<CR> |
225 | |||
226 | " Next Tab | 215 | " Next Tab |
227 | nnoremap <silent> <C-Right> :tabnext<CR> | 216 | nnoremap <silent> <C-Right> :tabnext<CR> |
228 | |||
229 | " Previous Tab | 217 | " Previous Tab |
230 | nnoremap <silent> <C-Left> :tabprevious<CR> | 218 | nnoremap <silent> <C-Left> :tabprevious<CR> |
231 | |||
232 | " New Tab | 219 | " New Tab |
233 | nnoremap <silent> <C-t> :tabnew<CR> | 220 | nnoremap <silent> <C-t> :tabnew<CR> |
234 | |||
235 | " Rotate Color Scheme <F8> | 221 | " Rotate Color Scheme <F8> |
236 | "nnoremap <silent> <F8> :execute RotateColorTheme()<CR> | 222 | "nnoremap <silent> <F8> :execute RotateColorTheme()<CR> |
237 | |||
238 | " FixIt from YCM | 223 | " FixIt from YCM |
239 | map <F9> :YcmCompleter FixIt<CR> | 224 | map <F9> :YcmCompleter FixIt<CR> |
240 | |||
241 | " Edit vimrc \ev | 225 | " Edit vimrc \ev |
242 | nnoremap <silent> <Leader>ev :tabnew<CR>:e ~/.config/nvim/init.vim<CR> | 226 | nnoremap <silent> <Leader>ev :tabnew<CR>:e ~/.config/nvim/init.vim<CR> |
243 | |||
244 | " Up and down are more logical with g.. | 227 | " Up and down are more logical with g.. |
245 | nnoremap <silent> k gk | 228 | nnoremap <silent> k gk |
246 | nnoremap <silent> j gj | 229 | nnoremap <silent> j gj |
247 | inoremap <silent> <Up> <Esc>gka | 230 | inoremap <silent> <Up> <Esc>gka |
248 | inoremap <silent> <Down> <Esc>gja | 231 | inoremap <silent> <Down> <Esc>gja |
249 | 232 | " This is totally awesome - remap jj to escape in insert mode. You'll never type jj anyway, so it's great! | |
233 | inoremap jj <Esc> | ||
234 | nnoremap JJJJ <Nop> | ||
250 | " quicker window movement | 235 | " quicker window movement |
251 | nnoremap <C-j> <C-w>j | 236 | nnoremap <C-j> <C-w>j |
252 | nnoremap <C-k> <C-w>k | 237 | nnoremap <C-k> <C-w>k |
253 | nnoremap <C-h> <C-w>h | 238 | nnoremap <C-h> <C-w>h |
254 | nnoremap <C-l> <C-w>l | 239 | nnoremap <C-l> <C-w>l |
255 | |||
256 | " Disable highlight when <leader><cr> is pressed | 240 | " Disable highlight when <leader><cr> is pressed |
257 | map <silent> <leader><cr> :noh<cr> | 241 | map <silent> <leader><cr> :noh<cr> |
258 | |||
259 | " Space will toggle folds! | 242 | " Space will toggle folds! |
260 | nnoremap <space> za | 243 | nnoremap <space> za |
261 | |||
262 | " Search mappings: These will make it so that going to the next one in a | 244 | " Search mappings: These will make it so that going to the next one in a |
263 | " search will center on the line it's found in. | 245 | " search will center on the line it's found in. |
264 | map N Nzz | 246 | map N Nzz |
265 | map n nzz | 247 | map n nzz |
266 | |||
267 | "Insert timestamp | 248 | "Insert timestamp |
268 | nnoremap <F5> "=strftime("%F %T")<CR>P | 249 | nnoremap <F5> "=strftime("%F %T")<CR>P |
269 | inoremap <F5> <C-R>=strftime("%F %T")<CR> | 250 | inoremap <F5> <C-R>=strftime("%F %T")<CR> |
270 | |||
271 | nnoremap <Leader>t "=strftime("%F")<CR>P | 251 | nnoremap <Leader>t "=strftime("%F")<CR>P |
272 | |||
273 | "}}} | 252 | "}}} |
274 | 253 | ||
275 | "{{{Tagbar | 254 | "{{{Tagbar |
@@ -399,14 +378,18 @@ map <Leader>b <Plug>VimwikiToggleListItem | |||
399 | set clipboard=unnamed,unnamedplus | 378 | set clipboard=unnamed,unnamedplus |
400 | 379 | ||
401 | " s for substitute | 380 | " s for substitute |
402 | nmap s <plug>(SubversiveSubstitute) | 381 | nmap <leader>ys <plug>(SubversiveSubstitute) |
403 | nmap ss <plug>(SubversiveSubstituteLine) | 382 | nmap <leader>yss <plug>(SubversiveSubstituteLine) |
404 | nmap S <plug>(SubversiveSubstituteToEndOfLine) | 383 | nmap <leader>yS <plug>(SubversiveSubstituteToEndOfLine) |
405 | 384 | ||
406 | nmap <leader>s <plug>(SubversiveSubstituteRange) | 385 | nmap <leader>s <plug>(SubversiveSubstituteRange) |
407 | xmap <leader>s <plug>(SubversiveSubstituteRange) | 386 | xmap <leader>s <plug>(SubversiveSubstituteRange) |
408 | nmap <leader>ss <plug>(SubversiveSubstituteWordRange) | 387 | nmap <leader>ss <plug>(SubversiveSubstituteWordRange) |
409 | 388 | ||
389 | nmap <leader><leader>s <plug>(SubversiveSubvertRange) | ||
390 | xmap <leader><leader>s <plug>(SubversiveSubvertRange) | ||
391 | nmap <leader><leader>ss <plug>(SubversiveSubvertWordRange) | ||
392 | |||
410 | nmap <c-n> <plug>(YoinkPostPasteSwapBack) | 393 | nmap <c-n> <plug>(YoinkPostPasteSwapBack) |
411 | nmap <c-p> <plug>(YoinkPostPasteSwapForward) | 394 | nmap <c-p> <plug>(YoinkPostPasteSwapForward) |
412 | 395 | ||