clj-refactor.nvim
clj-refactor.nvim copied to clipboard
A neovim clojure refactoring plugin
A neovim port of clj-refactor.el
Usage
All commands are mapped under the cr prefix and use a two letter mnemonic shortcut. E.g. crrs for Clojure Refactor Rename Symbol.The full list is below.
Installation
Pre-requisites
Vundle
Using Vundle, add this to your vundle .config/nvim/init.vim section:
Plugin 'snoe/clj-refactor.nvim'
Inside nvim
- run
:PluginInstall :UpdateRemotePluginsyou should seeremote/host: node host registered plugins ['clj-refactor.nvim']- close all nvims simultaneously
- refactor
Progress
Options
You can set g:clj_refactor_prune_ns_form and g:clj_refactor_prefix_rewriting to 0 to affect the corresponding middleware options. Both default to 1.
Passive abilities
- [x] Magic requires - experimental
autocmd FileType clojure inoremap <buffer> / /<ESC>:silent! CMagicRequires<CR>a - [ ] Automatic insertion of namespace declaration
Commands
- [x]
cradadd-declaration - [ ] add-import
- [ ] add-libspec
- [x]
cramadd-missing-libspec - [ ] add-project-dependency
- [ ] add-stubs
- [x]
crcnclean-ns - [x]
crfecreate-fn-from-example - [x]
crcccycle-coll - [x]
crcicycle-if - [x]
crcpcycle-privacy - [x]
crctcycle-thread - [ ] describe-refactor
- [ ] destructure-keys
- [x]
crelexpand-let * Doesn't yet replace other usages of bindings - [x]
credextract-def - [x]
crefextract-fn - [ ] find-usages
- [ ] hotload-dependency
- [ ] inline-symbol
- [x]
crilintroduce-let - [ ] move-form
- [x]
crmlmove-to-let - [ ] promote-fn-literal
- [ ] promote-fn
- [ ] remove-let
- [ ] remove-unused-requires
- [x]
crrfcrrdrename-file-or-dir - [x]
crrsrename-symbol-global * just rename symbol - [x]
crrsrename-symbol-local * just rename symbol - [ ] replace-use
- [ ] show-changelog
- [ ] sort-project-dependencies
- [ ] stop-referring
- [x]
crtfthread-first-all - [x]
crtlthread-last-all - [x]
crttthread-last - [x]
crththread - [x]
cruaunwind-all - [x]
cruwunwind-thread
Development / Testing
Run lein npm install
I generally have 4 terminals open:
$ rlwrap lein figwheel$ node target/out/tests.js$ lein cljsbuild auto plugin$ tail -f $NEOVIM_JS_DEBUG
Somewhere in your environment do export NEOVIM_JS_DEBUG=~/nvimdebug.log and neovim will dump messages from the plugin there. If something goes wrong it will likely show up in ~/.nvimlog