vim-disapprove-deep-indentation


Ⅰ. 插件描述

ಠ_ಠ Vim plugin to disapprove deeply indented code. ಠ_ಠ

Ⅱ. 基本信息

创建日期:  2017-03-05
使用用户:  19
Github星:  566
插件作者:  Dávid Csákvári

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'dodie/vim-disapprove-deep-indentation'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'dodie/vim-disapprove-deep-indentation'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'dodie/vim-disapprove-deep-indentation'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/dodie/vim-disapprove-deep-indentation

Ⅳ. 文档说明

vim-disapprove-deep-indentation

This Vim plugin disapproves deeply indented code.

Disapproval in action

By default, it shows ಠ_ಠ at the beginning of each line that is indented at least 5 levels.
It can be configured with the following variables (setting them to 0 disables the feature):

let g:LookOfDisapprovalTabThreshold=5
let g:LookOfDisapprovalSpaceThreshold=(&tabstop*5)

Disapproval in action

Installation

You can easily install this Plugin with
Pathogen or
Vundle.

Vim needs to be compiled with +conceal for the face to appear.

Inspiration

The idea came from a comment made by StripTheFlesh in
this thread on Reddit:

Just use ಠ_ಠ for indents. It will remind you to not use a lot indentation levels.

How it works

The plugin uses Vim's conceal feature. It does not modify the source code in any way, the disapproving
look is just a visual indicator.

Styles for all concealed characters in Vim can be set with a single style rule. This plugin makes them
red in order to have a really disapproving look for the eye. If you are using this plugin in conjunction
with other plugins that rely on conceal feature (for example, indentLine),
you might want to disable this styling:

let g:LookOfDisapprovalNoStyle=1

Conceal depends on modifying the syntax highlighting rules. For some file types and syntax settings,
the rules defined in this plugin may conflict with the default rules applied for a filetype, making
the look of disapproval appear in the beginning of shallowly indented lines as well.

In the case you encounter this issue, feel free to open an issue.
Until it's fixed, you can disable the plugin for the problematic file types with the following command:

autocmd FileType SOME_FILETYPE let g:LookOfDisapprovalTabThreshold=0 | let g:LookOfDisapprovalSpaceThreshold=0

添加新评论