Feature Request / Question: Soft Wrap at Vertical Edge (Column 80) regardless of window size
-
Hi everyone,
I am using Notepad++ v8.9 (64-bit) and I am looking for a way to achieve a specific wrapping behavior.
My Goal: I want the text to “soft wrap” (visual wrap only, no CR/LF added to the file) exactly at the 80th column (at the last whitespace before 80).
The Problem: Currently, “Word Wrap” always wraps at the right window border. If my monitor is wide and the window is maximized, the text stretches across the whole screen. I have already set the “Vertical Edge” to 80, but this is just a visual line and doesn’t force the text to wrap there.
My Questions:
Is there any native setting I missed to force the soft wrap at the Vertical Edge column instead of the window border?
If not, is there a Plugin (compatible with v8.9) or a Python Script that can simulate this behavior?
I want to keep the file “clean” (no hard breaks) for further processing, but I need the 80-character readability for my creative writing (lyrics).
Thanks in advance for your help!
-
@Thorsten-Heuer Though I didn’t used this much but I have added this in NppVim plugin you
:set tw=60and:wraporgqmotion. I am not sure how to set text width in notepad++. -
@h-jangra said in Feature Request / Question: Soft Wrap at Vertical Edge (Column 80) regardless of window size:
I have added this in NppVim plugin [. . .]I am not sure how to set text width in notepad++
That’s interesting! I’d think that a NP++ plugin can only do things that are also possible in NP++ itself since the underlying engine is the same.
-
@h-jangra
I apologize, but I can’t find a way to set “:set tw=60 and :wrap or gq” in “NppVim”. I’m not a very experienced user; perhaps I’m missing some basic knowledge. -
@Thorsten-Heuer You can set the text width in command mode by typing
:set tw=80. This defines an 80-column wrap limit.After that, use V to select the line (visual line mode) and press
gqto reflow it according to that column width.Currently, this setting isn’t persistent between sessions. If you’d like it to be configurable (similar to Vim), feel free to open an issue, I can look into adding support for it.
-
@Thorsten-Heuer
You can set vertical edge though but then wrap will not work according to that.- Settings → Preferences → Margins/Border/Edge
- Enable Vertical Edge
- Set it to 80

-
@h-jangra I’ve tried it out:
- Installed the NppVim plugin
- entered the commands
set tw=30andwrap.
After the first command, a thin vertical line is displayed at the position 30; the second command activates text wrapping. But, as in the “usual” NP++, the wrapping is made at the windows right edge, not at the width set with
tw.It works exactly the same way it works in NP++ without NppVim. Which is not surprising because everything is backed by NP++ and Scintilla in the end.
It’s very surprising that Scintilla does not have an option to soft wrap the text at a specified width (not window edge).
-
@fml2 said in Feature Request / Question: Soft Wrap at Vertical Edge (Column 80) regardless of window size:
It’s very surprising that Scintilla does not have an option to soft wrap the text at a specified width (not window edge).
I must be missing something… it’s very surprising to me that if this is important to you, you wouldn’t just resize the window so the edge is where you want the file to wrap.
Two alternatives (though I admit I don’t see why either would be better than just resizing the window):
-
Open something in a docking panel, like View | Document Map, and drag the divider so that it lines up with the place you want to wrap.
-
Open a new tab, move it to the second view, and drag the divider to the place you want to wrap.
-
-
Not that soft wrapping of text at a specified column other than window width is something I do, but I can think of a few reasons why one may wish to avoid resizing the window, particularly so that it’s only 80 columns wide, to accomplish the desired effect: So that the menus and tool bar aren’t adversely affected.
If I wanted to achieve custom soft wrapping myself, I’d prefer NOT changing my window size specifically because I prefer having NPP open in the same custom location and size every time I run it, and I’d have to reverse my window size changes before closing NPP in order to maintain that.
One could also increase the zoom level until the desired wrapping occurs, though that, too, would have the potentially negative side effect of reducing the amount of text visible at a time.