neoclojure.vim


Ⅰ. 插件描述

Clojure completion/unite-source Vim plugin, using vital.ProcessManager and Leiningen

Ⅱ. 基本信息

创建日期:  2014-07-27
使用用户:  3
Github星:  37
插件作者:  ujihisa

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Powered by vital.vim

neoclojure

  • Code complete (fast and sync)
  • quickrun (slow and async)

    • libraries
    • under proj: uses the project
    • outside proj: uses dummy "unnamed" project
  • ref (fast and sync)
  • leiningen? (e.g. lein run)
  • executes project.clj
  • executes dependencies (including current project)
  • parses current buffer
  • spawns dummy unnamed project by stardup asynchronously
  • debugging itself

    • logger
    • test
    • fault tolerance

neoclojure.vim

  • Java method-name completion works (type (. in your clojure buffer)

    • no automatic import insertion yet
    • (ns ...) has to be located as the first expression of the file

Requirement

Optional dependency plugins

  • neocomplete.vim

    • If you don't have neocomplete.vim, use omni-complete
      <C-x><C-o> to trigger manual completion.
  • NOT YET -- unite.vim

Installation

~/.vimrc

augroup vimrc-neoclojure
  autocmd!
  " If you use neocomplete
  autocmd FileType clojure setlocal omnifunc=neoclojure#complete#omni_auto
  " Otherwise
  autocmd FileType clojure setlocal omnifunc=neoclojure#complete#omni
augroup END

If you have quickrun.vim, include this as well.

let g:quickrun_config.clojure = {
      \ 'runner': 'neoclojure', 'command': 'dummy',
      \ 'tempfile'  : '%{tempname()}.clj'}

Development progress / todo

  • SECURITY WARNING! This plugin executes your clojure/java code silently.
    This problem will be fixed before version 0.1 release.

(Current version is 0.1-dev)

* This plugin evaluates the first expression of the current file.
  If the first expression is `ns` with `:require` or `:use`, they will be evaluated, which means neoclojure will evaluate other files.
  Rest of expressions won't be evaluated though.

Philosophy

What neoclojure doesn't do:

  • neoclojure doesn't implement everything here.

    • It depends on embedded libraries.
    • It uses other plugins only if you already have.
    • It doesn't parse Clojure in Vim script. Let Clojure does that work; it knows more about itself.
  • neoclojure doesn't spawn Clojure daemon.

    • It just spawns Clojure process and communicate with stdout/stderr instead of socket.
    • When Vim dies, Clojure process also dies. That's what it should be.

FAQ

  • Q. neoclojure hangs for some reason!

    • A. is leiningen working? It doesn't work when clojars.org is down.

Links

http://twitter.com/neoclojure

Licence

GPL version 3 or any later version
Copyright (c) Tatsuhiro Ujihisa

添加新评论