vim-sexp mappings for regular people
I'm really liking my first impressions of vim-sexp. It's like paredit minus a couple of parts of paredit that are impossibly tricky to implement in Vim. I'm not too keen on some of the default mappings, though, and in particular the mappings using the meta key are just an absolute deal breaker for me and everyone else that uses Vim in a terminal. So I made and published my own, in an attempt to define a more accessible standard.
You know the drill. Here's a copy and paste to install the works with pathogen.vim.
cd ~/.vim/bundle git clone git://github.com/tpope/vim-sexp-mappings-for-regular-people.git git clone git://github.com/guns/vim-sexp.git git clone git://github.com/tpope/vim-repeat.git git clone git://github.com/tpope/vim-surround.git
These mappings supplement rather than replace the existing mappings (despite vim-sexp's best efforts to thwart this), so if you have muscle memory, fear not.
Vim-sexp uses meta mappings to move element-wise. I've taken over the WORD
gE--instead, operating under the theory that those
aren't nearly as useful in a language where so many punctuation marks are
identifier characters. This might be a terrible idea.
List manipulation mappings
More meta madness in the defaults here. I've taken
<f to move a
<e to move an element.
Slurpage and barfage are handled by
<(, where the
angle bracket indicates the direction, and the parenthesis indicates which end
to operate on.
>I to insert at the beginning and ending of a form.
Mappings inspired by surround.vim
Note that surround.vim out of the box works great with the sexp.vim motions
and text objects. Use
ysaf), for example, to surround the current form with
parentheses. To this, we add a few more mappings:
dsf: splice (delete surroundings of form)
cseb: surround element in parentheses
cse]: surround element in brackets
cse}: surround element in braces
Copyright © Tim Pope. Distributed under the same terms as Vim itself.