Ⅰ. 插件描述
Improves indentation of wrapped lines by updating showbreak for current line.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/breakindent-beta-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/breakindent-beta-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/breakindent-beta-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/breakindent_beta.vim
Ⅳ. 文档说明
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 textwidth=0
:set wrapmargin=0 " Attempts to disable auto-linefeed when typing
:set formatopts-=cq
:highlight NonText ctermfg=darkblue " Theme your indent symbols
:let g:breakindent_match_gap = 1 " Change breakindent settings