Vim - Nerd commenter . First line commented out differently
When using nerd commenter in visual mode, the first line is commented differently.
Initial codeconst IMG_SIZE_SMALL = '32x32';
const IMG_SIZE_MEDIUM = '64x64';
const IMG_SIZE_LARGE = '192x192';
After doing ,cc in visual mode selecting these lines.
/* const开发者_JS百科 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 // ?
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.
精彩评论