Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
764 views
in Technique[技术] by (71.8m points)

vim moving with hjkl in long lines (screen lines)

enter image description here

The highlighted text is the array in which I want to move. I have to press g before pressing j to move a line down. Is there some mapping for my .vimrc that I can just use hjkl to move in screen lines without pressing g every time.

Thanks for your help Matthias

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can remap the j and k keys (not sure if you really need h and l..)

:map j gj
:map k gk

Once you tried and liked them, add them to your .vimrc without the leading :


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...