开发者

Fast switching between two lines in file in vim

开发者 https://www.devze.com 2023-01-16 15:04 出处:网络
sometimes开发者_如何学JAVA I have to switch between 2 lines. To do this, I have to pass line number. Are there shortcuts to moving between 2 last \'visited\' list. Something similar to \'. (it moves t

sometimes开发者_如何学JAVA I have to switch between 2 lines. To do this, I have to pass line number. Are there shortcuts to moving between 2 last 'visited' list. Something similar to '. (it moves to last edited line)


You can use bookmarks, something like ma to mark a bookmark named a, and then 'a to go to it. Naming boomarks a and b for example, you can switch between them with 'a and 'b.


Double-backtick or double single-quote will do exactly that

There is a command that will bounce to the last location you jumped away from. If repeated, it will then return to the jump destination you were just on. If repeated further it will bounce you back and forth between the two locations.

The command has two forms:

``

or

''


ctrl-o and ctrl-i will move backwards and forwards through your history of jump points. A jump point is pretty much any command that moves the cursor more than one line. It will also go back to previous files that were loaded into the current buffer.

See :h jump-motions for more information.

0

精彩评论

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