Quantcast
Channel: How to delete (not cut) in Vim? - Stack Overflow
Browsing all 10 articles
Browse latest View live

Answer by enikar for How to delete (not cut) in Vim?

There is another solution. That consists in copyingline to copy over line to delete, like this.Put the cursor at the begin of line of line to copy and then enter ddVpdd kill the line to be copiedV...

View Article



Answer by mowwwalker for How to delete (not cut) in Vim?

I ended up withnnoremap p "0pnnoremap P "0Pvnoremap p "0pvnoremap P "0Pvnoremap x "0xnnoremap x "0xAlways paste from the 0 register instead of the unnamed one. Use x in visual mode to delete into the 0...

View Article

Answer by qz3065863 for How to delete (not cut) in Vim?

I use noremap '"_ in my .vimrcThis keep the behavior of dd, so I can use it to cut as before.But when I really want to delete something, just use the prefix '. For example: 'dd,'dw

View Article

Answer by Atemu for How to delete (not cut) in Vim?

yyVxpWhen in visual mode, x will delete the selection, so if you want to delete a whole line, first press V to select the line in visual mode and then press x to delete the selection.

View Article

Answer by pazams for How to delete (not cut) in Vim?

the following mappings will produce: d =>"delete" leader d =>"cut"nnoremap x "_xnnoremap d "_dnnoremap D "_Dvnoremap d "_dnnoremap <leader>d ""dnnoremap <leader>D ""Dvnoremap...

View Article


Answer by cutemachine for How to delete (not cut) in Vim?

The black hole register"_ will do the trick, but there is a better solution:When you enter the line back with the p command you are pasting the contents of the (volatile) default register"", which has...

View Article

Answer by kprobst for How to delete (not cut) in Vim?

That's one of the things I disliked about vim... I ended up mapping dd to the black hole register in my .vimrc and life has been good since:nnoremap d "_dvnoremap d "_d

View Article

Answer by romainl for How to delete (not cut) in Vim?

Use the "black hole register", "_ to really delete something: "_d.Use "_dP to paste something and keep it available for further pasting.For the second question, you could use <C-o>dw. <C-o>...

View Article


Answer by Alex for How to delete (not cut) in Vim?

You can use "_d to prevent things from overwriting your yanked text. You can store yanked or deleted text in whatever register you want with ", and _ is the 'black hole' register, where you send stuff...

View Article


How to delete (not cut) in Vim?

How can I delete a line without putting it into my default buffer?Example:line that will be copied.line that I want to be substitued with the previous one.What I'm trying to do:yyddpBut Vim replaces...

View Article
Browsing all 10 articles
Browse latest View live


Latest Images