]> git.rmz.io Git - dotfiles.git/blobdiff - vim/vimrc
vim: center after ^{O,I} jumps
[dotfiles.git] / vim / vimrc
index 83f23795fab8987c949501edd578313dfe674476..e59de75bc58b49fc79d70d8c85b15cf7bccdde04 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -100,7 +100,7 @@ set showbreak=↪                 " show these chars for wrapped lines
 set lazyredraw                  " don't redraw while executing macros
 
 set list                        " show chars defined in 'listchars'
-set listchars=tab:â\96¸\            " list of strings used for list mode
+set listchars=tab:â\9d­\            " list of strings used for list mode
 set listchars+=extends:❯,precedes:❮
 " Only shown when not in insert mode
 augroup trailing
@@ -313,6 +313,8 @@ nmap <Leader># :%s:<C-R>/::gn<CR>
 " center cursor after search and open folds
 nnoremap n nzzzv
 nnoremap N Nzzzv
+nnoremap ^O ^Ozzzv
+nnoremap ^I ^Izzzv
 
 " same when jumping around
 nnoremap g; g;zzzv
@@ -381,10 +383,13 @@ map Q gq
 " break undo sequence before removing word
 inoremap <C-W> <C-G>u<C-W>
 
-nmap <Leader>b :set expandtab tabstop=4 shiftwidth=4 softtabstop=4<CR>
-nmap <Leader>B :set expandtab tabstop=8 shiftwidth=8 softtabstop=4<CR>
-nmap <Leader>M :set noexpandtab tabstop=8 softtabstop=4 shiftwidth=4<CR>
-nmap <Leader>m :set expandtab tabstop=2 shiftwidth=2 softtabstop=2<CR>
+nnoremap coe :set <C-R>=&expandtab ? 'noexpandtab' : 'expandtab'<CR><CR>
+nnoremap [oe :set expandtab<CR>
+nnoremap ]oe :set noexpandtab<CR>
+
+for idt in range(1,8)
+  exe 'nnoremap co'.idt.' :set tabstop='.idt.' shiftwidth='.idt.' softtabstop='.idt.'<CR>'
+endfor
 
 " space will toggle current fold in normal mode
 nnoremap <leader><Space> za
@@ -637,7 +642,7 @@ nmap <leader>ev :call EditConfig('vimrc')<CR>
 nmap <leader>ef :call EditConfig('ftplugin')<CR>
 nmap <leader>es :call EditConfig('syntax')<CR>
 nmap <leader>ei :call EditConfig('indent')<CR>
-nmap <leader>eu :UltiSnipsEdit<CR>
+nmap <leader>eu :UltiSnipsEdit<CR>:lcd %:p:h<CR>
 
 " spell check {{{2
 " http://tex.stackexchange.com/a/52932