Configurify the mappings for editing/applying the spf13 config

A user can set the following variables in their .vimrc.before.local file
to customise the key mappings:

g:spf13_edit_config_mapping
g:spf13_apply_config_mapping

the defaults are <leader>ev and <leader>sv respectively
This commit is contained in:
Jim Riordan 2015-06-17 14:35:59 +10:00
parent 5315ee88d0
commit b140b32672
2 changed files with 22 additions and 2 deletions

20
.vimrc
View File

@ -285,6 +285,22 @@
let maplocalleader=g:spf13_localleader let maplocalleader=g:spf13_localleader
endif endif
" The default mappings for editing and applying the spf13 configuration
" are <leader>ev and <leader>sv respectively. Change them to your preference
" by adding the following to your .vimrc.before.local file:
" let g:spf13_edit_config_mapping='<leader>ec'
" let g:spf13_apply_config_mapping='<leader>sc'
if !exists('g:spf13_edit_config_mapping')
let s:spf13_edit_config_mapping = '<leader>ev'
else
let s:spf13_edit_config_mapping = g:spf13_edit_config_mapping
endif
if !exists('g:spf13_apply_config_mapping')
let s:spf13_apply_config_mapping = '<leader>sv'
else
let s:spf13_apply_config_mapping = g:spf13_apply_config_mapping
endif
" Easier moving in tabs and windows " Easier moving in tabs and windows
" The lines conflict with the default digraph mapping of <C-K> " The lines conflict with the default digraph mapping of <C-K>
" If you prefer that functionality, add the following to your " If you prefer that functionality, add the following to your
@ -1190,8 +1206,8 @@
execute bufwinnr(".vimrc.local") . "wincmd w" execute bufwinnr(".vimrc.local") . "wincmd w"
endfunction endfunction
noremap <leader>ev :call <SID>EditSpf13Config()<CR> execute "noremap " . s:spf13_edit_config_mapping " :call <SID>EditSpf13Config()<CR>"
noremap <leader>sv :source ~/.vimrc<CR> execute "noremap " . s:spf13_apply_config_mapping . " :source ~/.vimrc<CR>"
" } " }
" Use fork vimrc if available { " Use fork vimrc if available {

View File

@ -92,6 +92,10 @@
" Require a special keypress to enter multiple cursors mode " Require a special keypress to enter multiple cursors mode
" let g:multi_cursor_start_key='+' " let g:multi_cursor_start_key='+'
" Mappings for editing/applying spf13 config
" let g:spf13_edit_config_mapping='<leader>ev'
" let g:spf13_apply_config_mapping='<leader>sv'
" } " }
" Use fork before if available { " Use fork before if available {