Ⅰ. 插件描述
A plugin to show spaces at the beginning of linesⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'guiniol/vim-showspaces'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'guiniol/vim-showspaces'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'guiniol/vim-showspaces'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/guiniol/vim-showspaces
Ⅳ. 文档说明
# vim-showspaces
A plugin to show spaces at the beginning of lines
This plugin was created to help deal with collaborators who mix tabs and spaces.
It shows spaces at the beginning of a line even if they are mixed with tabs.
Usage
Activate the highlighting by setting the b:showSpaces to 1:
let b:showSpaces = 1If you want to only activate it for some filetypes put it in the corresponding
ftplugin, otherwise in your vimrc.
The plugin also gives a ToggleShowSpaces command which toggles the highlighting
when you call it.
Configuration
There are two things that can be configured:
- Using concealchars
- Changing the highlight color
Using concealchars makes the spaces more visible, but the highlighting disappear
when the cursor is on the same line. Also, some other plugin could be using it.
Enable them in your vimrc:
let b:showSpacesConceal = 1To change the highlight color, set the color for the MoreSpacesAtBeginning
group (The default colors are the ones from ErrorMsg):
hi! link MoreSpacesAtBeginning Error " to set it to the colors of Error
hi! MoreSpacesAtBeginning ctermfg=13 ctermbg=2 " to set the colors manually