Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

NotificationsYou must be signed in to change notification settings

clojure-vim/async-clj-highlight

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

demo

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

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

Requires:

While Vim ships withvim-clojure-static, this plugin uses a feature from averyrecent version.

If you'd likevim-clojure-highlight ported to another REPL plugin, pleasecreate an issue! This can be done quite easily.

Installation

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

Usage

vim-clojure-highlight installs an autocommand that detects and highlightslocal vars, ns-refers, and aliased references every time a*.clj fileis (re)loaded. The syntax highlighting reflects the state of the REPL, sounevaluated 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 customautocommand or mapping to do the same.

Eager loading

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

" Evaluate Clojure buffers on loadautocmdBufRead*.cljtry |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:

autocmdSyntaxclojure EnableSyntaxExtension

For example, this is how you might enablerainbow_parentheses.vimfor Clojure buffers:

autocmdVimEnter*       RainbowParenthesesToggleautocmdSyntaxclojure RainbowParenthesesLoadRoundautocmdSyntaxclojure RainbowParenthesesLoadSquareautocmdSyntaxclojure RainbowParenthesesLoadBraces

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure63.2%
  • Lua28.5%
  • Vim Script8.3%

[8]ページ先頭

©2009-2025 Movatter.jp