vim-clojure-highlight


Ⅰ. 插件描述

Extend builtin syntax highlighting to referred and aliased vars in Clojure buffers

Ⅱ. 基本信息

创建日期:  2014-01-14
使用用户:  311
Github星:  84
插件作者:  Sung Pae

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

     _                 .-.       _                  .-.   _     .-.  .-.  _     .-.  .-.
    :_;                : :      :_;                 : :  :_;    : :  : : :_;    : : .' `.
.-..-.-,-.,-.,-. .  .--.: :  .--..-.-..-.--. .--.  . : `-..-..--.: `-.: : .-..--.: `-`. .'
: `; : : ,. ,. :`,`'  ..: :_' .; : : :; : ..' '_.:`,`: .. : ' .; : .. : :_: ' .; : .. : :
`.__.:_:_;:_;:_;   `.__.`.__`.__.: `.__.:_; `.__.'   :_;:_:_`._. :_;:_`.__:_`._. :_;:_:_;
                              .-. :                         .-. :           .-. :
                              `._.'                         `._.'           `._.'

Extend builtin syntax highlighting to local, referred, and aliased vars in
Clojure buffers.

demo

Exclusions from clojure.core (via (:refer-clojure)) are also reflected.

This is essentially a re-implementation of the dynamic highlighting feature
from Meikel Brandmeyer's VimClojure project.

Requires:

While Vim ships with vim-clojure-static, this plugin uses a feature from a
very [recent version][].

If you'd like vim-clojure-highlight ported to another REPL plugin, please
create an issue! This can be done quite easily.

Installation

Install as a normal Vim plugin. If you are unfamiliar with this process,
please refer to Pathogen.

Usage

vim-clojure-highlight installs an autocommand that detects and highlights
local vars, ns-refers, and aliased references every time a *.clj file
is (re)loaded. The syntax highlighting reflects the state of the REPL, so
unevaluated references remain unmatched.

This will fail silently if no fireplace nREPL sessions exist.

Reload your buffer with :e after an eval to update syntax matches.
Alternately, use the :ClojureHighlightReferences command in a custom
autocommand or mapping to do the same.

Eager loading

If you would like to eager-load a fireplace session so that
vim-clojure-highlight works on the first load of a clojure file, install an
autocommand hook that calls :Require:

" Evaluate Clojure buffers on load
autocmd BufRead *.clj try | silent! Require | catch /^Fireplace/ | endtry

Rainbow parentheses and other syntax extensions

Since vim-clojure-highlight dynamically alters the syntax state of a buffer,
it's possible that other syntax extensions will be affected by this plugin.

A simple workaround is to activate Clojure syntax extensions in an autocmd:

autocmd Syntax clojure EnableSyntaxExtension

For example, this is how you might enable
rainbow_parentheses.vim
for Clojure buffers:

autocmd VimEnter *       RainbowParenthesesToggle
autocmd Syntax   clojure RainbowParenthesesLoadRound
autocmd Syntax   clojure RainbowParenthesesLoadSquare
autocmd Syntax   clojure RainbowParenthesesLoadBraces

See doc/vim-clojure-highlight.txt for more commands and options.

添加新评论