vim-cider


Ⅰ. 插件描述

Additional IDE-like functionality for Clojure development using cider-nrepl

Ⅱ. 基本信息

创建日期:  2015-05-17
使用用户:  5
Github星:  39
插件作者:  clojure-vim

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# cider.vim

Some additional IDE-like functionality for Clojure development on Vim using
cider-nrepl and
refactor-nrepl.

Using

Requires fireplace.vim, cider-nrepl
and refactor-nrepl middlewares:

Leiningen, ~/.lein/profiles.clj

{:user {:plugins [[cider/cider-nrepl "0.9.1"]
                  [refactor-nrepl "1.1.0"]]}}

Boot, ~/.boot/profile.boot

(swap! boot.repl/*default-dependencies*
       concat '[[cider/cider-nrepl "0.9.1"]
                [refactor-nrepl "1.1.0"])

(swap! boot.repl/*default-middleware* conj
       'cider.nrepl/cider-middleware
       'refactor-nrepl.middleware/wrap-refactor)

Cider-nrepl takes care of all other dependencies so you don't need to depend
e.g. on cljfmt.

Features

  • Code formatting (uses cljfmt)

    • =ff (current form), =f{motion}, =F (current file)
  • Var undef / alias unmap

    • cdd
  • Clean ns (eliminate :use, sort, remove unused stuff and duplication)

    • <F4>
  • Resolve missing

    • cRR (TODO: Find better binding)
    • <F5>: findSymbol (TODO: Find better binding)

Configuration

If you do not like the default bindings, you can disable them and create your

  1. Check the implementation file for <Plug> bindings.
let g:cider_no_maps=1 " Disable built-in mappings

" Set refactor-nrepl options 
let g:refactor_nrepl_options = {
    \ 'prefix-rewriting': 'false',      " tell clean-ns to not use prefix forms
    \ 'prune-ns-form': 'false',         " ... and don't remove unused symbols
    \ }

" Setup visualmode bindings yourself, to some keys which don't interact
" with e.g. change command
autocmd FileType clojure xmap <buffer> f <Plug>CiderFormat

TODO

  • Cider-nrepl

    • Test utilities
    • Code reloading
    • Inspecting, tracing, debugging?
  • Refactor-nrepl

    • Rename symbol

License

Copyright (C) 2015-2017 Juho Teperi

Distributed under the MIT License.

添加新评论