vim-simlight


Ⅰ. 插件描述

Vim plugin for simple, extensible highlighting (by regex matching) of functions, namespaces, members and such.

Ⅱ. 基本信息

创建日期:  2013-03-12
使用用户:  4
Github星:  0
插件作者:  Dario Sneidermanis

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

simlight.vim

Vim plugin for simple, extensible highlighting (by regex matching) of functions,
namespaces, members and such.

It provides function (and namespace for C++) highlighting for several
languages out of the box. If your color scheme doesn't define the highlighting
groups for functions (or namespaces) you can define them in your vimrc.

For example:

hi Function  guifg=#afdfdf ctermfg=152
hi Namespace guifg=#a8a8a8 ctermfg=248

Options

These options are provided to fully configure and extend the plugin within its

  1. For a more sophisticated syntax highlighting scheme, you should consider
  2. ctags based plugin, such as

vimscript #2646.

The g:simlight_prefix_rules option

A dictionary with extra prefix rules. The prefix rule key should be its name,
and the value should be a string with the prefix (a vim regex, actually).

Default:

'Member': '.'
'PointerMember': '->'

The g:simlight_postfix_rules option

This option behaves exactly like g:simlight_prefix_rules but matches postfixes
instead of prefixes.

Default:

'Function': '('
'Namespace': '::'
'Array': '['

The g:simlight_highlight_groups option

A dictionary with extra highlight groups for rules. An entry's key should be a
rule name, and its value a list of highlight groups.

Notes:

  • For each rule, only the first existing group will be used.
  • The provided groups will be checked before the default ones.

Default:

'Function':     ['SLFunction', 'CTagsFunction', 'Function']
'Namespace':    ['SLNamespace', 'CTagsNamespace', 'Namespace', 'CTagsClass', 'Class', 'Type']
'Array':        ['SLArray', 'Identifier']
'Member':       ['SLMember', 'CTagsMember', 'Identifier']
'PoiterMember': ['SLPointerMember', 'SLMember', 'CTagsMember', 'Identifier']

The g:simlight_file_rules option

A dictionary with the rules for each file type. An entry's key should be a file
type, and its value a list of rule names to apply.

By using this option, you can add new file types, or override existing ones.

Default:

'c':          ['Function']
'cpp':        ['Function', 'Namespace']
'javascript': ['Function']
'csharp':     ['Function']
'java':       ['Function']
'python':     ['Function']
'matlab':     ['Function']
'php':        ['Function']
'vim':        ['Function']

The g:simlight_file_contained_in option

A dictionary with the containedin groups for each file type. An entry's key
should be a file type, and its value a list of syntax groups.

Some syntax files are ill-defined, or already match some of the same patterns,
so this option is provided to fix these cases.

Default:

'java':   ['javaParenT', 'javaParenT1', 'javaParentT2']
'python': ['pythonFunction']
'vim':    ['vimFuncBody', 'vimFunction', 'vimFuncName', 'vimUserFunc', 'vimExecute']

添加新评论