From de63af710d0c87c10f8e3b899aded2fe6aee7193 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 16 Feb 2020 13:07:19 +0000 Subject: [PATCH] vim: edit ultisnips with my function UltisnipsEdit is now asking to select which file to edid instead of going directly to where I want. --- vim/vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.48.1