]> git.rmz.io Git - dotfiles.git/commitdiff
vim: space be your leader
authorSamir Benmendil <samir.benmendil@gmail.com>
Tue, 20 May 2014 08:43:55 +0000 (09:43 +0100)
committerSamir Benmendil <samir.benmendil@gmail.com>
Tue, 20 May 2014 08:43:55 +0000 (09:43 +0100)
vim/vimrc

index 5930b407ca407ffe92dec153ad537e7e10712a89..033b90d0bfaabea9490e63195646298a853a6e1f 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -49,6 +49,10 @@ set runtimepath +=$XDG_CONFIG_HOME/vim/after
 
 filetype plugin indent on
 
 
 filetype plugin indent on
 
+" bindings {{{1
+" allow both <space> and / to be <leader>
+map <space> <leader>
+
 " moving around, searching and patterns {{{1
 set incsearch           " show match for partly typed search command
 set ignorecase          " ignore case when using a search pattern
 " moving around, searching and patterns {{{1
 set incsearch           " show match for partly typed search command
 set ignorecase          " ignore case when using a search pattern
@@ -230,9 +234,9 @@ set foldmethod=marker           " folding type
 set foldlevelstart=0            " value for 'foldlevel' when starting to edit a file
 
 " space will toggle current fold in normal mode
 set foldlevelstart=0            " value for 'foldlevel' when starting to edit a file
 
 " space will toggle current fold in normal mode
-nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
+nnoremap <leader><Space> za
 " create folds around visual selection
 " create folds around visual selection
-vnoremap <Space> zf
+vnoremap <leader><Space> zf
 
 " save and restore folds
 set viewoptions=folds,cursor    " don't save local options
 
 " save and restore folds
 set viewoptions=folds,cursor    " don't save local options