For Clojure specifically, the Rainbow Parens addon for vim is fantastic. Also I've found using GNU screen to split a terminal with one half vim and the other half a REPL to be Good Enough for a lot of purposes.
I was also going to mention a few other useful Lispy things you can do with vim (like d% to delete an expression), but this page covers them pretty well: http://cybertiggyr.com/15-vim/
Yeah, it is unfortunate how terribly documented they are. Not sure what you mean by difficult to distribute though. You either load the file from VimL or you embed the code in VimL. You distribute it like any Vim plugin.
The documentation for the interfaces serves as decent reference material. What is really lacking is a long tutorial on the subject that is in an easy to find place.
Sublime Text 2 has both a Python API and a plugin that makes it act sort of like VIM. Frankly, the plugin is pretty bad if you're used to VIM, but there's active development on it (it's open source [1]), and it's apparently good enough for many people. If you want to try this out, there's also a plugin that gives you an Ex-Mode [2], which I gather is something VIM users might want (I'm frankly not sure what it is.)
Ex-Mode let's you do all sorts of extremely useful things like running sed in-place on the current file, or only on the current selection text in the file, or do something like sed but interactive that will do a regex search-and-replace on the current file/selection but at each match give you the option of skipping that one. Ex-Mode also lets you do a lot of things unrelated to sed, including running an arbitrary shell command and inserting the stdout into the file at the cursor, but all the sed-like commands are what blew me away.
Sublime Text 2 has "vintage mode" which gives you a vi-compatible modal editing interface. Much of ST2 is scriptable with Python, and it runs on all major platforms. I've been a vim fan for many years, and ST2 has recently won me over.
You will love evil, the latest, greatest, and most complete Vim emulation layer for Emacs. If you have heard of Vim-mode, viper, or vimpulse, this is the successor to all of them.
Yeah, I've tried it. I think it's unfortunate that they try to emulate Vim so closely. I love modal editing, but there are features of Vim (like VimL and the hacky combination of VimL and ex mode) that deserve to be re-thought, rather than re-implemented.
I like Vim but using Clojure forces you to deal with Java at some point - and having auto complete is crucial to me. VimClojure isn't really good in advanced functionality, eg. autocomplete is clunky and runing things in REPL can block VIM if your REPL command blocks. I couldn't even get emacs to work with Clojure and I don't like the CTR+* interface so I didn't spend much time on it. In the end IntellJ + La Clojure + Lein plugin + IdeaVim works perfect, you have a good REPL, autocomplete and debugging.
https://github.com/ervandew/supertab seems nice for completing based on the current context. I seem to recall VimClojure having some kind of completion, but don't hold me to that.
Also, like I said in the blog post, there is nothing wrong with your setup if you are productive and happy with it.
This story parallels my own on a nearly-disturbing number of levels. Exactly the same experience. I never thought I'd switch from emacs, then I finally gave vim a good shot (switched for two weeks and made a very conscious effort to use it effectively), and was blown away by how much faster I could edit text.
I did. In fact, I used viper mode (vimpulse) for about three weeks before deciding it was worth a shot to just try vim proper. I haven't really looked back. Viper was alright, but there were far too many moving parts in that setup.
I think I see what he means. Viper is really... strange.
When I originally moved from Vim to Emacs, I found Viper /harder/ than just learning regular ol' Emacs. I assume "Moving parts" refers to exactly the same problems that I had. I could explain more, but it would take time, because I need to figure out some examples instead of explaining my vague impressions of a few years ago.
Point is, as an avid emacs user, I totally get where he is coming from.
I'm a MacVim guy. When working on a project, I exclusively use FuzzyFinder_TextMate and the :edit command. Occasionally I still use cmd+o (primarily when I want to do a one-off file edit and know where the file is "visually" relative to my DropBox folder or something)
Anyway: Here's a Mac tip!
In the native file chooser dialog, simply type ~ or / and the "Go to folder" sub-dialog will slide down and you can type a path! It even has (very primitive) tab completion.
Also, ST2 has a command line tool `subl` for opening files and projects. If you're on OS X, you can find this in `/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/`. All you need to do is symlink it to `~/bin/subl` and you're good to go.
I would move from EMACS to Vim quite easily (I was a Vim user before I started learning Clojure) and I mirror the authors thoughts about just using SLIME as an in-editor REPL.
The problem for me is the fact that the SLIME REPL offers pretty decent tab-completion
Whereas lein-repl doesn't.
That's the only thing that's sort of keeping me on the EMACS side of the fence
In Leiningen 2, `lein repl` will be https://github.com/trptcolin/reply which has tab completion. May not be perfect yet (I haven't tried it personally) but I expect it to improve.
28 comments
[ 3.9 ms ] story [ 74.5 ms ] threadI was also going to mention a few other useful Lispy things you can do with vim (like d% to delete an expression), but this page covers them pretty well: http://cybertiggyr.com/15-vim/
I'm not satisfied with:
* tcl/ruby/python interfaces to Vim, because they're horrifically documented, and plugins using these are difficult to distribute
* Re-implementations of a subset of Vim's mountain of hacks in a different language (see jsvim, et al)
The documentation for the interfaces serves as decent reference material. What is really lacking is a long tutorial on the subject that is in an easy to find place.
My favorite example is Command-T. In order to link VimL to C, he had to write a Ruby extension and use the Ruby interface. Which is a total pain.
[1]: https://github.com/sublimehq/Vintage
[2]: https://github.com/SublimeText/VintageEx
Also, like I said in the blog post, there is nothing wrong with your setup if you are productive and happy with it.
VimClojure has completion, but it works only when nailgun server is running. Same goes for repl, evaluation and documentation lookup.
I could never leave Emacs at this point, though. Elisp is just too great.
When I originally moved from Vim to Emacs, I found Viper /harder/ than just learning regular ol' Emacs. I assume "Moving parts" refers to exactly the same problems that I had. I could explain more, but it would take time, because I need to figure out some examples instead of explaining my vague impressions of a few years ago.
Point is, as an avid emacs user, I totally get where he is coming from.
I'm a MacVim guy. When working on a project, I exclusively use FuzzyFinder_TextMate and the :edit command. Occasionally I still use cmd+o (primarily when I want to do a one-off file edit and know where the file is "visually" relative to my DropBox folder or something)
Anyway: Here's a Mac tip!
In the native file chooser dialog, simply type ~ or / and the "Go to folder" sub-dialog will slide down and you can type a path! It even has (very primitive) tab completion.
More information: http://www.sublimetext.com/docs/2/osx_command_line.html
The problem for me is the fact that the SLIME REPL offers pretty decent tab-completion
Whereas lein-repl doesn't.
That's the only thing that's sort of keeping me on the EMACS side of the fence