In Vim, what is the best way to select, delete, or comment out large portions of multi-screen text?

前端 未结 16 1214
醉话见心
醉话见心 2021-01-31 09:43

Selecting a large amount of text that extends over many screens in an IDE like Eclipse is fairly easy since you can use the mouse, but what is the best way to e.g. select and de

16条回答
  •  星月不相逢
    2021-01-31 10:34

    The visual mode is the solution for your main problem. As to commenting out sections of code, there are many plugins for that on vim.org, I am using tComment.vim at the moment.

    There is also a neat way to comment out a block without a plugin. Lets say you work in python and # is the comment character. Make a visual block selection of the column you want the hash sign to be in, and type I#ESCAPE. To enter a visual block mode press C-q on windows or C-v on linux.

提交回复
热议问题