From: Sergey Matveev Date: Mon, 27 Jun 2022 18:51:15 +0000 (+0300) Subject: AltSwitcher is still not so satisfactory X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=commitdiff_plain;h=e21853080f5005ad6c6b548146d339abd197f28e AltSwitcher is still not so satisfactory --- 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()