开发者

VIM Plugin to insert image tags via NERDTree

开发者 https://www.devze.com 2023-01-27 15:52 出处:网络
I\'m trying to find/create a plugin for vim\'s NERDTree that will allow a shortcut to inserting HTML image tags.

I'm trying to find/create a plugin for vim's NERDTree that will allow a shortcut to inserting HTML image tags.

Pe开发者_运维知识库rhaps something like the solution shown here: VIM browser plugin to execute commands on files

Only I can't get this to work - looks like it uses a perl script to invoke ImageMagick to determine the image dimensions and then generates an HTML tag. This script is not shown in the solution :(

Would be nice if the script would allow a selection of (multiple) images, and auto-pasted the resulting HTML into the last used position of the last used window.

Anyone know of an existing plugin like this, or steer me in the right direction?


Actually I used to do:

 :e /directory/where/are/images

(this gives me a buffer with directory contents, then)

 V

(selects line(s))

 :%s:.\+:<img src="&" />:

(converts the file names to img tags...)

ggVGya

(all the lines are selected, copied to a register, which can be pasted anywhere...)

HTH

0

精彩评论

暂无评论...
验证码 换一张
取 消