3 ms·
One thing I've added fairly recently is: try source ./.vimlocal catch /^Vim\%((\a\+)\)\=:E484/ endtry which lets me tweak my settings
by dllthomas 11y ago
One thing I've added fairly recently is:
try
source ./.vimlocal
catch /^Vim\%((\a\+)\)\=:E484/
endtry
which lets me tweak my settings (project specific key bindings, &c) by dropping a .vimlocal file in the directory I'm editing from. The try-catch ignores the error raised when the file is absent.
- uniqueusername1 11y agoWhy not check for file existance, instead of try-catch: if filereadable(expand("~/.vimlocal")) source ~/.vimlocal endif
- dllthomas 11y agoI've no strong objection to that - it's racy but not in any way that probably matters. Otherwise, it's mostly just a question of forgiveness vs permission...