我有一个在vi中打开的Ruby代码文件,其中的行注释为#:
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
假设我要取消注释第一def ... end部分中的所有行。在Vim中执行此操作的有效方法是什么?
总的来说,我正在寻找一种简单而流畅的方式来注释和取消注释行。在这里,我正在处理Ruby代码,但是可能是JavaScript(//)或Haml(-#)。