Kakoune: Missing feature: soft wrap

Created on 17 Nov 2015  路  18Comments  路  Source: mawww/kakoune

I couldn't find how to enable softwrap.

feature request

Most helpful comment

The wrap highlighter is now in master.

All 18 comments

Hello,

soft wrap is not supported yet, seems its a comonly requested feature, so I'll keep that issue open.

And by "softwrap" you mean only wrap the content of the buffer on the interface without actually inserting newlines and what not, right ?

Yes. What VIM does when set wrap. In the middle of the word or only on blanks is neat but secondary (IMHO).

Having an equivalent feature to vim's "breakindent" (indenting line wraps - including "showbreak") would be nice ;)

+1 for breakindent

Any news on this?

Thats requires a big refactoring, I have worked a bit on it, but many assumptions are broken once we dont have a display line <=> buffer line direct correspondance.

Thanks for the heads up @mawww.

This still is the number one showstopper for me. I just don't want to scroll left/right on long lines. Or am I missing something?

The way the backend is designed makes it pretty hard to implement, the feature still isn't available as of today.

I don't use soft wrap when I'm coding, but it's a must have for me when writing (plaintext, markdown, latex). This is a little plugin I wrote so that I can comfortably use kakoune for writing: dynamicwrap. As you type, it keeps the paragraph you are working in broken into sensible lines of under 80 characters. If you have suggestions for making it better, just open issues or shoot me a pull request.

This functionality already exists, it's implemented in autowrap.kak. Also the more idiomatic way of implementing such things is to use UNIX/POSIX tools whenever possible, i.e. fold.

I am working on this at the moment, current code is in the http://github.com/mawww/kakoune/tree/new-soft-wrap branch.

@maww, I'm really glad to know you're on it. I can't wait to see the result.

@lenormf, is autowrap configurable to mimic softwrap? When I enable it, I get far less functionality than I've built into dynamicwrap. Am I missing something? Here's an asciicast showing the differrence: asciicast Thanks for the tip about fold.

I've rewritten this script several times, and never got it completely right.

All bugs aside, this script was meant to provide as-you-type wrapping, whereas dynamicwrap does what would be a <a-i>p |fold -s -w %opt{columns}, except users have to compile it to get it to work. That's why it's not idiomatic/UNIX, as it reimplements something that a POSIX defined dedicated tool knows how to do -arguably better.

Feel free to fix autowrap.kak if you would like.

The wrap highlighter is now in master.

Is it yet possible to have similar functionality to breakindent?

@sullyj3 it would be possible to add a -indent switch to the wrap highlighter, that would preserve the line indent. Not sure how nice it would end up, but if its simple enough to implement we could experiment with it to see.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hwmack picture hwmack  路  4Comments

1g0rb0hm picture 1g0rb0hm  路  3Comments

akkartik picture akkartik  路  3Comments

a12l picture a12l  路  3Comments

lenormf picture lenormf  路  3Comments