0

Any easy way to get forward/backword word movement with "word" defined as everything non-whitespace, similar to vim's W and E?

  • 1
    You may also consider evil. – xuhdev Mar 13 '17 at 5:32
1

I don't know exactly what vim does, but something like this?

- and ^- represents whitespace syntax and non-whitespace syntax respectively.

(defun my-forward-word ()
  "Forward to the end of the 'word at point' (vim-like)."
  (interactive)
  (skip-syntax-forward "-")
  (skip-syntax-forward "^-"))

(defun my-backward-word ()
  "Backward to the start of the 'word at point' (vim-like)."
  (interactive)
  (skip-syntax-backward "-")
  (skip-syntax-backward "^-"))
1

I found (foward-whitespace) I think it's close enough.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.