I know the linebreak
option can be used to soft-wrap lines within vim (without inserting any newlines into the file being edited).
However, I often need to navigate over long lines that have been wrapped. I am aware that gk and gj allow moving up and down display lines, rather than real lines in the file, but I need to be able to achieve this behaviour with other motions like $ (which should go to the end of the current display line, rather than going to the real end, which may be several display lines down).
Being able to manipulate display lines with linewise-visual mode would also be extremely useful. Is there any succinct way to achieve this? I know creating mappings, such as 0 g0
, $ g$
is an option, but I want this to work with all motions that deal in some way with lines, and making that many mappings would be quite inconvenient.
g
motions to theg
ones right? Such asmap j gj
andmap $ g$
etc. correct? There are really not many more commands that work differently when wrap is on... Which commands do you think you might be missing?dd
,yy
do not have an equivalent. Not all motions can just be prefixed withg
. There is nogy
, andgd
does something totally different. My problem is primarily when I want to use visual line mode to select a couple of lines (for deletion, yanking, etc), becauseV
would select all of the "lines", rather than the current one.dd
should do what, exactly?