I'm noticing odd behaviour when I select some text with control-space and use p to paste -- in that the paste is done after the cursor character, rather than on the next line. Is that intentional, configurable, or a bug? This is evil from git.

For example, if my buffer is


When I copy the first two lines (cursor on 'o', C-space, jj, M-w) and paste with the cursor on 'f' of the last line, then the result is


If I use 2yy to copy the lines then the paste works as expected.

My .emacs contains minimal evil configuration, but removing it makes no difference.

(setq evil-cross-lines t
      evil-move-beyond-eol t
      evil-want-fine-undo t
      evil-symbol-word-search t)

(define-key evil-normal-state-map "\C-w" 'evil-delete)
(define-key evil-insert-state-map "\C-w" 'evil-delete)
(define-key evil-visual-state-map "\C-w" 'evil-delete)
  • I believe that's intended. That's how paste works with vim. – Yash Yadavalli Jul 17 '17 at 13:19
  • If it behaves the same as in Vim, it's not a bug. The whole point of Evil is to be a faithful Vim emulation. – wasamasa Jul 17 '17 at 17:34
  • Hmm, if I do a visual mode select in vim, y and p, then it does indeed behave the same way. I never use visual mode in vi, so never noticed. Viper behaves differently (and makes more sense IMHO), but I get your point in faithful emulation. So what is the best way to copy-paste as I want, if I want to use c-space select? It's very clumsy to have to create a new line first (o, esc), and then paste. – Rob Kramer Jul 18 '17 at 3:15

Your Answer

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

Browse other questions tagged or ask your own question.