Answer the question
In order to leave comments, you need to log in
Features of line wrapping in VIM?
I'm just learning vim and I've come across a strange (for me) behavior ( see the explanatory example below ).
There are several long lines of text in Russian that do not fit into one screen line.
I use the settings ( wrap and lbr! )
In this case, the lines wrap and continue from a new screen line.
Everything is fine here. But then ...
After the transfer, it is worth adding something to the new screen line except for spaces, as it becomes not a screen line, but a real line!
Those. vim with some fright adds the end of the line (checked with gedit) in the middle of the real line.
This behavior is observed when opening a plain text file (*.txt) This behavior is not observed when creating new text (until it is saved).
Question: is it possible to get rid of it?
With what it can be connected?
Example:
Writing (two lines):
sdfkl dsjflksdf d flksdf sdjfklsd fkdlf sdjklfsd fjlksdf sdkfl sdfklsd flksdjf lskdfj dklfj sfkljs dflksjdf klsdfj sdklfj slkdfj sdklfj sdklfj sdlkfj sdklfj skldjf lksdjf lksd
sdjflk
: w tmp.txt
We press on the top line in the normal mode A
and an input: "d"
As a result, already we obtain:
sdfkl dsjflksdf d flksdf sdjfklsd fkdlf sdjklfsd fjlksdf sdkfl sdfklsd
flksdjf lskdfj dklfj sfkljs dflksjdf klsdfj sdklfj slkdfj sdklfj sdklfj
sdlkfj sdklfj skldjf lksdjf lksd d
sdjflk
: w
And tmp.txt obtain 4 lines instead of two.
The behavior is the same in the terminal version and in gtk. When erasing the settings I made, the result does not change.
VIM - Vi IMproved 7.3
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question