Two of the main things that I use when I am coding are a pair of custom mappings that I have bound to F2 and F4 to comment out pieces of code. F2 is for simple // comments and just does a :s/^\(\s*\)/\1\/\//<CR> but F4 I want to do a block comment, namely put /* at the beginning of the selection and */ at the end. Currently I am using a massive hack for this (xi<HOME>/*<CR><HOME>*/<CR><up><up><esc>p) but was wondering if there was anyway of doing a search and replace for an entire block, something like
:s/start_of_visual_selection(.*)end_of_visual_selection/\/*\1\/*/ Any ideas? -- Max Dyckhoff AI Engineer Bungie Studios