tags:

views:

84

answers:

1

Hi,
When using nerd commenter in visual mode, the first line is commented differently.
Initial code

const IMG_SIZE_SMALL = '32x32';   
const IMG_SIZE_MEDIUM = '64x64';  
const IMG_SIZE_LARGE = '192x192';  

After doing ,cc in visual mode selecting these lines.

/*    const IMG_SIZE_SMALL = '32x32';*/
//const IMG_SIZE_MEDIUM = '64x64';
//const IMG_SIZE_LARGE = '192x192';

What should I do so that the first line is also commented out using // ?

+1  A: 

You didn't mention what filetype the file has. I tried creating a small test.c file with only the lines provided in your question and used ,cc to comment out the lines. I tried two different filetype settings. With filetype=c, the lines were all commented out with /* --- */ style comments and with filetype=cpp, the lines were all commented out with // style comments. Have you made sure you are using the latest version of NERD_commenter (2.2.2)?

Ok, now I created a small test file with these lines and some testing lines above and below them. NERD commenter comments them all with the same //-style comments. You don't happen to be selecting lines in character-wise mode? That is pressing v instead of shift-v to select the lines? When i tried that i was able to get different comment styles for some lines.

Sam
Sorry . My filetype is php. I am indeed using the latest version 2.2.2
Jithin
Thanks. I was using the character-wise visual mode. When using the line-wise visual mode I got the intended behavior.
Jithin