如何在viemu中使用插入模式移动光标(不使用箭头键)?

时间:2020-12-21 08:40:10

sometimes i just want to move either left or right a couple of characters (or go to the end of the line) but don't really want to leave insert mode just to move a couple chars.

有时候我只想向左或向右移动几个字符(或者到达行的末尾),但实际上并不想离开插入模式只是为了移动几个字符。

2 个解决方案

#1


I don't know about viemu and visual studio, but in vim, you can use <Ctrl-o> to enter a single command while in insert mode, so <ctrl-o>2l will move you 2 characters to the left, and <ctrl-o>$ will move you to the end of the line.

我不知道viemu和visual studio,但是在vim中,你可以在插入模式下使用 输入单个命令,所以 2l会向左移动2个字符, $会将您移动到行尾。

#2


There is no way of moving the cursor which is easier than just using the arrow keys, thats what they are there for. Insert mode is for inserting text, not navigating the file. If you would like to be so pedantic about not using the arrow key then there is a solution for you:

没有办法移动光标比使用箭头键更容易,这就是它们的用途。插入模式用于插入文本,而不是导航文件。如果你想对不使用箭头键这么迂腐,那么有一个解决方案:

  1. press
  2. use 'HJKL' keys until at destination
  3. 使用'HJKL'键直到目的地

  4. press 'i'

#1


I don't know about viemu and visual studio, but in vim, you can use <Ctrl-o> to enter a single command while in insert mode, so <ctrl-o>2l will move you 2 characters to the left, and <ctrl-o>$ will move you to the end of the line.

我不知道viemu和visual studio,但是在vim中,你可以在插入模式下使用 输入单个命令,所以 2l会向左移动2个字符, $会将您移动到行尾。

#2


There is no way of moving the cursor which is easier than just using the arrow keys, thats what they are there for. Insert mode is for inserting text, not navigating the file. If you would like to be so pedantic about not using the arrow key then there is a solution for you:

没有办法移动光标比使用箭头键更容易,这就是它们的用途。插入模式用于插入文本,而不是导航文件。如果你想对不使用箭头键这么迂腐,那么有一个解决方案:

  1. press
  2. use 'HJKL' keys until at destination
  3. 使用'HJKL'键直到目的地

  4. press 'i'