breakindent_beta.vim : Improves indentation of wrapped lines by updating showbreak for current line.
| script karma
Downloaded by 326
Comments, bugs, improvements
script versions (upload new version)
|BreakIndent Beta tries to make wrapped lines look neater and less disruptive, by updating showbreak to indent them to the same column as the currently focused line.
Warning: Because it changes showbreak, it can cause lines to visibly shift up and down when a new indent is applied. To reduce how often this happens, you can enable breakindent_update_rarely, breakindent_match_gap or breakindent_never_shrink.
BreakIndent Beta is a pure vimscript alternative to the old breakindent patch, which I failed to get working smoothly in modern Vim. Unlike the breakindent patch, this vimscript *cannot* present a different indent for each line. Instead it updates the showbreak option to fit the indent of the current cursor line. Unfortunately this means that showbreak can change often, and other lines on the display may not appear at the ideal indent.
Some commands that may be useful when wrapping long lines:
:set wrap " This script does nothing in nowrap mode
:set linebreak nolist " Break lines cleanly at word gaps, hides tabs
:set list " Visible tabs, breaks words anywhere
:set wrapmargin=0 " Attempts to disable auto-linefeed when typing
:highlight NonText ctermfg=darkblue " Theme your indent symbols
:let g:breakindent_match_gap = 1 " Change breakindent settings
|Drop the script in your plugin folder, or just source it when you need it.
See the source code for options, all of which can be changed at runtime through global vars.
Click on the package to download.
ip used for rating: 18.104.22.168