开发者

Why VIM's (jk) navigate file line instead of screen line? [closed]

开发者 https://www.devze.com 2023-02-16 01:27 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

Why VIM set the default line navigation (jk) to navigate file开发者_StackOverflow中文版 line instead of screen line. Is there any use-case when this behavior is desirable?


You can change the behavior by adding these to your .vimrc:

nnoremap j gj
nnoremap k gk


Actually this is a desirable case particularly for blockwise selection and alignment of lines.

I particularly appreciate j and k to be consistent, which means ‘move to next file line, same column’.

Just consider that you can do this: by using CTRL-V and then j$.

Why VIM's (jk) navigate file line instead of screen line? [closed]

Of course this is a completely random example and I never had any error accessing SO.

0

精彩评论

暂无评论...
验证码 换一张
取 消