Reputation: 15333
I have cTags set up to tag a bunch of custom stuff for simple internal scripting language I use at work. For various reasons, I'd like to have it set up so that if I <C-]>
on certain tags vim opens them in their default editor rather than in another buffer. Is it possible to set this up?
Upvotes: 1
Views: 118
Reputation: 36011
The following function and autocommand will cause matching files to be loaded in the program associated with the file type, just like hitting x
from a vim dir explorer buffer.
function s:OSOpen(fname, bufname)
call netrw#NetrwBrowseX(a:fname,0)
exec "bdel " . a:bufname
endfunction
" replace the file pattern with whatever you need
au BufEnter *.txt call s:OSOpen(expand("<afile>"), expand("<abuf>"))
Upvotes: 1