vim使箭头键像大多数正常程序一样工作
我最近发现了VIM并开始使用它。我发现箭头和退格有缺陷。 所以我对退格做了这个vim使箭头键像大多数正常程序一样工作,vim,vi,macvim,Vim,Vi,Macvim,我最近发现了VIM并开始使用它。我发现箭头和退格有缺陷。 所以我对退格做了这个 set backspace+=indent,eol,start 如何对箭头键执行此操作以允许正常导航?您没有确切说明您认为箭头键的哪些方面存在“缺陷”,因此我只能猜测 您可以使用whichwrap设置获取您可能需要的部分内容。From:帮助,其包装为: 'whichwrap' 'ww' string (Vim default: "b,s", Vi default: "") globa
set backspace+=indent,eol,start
如何对箭头键执行此操作以允许正常导航?您没有确切说明您认为箭头键的哪些方面存在“缺陷”,因此我只能猜测 您可以使用
whichwrap
设置获取您可能需要的部分内容。From:帮助,其包装为
:
'whichwrap' 'ww' string (Vim default: "b,s", Vi default: "")
global
{not in Vi}
Allow specified keys that move the cursor left/right to move to the
previous/next line when the cursor is on the first/last character in
the line. Concatenate characters to allow this for these keys:
char key mode ~
b <BS> Normal and Visual
s <Space> Normal and Visual
h "h" Normal and Visual (not recommended)
l "l" Normal and Visual (not recommended)
< <Left> Normal and Visual
> <Right> Normal and Visual
~ "~" Normal
[ <Left> Insert and Replace
] <Right> Insert and Replace
For example: >
:set ww=<,>,[,]
allows wrap only when cursor keys are used.
When the movement keys are used in combination with a delete or change
operator, the <EOL> also counts for a character. This makes "3h"
different from "3dh" when the cursor crosses the end of a line. This
is also true for "x" and "X", because they do the same as "dl" and
"dh". If you use this, you may also want to use the mapping
":map <BS> X" to make backspace delete the character in front of the
cursor.
When 'l' is included and it is used after an operator at the end of a
line then it will not move to the next line. This makes "dl", "cl",
"yl" etc. work normally.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
“whichwrap”“ww”字符串(Vim默认值:“b,s”,Vi默认值:“”)
全球的
{不在Vi}
允许向左/向右移动光标的指定键移动到
光标位于中的第一个/最后一个字符时的上一行/下一行
排队。连接字符以允许对这些键执行此操作:
字符键模式~
b正常和视觉
这是正常的和视觉的
h“h”正常和可视(不推荐)
l“l”正常和可视(不推荐)
<正常和可视
>正常和可视
正常的
[插入并替换
]插入并更换
例如:>
:设置ww=,[,]
仅当使用光标键时才允许换行。
当移动键与删除或更改组合使用时
运算符,也对字符计数。这就是“3h”
与光标穿过直线末端时的“3dh”不同。这
对于“x”和“x”也是如此,因为它们与“dl”和“x”的作用相同
“dh”。如果使用此选项,可能还需要使用映射
“:map X”使退格删除
光标。
当包含“l”并且在一个操作符结束后使用时
行,则不会移动到下一行。这使得“dl”,“cl”,
“yl”等工作正常。
注意:当选择“兼容”时,此选项设置为Vi默认值
重置“兼容”时,将和设置为Vim默认值。
在您的情况下,您可能需要:
:set whichwrap+=<,>
:设置whichwrap+=
这将使左右环绕线端点
如果逻辑行和显示行之间的区别让您感到困惑,您还可以尝试在正常和可视模式下将
和
映射到gk
和gj
。或者,您可以:设置nowrap
以完全消除这种区别。这正是我想要的,谢谢