What's the most elegant way of commenting / uncommenting blocks of ruby code in Vim?

前端 未结 10 678
悲哀的现实
悲哀的现实 2021-01-30 13:23

In VIM, at the moment when I need to comment out a section of Ruby code:

  • I navigate to the first column in the row I want to comment out
  • I press CTRL-v t
10条回答
  •  盖世英雄少女心
    2021-01-30 13:52

    I do almost the same thing as you.

    commenting:

    • visual block select with CTRL-V then I# (insert # in the begining)

    uncommenting:

    • visual block select with CTRL-V then X (delete the first symbol on the line)

    Please note uppercase I and X.

提交回复
热议问题