X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/c40be0334e1b7b6dba4c96bb99c62365daedb993..e821da8910e18a767c3bb8d788b8b38ba0bd0c0f:/vim/vimrc?ds=sidebyside diff --git a/vim/vimrc b/vim/vimrc index 7e493fc..a7e23ac 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -912,19 +912,16 @@ vnoremap gs :sort " edit configs {{{2 function! EditConfig(what, ext = '.vim') - 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!" + let l:file = a:what elseif empty(&filetype) echoe 'filetype is empty!' + return else - let l:file = l:dir.'/'.a:what.'/'.&filetype.a:ext + let l:file = a:what.'/'.&filetype.a:ext endif - execute ':vsplit '.file - execute ':lcd %:p:h' + execute ':Vvsplit! '.file endf nmap ev :call EditConfig('vimrc') nmap ef :call EditConfig('ftplugin')