An open API service indexing awesome lists of open source software.

https://github.com/aartaka/emvi

Editing Lisp in vi (not Vim!)
https://github.com/aartaka/emvi

clojure common-lisp dotfiles emacs lisp scheme vi vim

Last synced: 19 days ago
JSON representation

Editing Lisp in vi (not Vim!)

Awesome Lists containing this project

README

        

#+TITLE:Emvi: trying to do Lisp in Vi (not Vim!)

POSIX/BSD vi is extremely primitive—no colors, no language modes, no plugins.
But still, using it is a nice exercise in minimalist text editing.
That's what I, as a Lisp programmer, am trying to do, preferably without going insane.
This .exrc config file is an attempt to reproduce the functionality of fancy Lisp-friendly systems.
Like Emacs and Paredit.
In vi.

* Getting started
Just copy/symlink the .exrc to your home directory and start vi.

#+begin_src sh
git clone https://github.com/aartaka/emvi
ln -s emvi/.exrc ~/.exrc
#+end_src

* Bindings
Here are the (Emacs-inspired) bindings I've added:
- C-x s :: Save changes.
- C-x b :: Edit the previous/alternate file.
- C-x q :: Exit.
- C-x Q :: Exit without saving changes.
- C-x e :: Edit a new file.
- C-x . :: Jump to a tag/source. Use =ctags=-compatible solution (likely [[https://github.com/universal-ctags/ctags][Universal Ctags]]) to generate a tags file for your Lisp codebase and use it to navigate around.
- C-x d :: Delete s-expression.
- C-x y, C-x p, C-x P :: Copy s-expression and paste it.
- C-x x :: Jump to matching paren/bracket/brace.
- C-x J, C-x K :: Jump to next/previous triple-semicolon section.
- C-a ( :: Add empty parentheses and insert right into them.
- C-a [ :: Same, but for square brackets.
- C-a { :: Same, but for curly braces.
- C-a " :: Same, but for double quotes.
- C-x ( :: Wrap the current symbol into parens (=paredit-wrap-round=).
- C-x [ :: =paredit-wrap-square=.
- C-x { :: =paredit-wrap-curly=.
- C-x " :: =paredit-meta-doublequote=, but without the internal quoting.
- C-x ) :: Slurping the next symbol into the current parenthesized form.
- C-x ] :: Same, but for square brackets.
- C-x } :: Same, but for curly braces.

* Thanks
- Thanks to Vasily Gerasimov for the name idea.
- Thanks to Arch Linux forums for giving me [[https://bugs.archlinux.org/task/73299.html][pointers on how to fix tag support]] in vi.