Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim line operations (e.g., dd) on wrapped text

Tags:

vim

word-wrap

I'm using wrap in vim, but I want vim to otherwise behave as though the lines have actual breaks in them (rather than "soft breaks" for screen rendering).

I've mapped j to gj and k to gk for navigation. However, line operations (such as dd) still act upon the whole line, rather than the "screen line". Is there any way to alter this behavior such that 'dd' is limited to the screen line?

like image 419
muckabout Avatar asked Feb 21 '23 01:02

muckabout


1 Answers

You can create a key mapping:

:nnoremap dd g0dg$
like image 172
kev Avatar answered Mar 03 '23 11:03

kev