tags:

views:

46

answers:

2

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?

A: 

If you're using a mac, you can use the open command.

Seth Johnson
+1  A: 

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>"))
Geoff Reedy