From: Samir Benmendil Date: Sun, 16 Feb 2020 13:07:19 +0000 (+0000) Subject: vim: edit ultisnips with my function X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/de63af710d0c87c10f8e3b899aded2fe6aee7193?hp=75188d23d00de844c9d8876c50177009da32c39a vim: edit ultisnips with my function UltisnipsEdit is now asking to select which file to edid instead of going directly to where I want. --- diff --git a/vim/vimrc b/vim/vimrc index 137eab0..cc35b08 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -812,7 +812,7 @@ nnoremap gs :set operatorfunc=SortLinesOpFuncg@ vnoremap gs :sort " edit configs {{{2 -function! EditConfig(what) +function! EditConfig(what, ext = '.vim') let l:dir = split(&runtimepath,',')[0] if a:what == 'vimrc' let l:file = expand($MYVIMRC) @@ -821,7 +821,7 @@ function! EditConfig(what) elseif empty(&filetype) echoe 'filetype is empty!' else - let l:file = l:dir.'/'.a:what.'/'.&filetype.'.vim' + let l:file = l:dir.'/'.a:what.'/'.&filetype.a:ext endif execute ':vsplit '.file @@ -831,7 +831,7 @@ nmap ev :call EditConfig('vimrc') nmap ef :call EditConfig('ftplugin') nmap es :call EditConfig('syntax') nmap ei :call EditConfig('indent') -nmap eu :UltiSnipsEdit:lcd %:p:h +nmap eu :call EditConfig('ultisnips', '.snippets') " spell check {{{2 " http://tex.stackexchange.com/a/52932