Questions tagged [nerdcommenter]

The NERD Commenter is a Vim plugin that allows for easy commenting of code for many filetypes.

The NERD Commenter is a Vim plugin that allows for easy commenting of code for many filetypes.

Provides many different commenting operations and styles which are invoked via key mappings and a menu. It can handle single line, multi line, partial line commenting as well as nesting.

18 questions
17
votes
3 answers

How to make use nerdcommenter to give extra space after #

I am a vim user and has nerdcommenter plugin, the problem is when I use c to comment out code (also block of code), it prefix # right in front of the code, but pep8 style checker is complaining that I should have a space after the…
James Lin
  • 25,028
  • 36
  • 133
  • 233
9
votes
2 answers

How do I get NERDCommenter to add comments in a particular column?

NERDCommenter works like this by default: //level1 //level2 //level3 How do I get to work like this? //level1 // level2 // level3
roshanvid
  • 793
  • 6
  • 21
8
votes
3 answers

How do I install vim plugins with vscode vim?

I am slightly new to vim, and I installed the vim vscode plugin so I can use vim-like melodies to manipulate code in vscode. However, I used to have janus installed on my terminal (including NERDTree, NERDCommenter, etc) and I want to install…
oriont
  • 684
  • 2
  • 10
  • 25
8
votes
2 answers

Vim NERD Commenter \c deletes the line instead of toggling comments

The following works fine for me, it will comment out the current line: cc but according to the docs (https://github.com/scrooloose/nerdcommenter#usage) if I want to toggle comments I do: c which deletes the current line for me. Am…
Liam
  • 1,041
  • 2
  • 17
  • 31
2
votes
1 answer

Unable to use NERDCommenter with vundle

I am using vim The-NERD-Commenter plugin along with vundle. But I am not able to get the plugin to work. I have my leader ley mapped to ,. When I run the :scriptnames command I see that ~\vimfiles\bundle\The-NERD-Commenter\plugin\NERD_commenter.vim…
Amrish
  • 679
  • 1
  • 8
  • 20
2
votes
2 answers

How to use NERDComment plugin for Vim

I am new to Vim itself but I am trying to adopt this editor for my needs. I installed NERDComment plugin as described and have it listed in my :scriptnames. But I don't understand from description and this page how to use it. I have filetype…
arbulgazar
  • 1,931
  • 1
  • 19
  • 24
1
vote
1 answer

How can I add space between code and comment?

I'm using nerdcommenter alongside neovim, and every time I comment out a block of code with cc, the code isn't really spaced out: fn main() { //println!("Hello, world!"); } I want to get an output of something like this: fn main() { …
paxous
  • 119
  • 10
1
vote
1 answer

How do I use ctrl + / as a shortcut in vim using map? ( doesn't work)

I'm using a plugin for vim called NERDCommenter which allows me to toggle line of code's commented state. The thing is I want to change the shortcut to ctrl + / or command + /. Online (from other posts I read) it says to not use , but to…
Zemelware
  • 93
  • 8
1
vote
2 answers

MacVim NERDCommenter, how to specify alternative delimiters

When I'm editing html and xhtml files in MacVim, sometimes I need to comment embedded css styles, so when I try to switch to the alternative set of delimiters ( ca ), the plugin warns me with: NERDCommenter:cannot use alternative delimiters, none…
Bobby Wan-Kenobi
  • 885
  • 9
  • 18
1
vote
1 answer

VIM NerdCommenter: How to toggle comments in the visual mode?

What is the command to toggle comments in the Visual mode? The cc command allows me to comment in the visual mode. I couldn't find a command to un-comment. [count]cc |NERDComComment| PS: I use c command to toggle comments in normal mode.
Harish Shetty
  • 64,083
  • 21
  • 152
  • 198
0
votes
0 answers

How to comment C++ code in Vim with Ctrl - /?

So, I'm trying to set up the NERDComment plugin in vim, but I'm having some trouble with the keys. And I want that if I use Ctrl-/, it must be done. Can anybody answer this question?
0
votes
1 answer

how to uncomment/comment python file using NERD Comment

the example given in the official doc is C and I change into python " Add spaces after comment delimiters by default let g:NERDSpaceDelims = 1 " Use compact syntax for prettified multi-line comments let g:NERDCompactSexyComs = 1 " Align line-wise…
0
votes
1 answer

Nerdcomment {% comment%} ... {% endcomment %}

With the Nerdcommenter plugin, is there an easy way to comment out lines in a django template? I know we could use {% comment%} ... {% endcomment %} to comment lines, but it is not one of the shortcuts in Nerdcommenter I think. Thanks in advance!
user7783682
0
votes
1 answer

Vim Nerdcommenter custom delimiters does not work

I am attempting to follow the advice here: Vim NerdCommenter: adding a new filetype in vimrc and here: MacVim NERDCommenter, how to specify alternative delimiters When I declare my own CustomDelimiters in my .vimrc file, the Nerdcommenter does not…
jmlarson
  • 837
  • 8
  • 31
0
votes
1 answer

Make NERD Commenter prepend before spaces

Is there a way to put the comment character at the very beginning of the line, before any spaces, e.g., instead of having comments inserted like this // if (b != 0) // if (a > b) // cout << a << endl; it should be like this // if (b !=…
alaferg
  • 233
  • 2
  • 10
1
2