overlength.vim


Ⅰ. 插件描述

Highlight when lines go over the length that you want them.

Ⅱ. 基本信息

创建日期:  2017-06-28
使用用户:  4
Github星:  8
插件作者:  TJ DeVries

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'tjdevries/overlength-vim-please-everybody'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'tjdevries/overlength-vim-please-everybody'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'tjdevries/overlength-vim-please-everybody'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/tjdevries/overlength.vim

Ⅳ. 文档说明

## overlength.vim

Highlight when lines go over the length that you want them.

Usage

This plugin is on by default when you install it :smile:

To toggle or turn it off, you can do the following:

call overlength#toggle():

  • (Function): Turn on and off overlength highlighting
  • Example: call overlength#toggle()
  • Alternatives: call overlength#disable() or call overlength#enable()

Configuration

Example configuration:

let overlength#default_overlength = 120

" Disable highlighting in markdown.
call overlength#set_overlength('markdown', 0)

" Highlight only at 120 characters in vim, even though textwidth = 78
call overlength#set_overlength('vim', 120)

overlength#default_to_textwidth:

  • (Setting): Default to using the &textwidth option as the column to start drawing the overlength highlighting

    • Options:

      • 0: Don't use &textwidth at all. Always use overlength#default_overlength.
      • 1: Use &textwidth, unless it's 0, then use overlength#default_overlength.
      • 2: Always use &textwidth. There will be no highlighting where &textwidth == 0, unless added explicitly
  • Default: 1
  • Example: let overlength#default_to_textwidth = 0

call overlength#set_overlength(filetype, length):

  • (Function): Set a specific overlength value for a filetype

    • If set to 0, then overlength will not highlight for that buffer
  • Example: call overlength#set_overlength('python', 120)

overlength#default_overlength:

  • (Setting): Decide the default length when there is no filetype specific request

    • Depends on overlength#default_to_textwidth to be on an applicable setting
  • Default: 80
  • Example: let overlength#default_overlength = 72

overlength#default_grace_legnth:

  • (Setting): Decide how many spaces past your overlength you'd like to start highlighting
  • Default: 1
  • Example: let overlength#default_grace_legnth = 5

call overlength#set_highlight(cterm, guibg):

  • (Function): Change the highlighting background by specifying a cterm and guibg
  • Example: call overlength#set_highlight('darkgrey', '#8b0000')

overlength#highlight_to_end_of_line:

  • (Setting): Highlight only the column or until the end of the line
  • Default: v:true
  • Example: let overlength#highlight_to_end_of_line = v:false

添加新评论