我正在使用 PuTTY 和 vi 编辑器。如果我用鼠标选择了 5 行,我想删除这些行,我该怎么做?
另外,如何使用键盘选择行,就像在 Windows 中按 Shift 并移动箭头以选择文本一样?我如何在 vi 中做到这一点?
最佳答案
I am using PuTTY and the vi editor. If I select five lines using my mouse and I want to delete those lines, how can I do that?
忘记鼠标。要删除 5 行,可以:
Also, how can I select the lines using my keyboard as I can in Windows where I press Shift and move the arrows to select the text? How can I do that in vi?
正如我所说,要么使用 Shift-v 进入逐行选择模式,要么使用 v 进入逐字符选择模式,或者使用 Ctrl-v 进入进入分 block 选择模式。然后用 h、j、k 和 l 移动。
我建议花一些时间在 Vim Tutor 上(运行 vimtutor
),以一种非常具有指导意义的方式更加熟悉 Vim。
https://stackoverflow.com/questions/3114936/