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!)
- Host: GitHub
- URL: https://github.com/aartaka/emvi
- Owner: aartaka
- License: bsd-2-clause
- Created: 2024-11-19T21:00:21.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2025-01-05T21:05:40.000Z (4 months ago)
- Last Synced: 2025-03-27T01:11:11.120Z (about 1 month ago)
- Topics: clojure, common-lisp, dotfiles, emacs, lisp, scheme, vi, vim
- Language: Vim Script
- Homepage:
- Size: 18.6 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
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.