Skip to content

SevereOverfl0w/vim-replant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

replant.vim: Regrowing again

replant (v.) 1570s, from re- "back, again" + plant (v.).

Plant (a tree or plant that has been dug up) again, especially when transferring it to a larger pot or new site.

Online Etymology Dictionary and Oxford Dictionary

This plugin is an attempt to extend the current Clojure/vim ecosystem. It works with fireplace to add and augment features. In the future it may replace fireplace, or also use other backends.

clojure-emacs have done amazing work to ensure CIDER is usable by other editors. I wish to have more features in vim, and I’m willing to accept coupling to more nrepl middleware for it. I’m a Neovim user, so would like to take advantage of new APIs to make developing vim plugins easier or with more features.

Important

Replant is in pre-pre-alpha stages. I am using it, working full-time on Clojure. But there may be bugs from time to time, which I will personally solve with a potentially uncommittable solution. That will leave you with you with a broken plant.

Contributing

All input is welcome! Feel free to open issues for questions & feature requests. I am available on Clojurians Slack in either #vim or as dominicm.

Install

Currently[1], this plugin depends on python-client, so install that first.

vim-plug
Plug 'SevereOverfl0w/vim-replant', { 'do': ':UpdateRemotePlugins' }
Plug 'tpope/vim-fireplace'

Then add the following projects as middleware to your project.

Features

  • ❏ Enhanced Docs

    • ❏ Colourful echo’d output on K

    • ❏ Open document with shortcuts to close, works with keywordprg

  • ✓ Refresh based on cider’s built-in refresh

  • ❏ Find symbol

    • ✓ Basic quickfix command

    • ❏ Keybinding

    • ❏ fzf integration

    • ❏ Denite integration

    • ❏ Async quickfix

  • ✓ Hotload dependencies

  • ✓ Auto-insertion of (ns) for new files.

  • ✓ List resources (classpath files which aren’t source code), and jump to their real location

  • ✓ Test runner

  • ✓ Realtime apropos

    • ✓ for fzf

    • ❏ for Denite

Refresh

<localleader>rf will perform a tools.namespace refresh, and <localleader>ra will perform a tools.namespace refresh-all. It searches for your stop/start functions in various namespaces automatically. If your stop/start functions are unique, you may set g:replant_refresh_before_hook and g:replant_refresh_after_hook to a symbol referring to your start/stop functions. Let me know if you have a common stop/start function or namespace which my detection missed.

Find symbol

The command :ReplantFindSymbol will find references to the symbol under the cursor. They quickfix window will open automatically after this, if there are any matches found.

Dependency hotloading

:ReplantHotloadDependency aero 1.1.2 will hotload a named dependency into the current JVM.

<range>:ReplantHotloadDependency will hotload a dependency in leiningen coordinate style into the current JVM. Intended for use with vim-sexp like vaf:ReplantHotloadDependency when on the coordinate.

List resources

You can list resources with :ReplantListResources. This will open a quickfix buffer with the real location set, and the relative classpath location as the description. Resources, as defined by cider-nrepl, are all files on the classpath excluding source files & META-INF.

Test Runner

You can run project tests with :ReplantTestProject, which takes these arguments:

+selector

Include tests with the metadata "selector" on them.

-selector

Exclude tests with the metadata "selector" on them.

-load

Automatically load project namespaces if they are unloaded (default)

-no-load

Do not automatically load project namespaces

Inclusions & exclusions work exactly as cognitect-labs/test-runner inclusions & exclusions. They are repeatable a number of times like so: :ReplantTestProject +integration +unit -member -regression.

You can conveniently run tests with <localleader>rtp too.

It is also possible to rerun only previously failed tests using ReplantRetestProject, which takes no arguments:

Sometimes tests throw an exception, you can use the full power of the tagged stacktrace explorer with tests. A command will be conveniently provided to you in the form :ReplantTestStacktrace ns var nr. You must switch to a clojure buffer to run this. It will fetch the stacktrace information, and load it into the quickfix window.

:ReplantApropos can be used to load up fzf with all vars. The standard, Ctrl+X, Ctrl+V, and Ctrl+T work in the fzf buffer. In addition, Ctrl+I will bring up a buffer containing doc information about the symbol.

Note
Special symbols, recognizable by their lack of namespace, do not have a source to jump to.
Warning
The doc information is not well tested, and is highly subject to change.

Developing

I use urn to generate lua files from lisp. This is fun. Don’t doubt me.

Generate lua files for release
$ make URNPATH=/home/dominic/src/gitlab.com/urn/urn

1. One day I’d like to do this in lua or with a cross-platform Go binary, but not today

About

A bag of goodies for working with a Clojure REPL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published