Hacker News new | past | comments | ask | show | jobs | submit login

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.



Why not check for file existance, instead of try-catch:

  if filereadable(expand("~/.vimlocal"))
      source ~/.vimlocal
  endif


I'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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: