In Emacs I can go one word forward and backward by using M-f and M-b but if I have to go three words backwards or forward I need to repeat the previous sequence three times which seems inelegant. What is the Emacs equivalent of the word-motion concept in Vim? For example, in Vim I can move forward by two words by issuing 2w
and backwards by issuing 2b
while I am in command mode.
You can use universal-argument
. There are two ways to move 3 words forward:
But that's usually slower than doing M-f 3 times. You know you don't have release M, right?
I do not know what vim's civ does, but to go to a word just search for it with C-s. If you like to jump around have a look at Ace Jump. It works like the follow links feature of browser plugins like vimperator. With it you can jump to lines, word or even chars.
Ok, I don't think there is a built-in for that. Maybe this function helps:
(defun delete-word-at-point ()
"Delete word at point."
(interactive)
(let* ((p (point))
(beg (+ p (skip-syntax-backward "w_")))
(end (+ beg (skip-syntax-forward "w_"))))
(kill-region beg end)))
Put it in your ~/.emacs
and bind to where you would like it. Maybe M-.:
(global-set-key (read-kbd-macro "M-.") 'delete-word-at-point)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With