Giter Site home page Giter Site logo

mongey / vim-replant Goto Github PK

View Code? Open in Web Editor NEW

This project forked from severeoverfl0w/vim-replant

0.0 3.0 0.0 97 KB

A bag of goodies for working with a Clojure REPL

Makefile 0.22% Vim Script 28.78% Clojure 0.87% Lua 35.62% Python 19.48% Common Lisp 15.00% NewLisp 0.02%

vim-replant's Introduction

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-fireplace 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

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:

-load

Automatically load project namespaces if they are unloaded (default)

-no-load

Do not automatically load project namespaces

-selector=selector

Filter to tests with the metadata "selector" on them.

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

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.

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

vim-replant's People

Contributors

markwoodhall avatar mongey avatar severeoverfl0w avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.