Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In emacs, yanking works something like this: if you delete something, it can be yanked back into another position. In other words, emacs's yank is sort of like cut and paste. On the other hand, it seems like vim's yank is like copy and paste: I can yank something and then paste it elsewhere, but the original text is still there. Is there any way to cut the text rather than just copying it in vim?

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

Use d where you normally use y.

share|improve this answer
1  
In Vim, what you delete is kept in the buffer. So what you delete, you can indeed paste afterwards. –  Gnoupi Apr 28 '10 at 13:39
    
Doh! I can't believe I didn't try that. :-/ –  Jason Baker Apr 28 '10 at 15:50
1  
@Gnoupi: the vimish term is "register", one can see the content of the registers by ":registers" –  akira May 28 '10 at 5:52
add comment

You can also use x to delete individual characters (highlighted characters if in visual mode), and paste them using p.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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