One of the revelations I came to after a while of using emacs is that you can use searching (orswiping) to efficiently move to another place in the visible buffer. In other words, you can see the place that you want the cursor to be so you do a search for a word close to that position to move the cursor there – not because you want to find that word.
The package avy gives an even more efficient way to do this. There are a few options, but with the configuration below, I look at the place I want the cursor to be, hit
M-s and type the first character of a word close to that position, and then the short string that appears in order to select the word that I want and the cursor jumps there. Once you get used to it, it almost feels like you can move the cursor just by looking where you want it to go!
In the animation below I want to move the cursor to the start of the word “formed” near the bottom of the window, so I hit
M-s and then
avy then overlays letter combinations on all words starting
fand I type “la” to move to the word I want.
Here is my configuration code for
(use-package avy :ensure t :bind (("M-s" . avy-goto-word-1)))
原文出处: Pragmatic Emacs:
原文时间: 2016-04-09 00:24
整理时间: 2016-04-22 03:14
本文由 Hick 整理，转载请保留以上信息;
The articles on this site come from Internet, thanks to all the original authors.
If anything about COPYRIGHT, or LEFT, please contact Emacsist at gmail dot com .