27
當我切換緩衝區並返回時(基本上當我回到以前打開的任何緩衝區時),光標放在行的開始處,失去以前的位置。這非常煩人。Vim光標在緩衝區切換後跳到行首
當我切換緩衝區並返回時(基本上當我回到以前打開的任何緩衝區時),光標放在行的開始處,失去以前的位置。這非常煩人。Vim光標在緩衝區切換後跳到行首
您可以使用設置
:se nostartofline
或短:
:se nosol
文檔:
*'startofline'* *'sol'* *'nostartofline'* *'nosol'*
'startofline' 'sol' boolean (default on)`
global
{not in Vi}
When "on" the commands listed below move the cursor to the first
non-blank of the line. When off the cursor is kept in the same column
(if possible). This applies to the commands: CTRL-D, CTRL-U, CTRL-B,
CTRL-F, "G", "H", "M", "L", gg, and to the commands "d", "<<" and ">>"
with a linewise operator, with "%" with a count and to buffer changing
commands (CTRL-^, :bnext, :bNext, etc.). Also for an Ex command that
only has a line number, e.g., ":25" or ":+".
In case of buffer changing commands the cursor is placed at the column
where it was the last time the buffer was edited.
NOTE: This option is set when 'compatible' is set.
每當我保存的緩衝區,將光標移到了緩衝區的開始,這個答案也解決了我遇到的問題。謝謝。 – qed