-
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
Milestone
Description
I've just remembered that I have the following in my vimrc:
au BufNewFile * nested let s:fn = expand('<afile>') |
\ if ! filereadable(s:fn) | let s:fn = substitute(s:fn, '^\S\{-}/', '', '')
\ | if filereadable(s:fn) | echomsg 'Editing' s:fn 'instead' | exec 'e '.s:fn.' | bd#' | endif | endif
This helps when copy'n'pasting a path from a patch / diff header, e.g. from git diff.
I think it might be a good addition for vim-fetch, applying all specs with an optional path prefix, too.
It could be limited to just a single char prefix (a/, b/, i/, w/, ...).