From 45ae13e4b54571a2a01b78d9a2efa4727b5886fe Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 19 Apr 2015 02:47:10 +0100 Subject: [PATCH] vim: add more config bindings (ftplugin,syntax,indent) --- vim/vimrc | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index d927be1..2cdb19d 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -353,9 +353,6 @@ cnoremap " close all folds open fold in cursor nnoremap zx zMzxzt -" edit vimrc in new tab -nmap ev :tabedit $MYVIMRC:lcd %:p:h - map :ls:b nnoremap w @@ -576,6 +573,28 @@ if !exists(":DiffOrig") \ | wincmd p | diffthis endif +" edit configs {{{2 +function! EditConfig(what) + let l:dir = split(&runtimepath,',')[0] + if a:what == 'vimrc' + let l:file = expand($MYVIMRC) + elseif ! isdirectory(globpath(l:dir, a:what)) + echoe a:what." is not valid!" + elseif empty(&filetype) + echoe 'filetype is empty!' + else + let l:file = l:dir.'/'.a:what.'/'.&filetype.'.vim' + endif + + execute ':vsplit '.file + execute ':lcd %:p:h' +endf +nmap ev :call EditConfig('vimrc') +nmap ef :call EditConfig('ftplugin') +nmap es :call EditConfig('syntax') +nmap ei :call EditConfig('indent') +nmap eu :UltiSnipsEdit + " spell check {{{2 " http://tex.stackexchange.com/a/52932 let g:myLangList=["en_gb","en_us","de","fr"] -- 2.48.1