vim question - wrap 23 September 2022, 21:26:11 I am certain there is a setting for doing this, having seen so many personalized .vimrc scriptsYet, I cannot find anything for this, so I have to ask, since there is no way I will ever find it (I have spent like 4 hours reading random threads lol)I have set wrap. A line starts from 0 character in the line, so the wrap in 2nd line starts from 0 character, all good.But if a line starts from a tab/indentation, it wraps from 0 character in the line, making the whole text look ugly and hard to look at first glance.See attached image. Look at packet for example. The line below should start on the same vertical line with packet, but it starts 4 characters behind. Same for the other categories (Link, Listener), the wrapped line(s) always start from 0. My goal is to get them to start from whatever the start of the line is. Any help is appreciated, as I have so much text ported from Windows which is just impossible to read in vim, yet Notepad++ had this feature this I ask, and I cannot convert >10k+ lines :(
Re: vim question - wrap Reply #1 – 24 September 2022, 02:09:25 It may not be quite what you're looking for, but in vim, when you're in normal mode you can use gq<motion> to change the text within the motion to be put on lines that are set to your maximum line width (which is 80 by default I believe). gqq will do this for your current line. If the text starts with white space it respects it (because it is just another character).
Re: vim question - wrap Reply #2 – 24 September 2022, 13:28:02 It's an interesting workaround, as with a macro I could speed up conversion. But sadly it creates newlines, and its not the target resultThank you for the command, especially `gqq`, it is good to know. But I hope some1 can find some kind of setting so I permanently change vimrc without manually changing anything. I'm sure I'm not alone in this vim target behaviour
Re: vim question - wrap Reply #3 – 24 September 2022, 14:23:17 I think I found it here the command is:Code: [Select]set breakindent
Re: vim question - wrap Reply #4 – 24 September 2022, 17:02:16 It works!I didn't expect it to be so simple, expected it to be some autistic bash script or sthThank you very much. To understand how much you helped me with this simple thing:I used windows 7 (for over 7 years?) and I have accumulated many text files needed for my work and hobbies. While I could open them with vim, since the formating was different, I couldnt write on them (without making them unreadable on windows) and so, I had to reboot to windows and write whatever new stuff I wanted to add -_-You pretty much solved this problem, as I now can write onto these windows files from my linux <3