:s/start_of_visual_selection(.*)end_of_visual_selection/\/*\1\/*/

Any ideas?

My first thought would be

vnoremap <f4> <esc>`<i/* <esc>`>a */<esc>

(all characters typed literally...note the back-ticks rather than single-quote characters) which should work with both line-wise and characterwise selections.

Alternatively, if you search either the vim tips or vim scripts section of www.vim.org, there's an "enhanced commentify" tool that will do all sorts of spiffy stuff.

-tim





Reply via email to