u/enzodtz

▲ 5 r/neovim

Smart word wrap?

I’ve been recently working in a new codebase where there’s no max line width enforcement. Lines can get huge (>120 chars) really decreasing the readability of code in smaller screens (like a laptop).

Nvim has native word wrapping which can break lines like:

```
void longGiant…Function(type1 arg1, type2 arg2);
->
void longGiant…
Function(type1 arg1, type2 arg2);
```

Which helps a bit but not a ton (e.g when there are more arguments). I was hoping for a ‘smarter’ wrapper that took advantage of the code structure to achieve something more readable, almost as if there were different enforced formatting rules:

```
void longGiant…
Function(
type1 arg1,
type2 arg2);
```

Is there something that I could use to achieve this? Or how do you handle these? Should I just use a bigger screen / less zoom?

reddit.com
u/enzodtz — 2 days ago