开发者

columnar cursor motions in vim?

开发者 https://www.devze.com 2023-01-23 05:09 出处:网络
I\'m wondering if there\'s a command in Vim I\'m missing that does columnar motion.What I\'m thinking of is common in some spreadsheets, where there\'s a key combination that will take you downward in

I'm wondering if there's a command in Vim I'm missing that does columnar motion. What I'm thinking of is common in some spreadsheets, where there's a key combination that will take you downward in the column to either the next blank cell, or if you're in a blank cell then it will take you to the next non-blank cell. Some text may illustate:

a-------
-------
-------
b-------

c-------
-------
-------
d-------


e-------
-------

What I'm looking for is most efficient way to move from a to b, from b to c, from c to d, from d to e. I know this can be done using / searches, but is there a more efficient way using something analous to the line-based motion commands? Seems like there should be, but I can't f开发者_如何学JAVAind it.


I'm not sure if this fits your request exactly but vim has sentence, paragraph, and section movement keys built-in. In your case, I think you probably want the paragraph ( '{' and '}' ) or section ( '[' and ']' ) motion keys.


Try this to jump between non-empty lines:

:nmap j /^.\+$<CR>
0

精彩评论

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