sponsor Vim development Vim logo Vim Book Ad

vim-uncommenter : Automatically deletes all comments in a programming source file.

 script karma  Rating 107/30, Downloaded by 840  Comments, bugs, improvements  Vim wiki

created by
Benjamin Radovsky
script type

In most programming language files opened in vim, to delete all of the lines that are comments, simply hit the keys `dc` and the comments will all disappear!


# here is a comment
def Hello (name) # here is wierdly placed comment
    puts "\n-------------"
    puts "Hello, #{name}." # even a comment here will be removed
    puts '--------------'

puts '######' # this one too, however the `#` inside the single quotes will be fine!

# and here is another comment
[1, 2, 3, 4, 5].each do |i|
    puts "hello" # and another wierd one

# and here is the last comment
Hello("# Benjamin #") # this one too

def Hello (name)
    puts "\n-------------"
    puts "Hello, #{name}."
    puts '--------------'

puts '######'

[1, 2, 3, 4, 5].each do |i|
    puts "hello"

Hello("# Benjamin #")

Current programming languages that vim-uncommenter works with:
+ Ruby
+ Python
+ Perl
+ C
+ C++
+ C#
+ Rust
+ D
+ Go
+ Java
+ Javascript
+ ActionScript
+ Scala
+ Pascal
+ Swift
+ R
+ Vimscript
+ Shell
+ Makefile
+ Cobra
+ Seed7
+ Powershell
+ Erlang
+ Text
+ VBScript
+ Small Basic
+ AutoIt
+ Lisp
+ Scheme
+ Rebol
+ Haskell
+ Ada
+ AppleScript
+ Eiffel
+ Lua
install details

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-uncommenter-0.5.tar.gz 0.5 2016-01-07 7.0 Benjamin Radovsky Finished adding delete block comments functionality for most of the programming languages in the current list of languages that `vim-uncommenter` works with.
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
Vim at Github