From b140b32672ad10ee772e90c38b54440a4d268038 Mon Sep 17 00:00:00 2001 From: Jim Riordan Date: Wed, 17 Jun 2015 14:35:59 +1000 Subject: [PATCH] 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 ev and sv respectively --- .vimrc | 20 ++++++++++++++++++-- .vimrc.before | 4 ++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 58f8f6e..95318b9 100644 --- a/.vimrc +++ b/.vimrc @@ -285,6 +285,22 @@ let maplocalleader=g:spf13_localleader endif + " The default mappings for editing and applying the spf13 configuration + " are ev and sv respectively. Change them to your preference + " by adding the following to your .vimrc.before.local file: + " let g:spf13_edit_config_mapping='ec' + " let g:spf13_apply_config_mapping='sc' + if !exists('g:spf13_edit_config_mapping') + let s:spf13_edit_config_mapping = '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 = 'sv' + else + let s:spf13_apply_config_mapping = g:spf13_apply_config_mapping + endif + " Easier moving in tabs and windows " The lines conflict with the default digraph mapping of " If you prefer that functionality, add the following to your @@ -1190,8 +1206,8 @@ execute bufwinnr(".vimrc.local") . "wincmd w" endfunction - noremap ev :call EditSpf13Config() - noremap sv :source ~/.vimrc + execute "noremap " . s:spf13_edit_config_mapping " :call EditSpf13Config()" + execute "noremap " . s:spf13_apply_config_mapping . " :source ~/.vimrc" " } " Use fork vimrc if available { diff --git a/.vimrc.before b/.vimrc.before index 20ebeac..80785c4 100644 --- a/.vimrc.before +++ b/.vimrc.before @@ -92,6 +92,10 @@ " Require a special keypress to enter multiple cursors mode " let g:multi_cursor_start_key='+' + " Mappings for editing/applying spf13 config + " let g:spf13_edit_config_mapping='ev' + " let g:spf13_apply_config_mapping='sv' + " } " Use fork before if available {