且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Vim 选择多行的结尾(块模式,但结尾列有所不同)

更新时间:2023-08-26 17:20:46

  1. 将光标放在要成为块一部分的左上角字符上.
  2. 使用 ctrl+v
  3. 进入块选择模式
  4. 使用 $ 选择到行尾(这是您缺少的步骤;如果您使用 移动到第一行的末尾$ 然后选择将扩展到后续行的末尾)
  5. 使用 3j
  6. 向下移动 3 行
  1. Put your cursor on the top-left character you want to be part of the block.
  2. Enter block selection mode with ctrl+v
  3. Select to the end of the line with $ (this is the step you're missing; if you move to the end of the first line using $ then the selection will extend to the end of subsequent lines as well)
  4. Move down 3 lines with 3j

Vim 文档中关于可视模式的部分有更多信息,您可以在线阅读,或者在 Vim 中输入 :help v_$.

There's more information in the Vim documentation's section on visual mode which you can read online, or just type :help v_$ in Vim.