Is it possibile with NERDTree or is there any other browser plugin that
supports this?
Thanks
Posting the solution I came up with in case it may be of interest to
other vim users.
file: ~/.vim/nerdtree_plugin/my_plugin.vim
call NERDTreeAddKeyMap({
\ 'key': 'b',
\ 'callback': 'NERDTreeInsertImage',
\ 'quickhelpText': 'Insert XHTML tag of image' })
function! NERDTreeInsertImage()
let n = g:NERDTreeFileNode.GetSelected()
let filepath = n.path.str()
if n != {}
let @i = system("~/perl/image.pl " . filepath)
normal ^W"ip
endif
endfunction
it adds a mapping to key `b` and runs the perl script using the full
file path as argument. Of course ^W is inserted with <C-v><C-w>.