Ⅰ. 插件描述
check, analyze and inspect Clojure/Script code via the nREPLⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'severeoverfl0w/clojure-check'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'severeoverfl0w/clojure-check'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'severeoverfl0w/clojure-check'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/severeoverfl0w/clojure-check
Ⅳ. 文档说明
= Clojure Check: A command-line interface to checkers via nREPL
== Rationale
This is a quicker alternative to lein eastwood or lein kibit when you already have an nREPL running. The main driver is to be able to refer this from Vim for tools like https://github.com/w0rp/ale[ALE]
== Usage
=== Downloading
There are pre-built binaries available in the https://github.com/SevereOverfl0w/clojure-check/releases[releases]. I sign all releases, so look for the Verified sign!
=== Building
I use https://github.com/Masterminds/glide[glide] to build this project.
NOTE: I had to run git config --global http.https://gopkg.in.followRedirects true with the latest git.
[source,shell]
$ glide install
$ go build <1>
<1> Creates ./clojure-check
=== CLI usage
You can get output from eastwood & kibit on a running nREPL via
[source,shell]
$ ./output -nrepl localhost:33999 -namespace app.website -file - < src/app/website.clj<1>
$ ./output -nrepl localhost:33999 -namespace app.website -file src/app/website.clj
<1> Read from Stdin
=== REPL setup
[source,clojure]
.~/.lein/profiles.clj
{:user
{:dependencies
[[jonase/eastwood "0.2.3" :exclusions [org.clojure/clojure]]
[jonase/kibit "0.1.3" :exclusions [org.clojure/clojure]]]}}
[source,clojure]
.~/.boot/profile.boot
;; OR merge this with your cider task
(deftask linters "Linter profile"
[]
(require 'boot.repl)
(swap! @(resolve 'boot.repl/default-dependencies)
concat '[[jonase/eastwood "0.2.3" :exclusions [org.clojure/clojure]]
[jonase/kibit "0.1.3" :exclusions [org.clojure/clojure]])identity)
== Editor integration
Inspired by http://ddg.gg/[fzf] I have included a plugin folder in this repo which allows easy integration with Vim. I welcome similar PRs for other editors.
==== Vim - ALE
There is ALE integration available in this repo. It depends on Fireplace to find connection details.
Plug 'w0rp/ale'
Plug 'SevereOverfl0w/clojure-check', {'do': './install'}
==== Vim - Neomake
There is Neomake integration available in this repo. It depends on Fireplace to find connection details.
Plug 'neomake/neomake'
Plug 'SevereOverfl0w/clojure-check', {'do': './install'}
let g:neomake_clojure_enabled_makers = ['check']
==== Vim - makeprg
It's easy to integrate clojure-check with :make in Vim.
Plug 'SevereOverfl0w/clojure-check', {'do': './install'}
As parameters are required for making with this CLI, I suggest you also include the ClojureMake wrapper for :make to automatically insert those args, or any similar usage of the same thing.
.ftplugin/clojure.vim
let &makeprg=g:clojure_check_bin.' $* -file %'