Vim Tips Wiki
 
Line 11: Line 11:
 
----
 
----
 
Another issue: commenting is enabled in command history which blocks 'cntl-c-c' exiting.
 
Another issue: commenting is enabled in command history which blocks 'cntl-c-c' exiting.
  +
----
  +
The FileType setting should also be respected. I.e. if I open a *.c file and `:set ft=python', commenting should use '#', not '//'.

Latest revision as of 15:37, 20 February 2014

Use this page to discuss script 1528 comments: comment/un-comment source code

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Comments[]

There are a couple of bugs:

  • The selecting a line (e.g. "asdf") with shift-v in cpp mode, and hitting control-C "comments" every letter (so you get e.g. "//a//s//d//f").
  • In ocaml, whitespace is sometimes lost when commenting lines. E.g commenting out the second line in 'print_endline\n "hello world"' (where \n is newline), causes that line to lose indentation.

It would also be nice if this plugin used block comments - not just repeat commenting for all lines (e.g. /* */ in cpp instead of //).


I noticed that it comments already commented lines. Great time saver though!!.


Another issue: commenting is enabled in command history which blocks 'cntl-c-c' exiting.


The FileType setting should also be respected. I.e. if I open a *.c file and `:set ft=python', commenting should use '#', not '//'.