I have a Ruby code file open in vi, there are lines commented out with #
:
class Search < ActiveRecord::Migration def self.up # create_table :searches do |t| # t.integer :user_id # t.string :name # t.string :all_of # t.string :any_of # t.string :none_of # t.string :exact_phrase # # t.timestamps # end end def self.down # drop_table :searches end end
Say I want to uncomment all the lines in the first def ... end
section. What’s an efficient way to do that in Vim?
In general, I’m looking for an easy and fluid way to comment and uncomment lines. Here I’m dealing with Ruby code, but it could be JavaScript (//
) or Haml (-#
).
Related Posts:
- Where is my .vimrc file?
- How to make vim paste from (and copy to) system’s clipboard?
- How can I quickly delete a line in VIM starting at the cursor position?
- How to copy to clipboard in Vim?
- Vim Can’t Save File (E212)
- Move cursor to end of file in vim
- What is Vim recording and how can it be disabled?
- Backspace key not working in Vim/vi
- vim and notepad++
- How do I change tab size in Vim?
- How to go back (ctrl+z) in vi/vim
- How to do case insensitive search in Vim
- Vim clear last search highlighting
- What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands in Vim?
- Changing case in Vim
- vi/vim editor, copy a block (not usual action)
- Why do I get comment spam even with Akismet and Captcha?
- What tools are available for managing/writing to WordPress? [closed]
- How to change “You must be logged in to post a comment.”
- comment_post_ID 0 (cannot remove from dashboard)
- How to change the email notification recipient (user) for new comments?
- How can I add comments to a page?
- How to remove comment spam in WordPress
- get comments and get posts in loop
- Facebook comments box on front page
- How can I see all of a post’s comments on a single page as a reader, if pagination is enabled?
- Vanilla Forums as a replacement for WordPress comments?
- Add comments meta fields to comments metabox on post edit screen
- How can change wordpress comment reply text for specific pages only?
- How to display only logged in user’s post comments in comments area
- Expanding the allowed HTML tags in comments?
- comments are coming on improper posts
- Is there any way to override “break comments into pages” and “close comments for old posts” on certain posts, but not on others?
- Disable comments from showing up public for Custom Post Type
- How to Add a Random Custom Gravatar in the WordPress Comments?
- Is it possible to make wp insert last comment onto another page
- Comments not nesed with custom template
- edit_comment capability for subscriber
- Loading post comments after clicking a button
- Follow-up Comments Notification Without a Plug-in
- How to change i18n/l10n of #reply-title? (Old title: Comment reply link not working)
- oEmbed does not work for comments
- Ability to comment on tags that represent a certain “issue”
- using comments_template() in custom single-portfolio.php
- Display User Role Next To Comment
- Comment Form – E-mail Not Required!
- Get a total count for all comments and display result
- Notification if Comment Author Field is left empty. E.g. change input border colour
- Enable Comments Box On Custom Post Type
- Add custom field in comments form
- How to update Comment post meta through an Ajax call
- List comments received by every posts of an specific author
- Declaring in variables [closed]
- Commenting out unwated CSS/scripts in HTML with PHP
- php function to display commenter username or login
- Display date and time in comments
- How do I reply to comments from admin panel on a tablet PC?
- Disable comments for a user? [closed]
- Showing author page if user has no post
- Restrict user role Author from viewing comments in admin interface
- Ajax submit comments
- Enable nested comments in Theme
- How do I automatically insert some text in the comment textbox on submit?
- I cannot view the comments
- In wp_list_comments comment dates won’t work?
- Help with comments.php
- Send a mail to specific address in a custom field when a new comment is made on a specific post
- how to SELECT for the current post id?
- Replying to comments
- Custom comment link
- How to save comment name email url fields?
- How to display the user’s comment status on the front end
- unsetting required fields in the comment reply form
- Problem code and show comments
- Allowing WordPress.org/com accounts on a self-hosted install
- How to remove the “comments” bit that appears next to or below the posts
- Post comments don’t show
- Merge get_comments & get_posts into a single query
- Closing Comments conditionally in comments.php
- Automatically reject a comment if website field contains anything
- Pre- Approved Comment Capability
- Delete comments function
- Comment form not working
- AddThis Plugin adding html comments in P tags
- Comments page id wp_list_comments
- Removing categories, Comments etc from posts?
- wp-editor-area textarea disapear on cancel-comment-reply-link click
- Conditionally process comments while ignoring replies
- Required Field for Comment parent only?
- Can I use WP comments for custom tables?
- WP Custom Comment Callback Not Responding
- How to fix vanilla comments extra iframe space
- writing a plugin, how to disable the comment form altogether?
- Reply form used in wordpress.com
- Function to get a list of all comments on 1 post [closed]
- Get Comment With Meta value
- Auto delete WordPress comments
- How to Allow Users to Select Recipients In a WordPress Comment section?
- Undefined Function Fatal Error with Shortcode [closed]
- Add pending for reply comment in console WordPress