From e21853080f5005ad6c6b548146d339abd197f28e Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Mon, 27 Jun 2022 21:51:15 +0300 Subject: [PATCH] AltSwitcher is still not so satisfactory --- vim/.vim/ftplugin/c/alt.vim | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 vim/.vim/ftplugin/c/alt.vim diff --git a/vim/.vim/ftplugin/c/alt.vim b/vim/.vim/ftplugin/c/alt.vim deleted file mode 100644 index 35ef67b..0000000 --- a/vim/.vim/ftplugin/c/alt.vim +++ /dev/null @@ -1,21 +0,0 @@ -if exists("*CAltSwitcher") | finish | endif - -let g:AltExts = { - \ "c": ["h"], - \ "h": ["c", "cc"], - \ "cc": ["hh", "h"], - \ "hh": ["cc"] -\} - -function! CAltSwitcher() abort - for ext in g:AltExts[expand("%:e")] - let name = expand("%<") . "." . ext - if filereadable(name) - execute "edit " . name - return - endif - endfor - echomsg "no alt found" -endfunction - -nnoremap :call CAltSwitcher() -- 2.44.0