Wrap only current line ?
Would be amazing to have only the current line wrapped. Any idea, tips or plugin to perform this ?
Posted Jan 28, 2015, 6:27 PM UTC
Would be amazing to have only the current line wrapped. Any idea, tips or plugin to perform this ?
Posted Jan 28, 2015, 6:27 PM UTC
0gq$
This is not wrapping...it splits the current line in several "real" lines.
Well, you could join the lines again later. Hacky, but probably less hacky than applying some patch, etc?
There's probably a better way, but you can try shift-v gq .
So you want 'wrap', but only applied to the current line? I guess that might be useful for prose (with a whole paragraph on one line), but I think you'd need to patch vim to do it.
It sounds like such a nonobvious feature that I'd be surprised if it was already implemented. (What would 5gj do? etc)
You could hack something like an autocmd to split the current line and then re-join it when you move past it.
Maybe using splitjoin.vim will help ease your pain?
Maybe you can achieve the effect with conceal and a pattern that matches all lines but the current one. I'm on mobile and can't really attempt this, but maybe someone can run with it.
This is not current line wrap related, but it makes wrapping and indenting visually better:
http://www.reddit.com/r/vim/comments/2jjtad/this_picture_says_it_all_thanks_to_uchrisbra10/
Amazing ! Sadly, the vim in the repos of Ubuntu 14.04 doesn't seem to have this feature yet.
Yes, but you can compile you own version of vim. This is how I've done It: http://insidesblog.blogspot.fr/2013/07/compile-vim-by-yourself.html
Use case?
Very long lines and wrapping are annoying (break visually indenting, hide other lines), but no-wrapping at all is also annoying (need to move for reading, can't trigger efficiently f-moves).
Best of both world would be no-wrapping except for the current line that I want to read.