When I’m writing a long line of text in vim (such as a paragraph in latex), it wraps my text into multiple lines which is good. However, if I then try to navigate these lines with ‘j’ and ‘k’ (or the up/down arrows) it will skip the entire paragraph. I fixed this problem by highlighting the paragraph and pressing gq. This inserts line breaks at the end of each line.
My question is, is there a way to automate this, so I don’t have to keep highlighting text and pressing gq?
You need to step back a little and use
gjandgkwhich go down and up inside wrapped lines.Since
gjandgkwork exactly the same asjandkin non-wrapped lines you can safely mapjor<down>togjandkor<up>togkmaking it all seamless.— EDIT —
Yes it doesn’t adress Eddy’s immediate problem but it solves his original problem (vertical movement in wrapped lines) which led him to a poor workaround that, in turn, put him in this situation.