-
Notifications
You must be signed in to change notification settings - Fork 0
Vim Sexp Commands
Robin Lunn edited this page Nov 11, 2019
·
14 revisions
Where relevant, assume the cursor is always on the 'a' element. If not relevant then the cursor can be anywhere in the form being edited. I'm using tpope's mappings for regular people and those commands are included here.
| command | description | effect_ |
|---|---|---|
>) |
Slurp at end of form |
...c) d → ...c d)
|
<( |
Slurp at beginning of form |
a (b... → (a b
|
>( |
Barf at beginning of form |
(a b → a (b...
|
<) |
Barf at end of form |
(a b → a (b...
|
>f |
Move form one later in list |
(a b) (c d) → (c d) (a b)
|
<f |
Move form one earlier in list |
(c d) (a b) → (a b) (c d)
|
>e |
Move element one later in list |
(a b c) → (b a c)
|
<e |
Move element one earlier in list |
(b a c) → (a b c)
|
<I |
Insert at beginning of form | |
>I |
Insert at end of form | |
dsf |
Delete splice form (into its parent) |
(b [a] c) → (b a c)
|
<LocalLeader>w |
Wrap current element with round brackets and edit at beginning of form | ...a... → ...( a)... |
<LocalLeader>W |
Wrap current element with round brackets and edit at end of form | ...a... → ...(a )... |
<LocalLeader>e[ |
Wrap current element with square brackets and edit at beginning of form | ...a... → ...[ a]... |
<LocalLeader>e{ |
Wrap current element with curly brackets and edit at beginning of form | ...a... → ...{ a}... |
+ |
Move one form forward | |
- |
Move one form backward | |
( |
Move backward to the first ( | |
) |
Move forward to the first ) | |
[[ |
Move to the start of the top level form | |
]] |
Move to the end of the top level form | |
=- |
Reformat the top level form |
| in command range | range definition |
|---|---|
| _af or _if | a form or inside form |
| _aF or _iF | a top level form or inside a top level form |
| _as or _is | a string or inside a string |
| _ae or _ie | an element or inside an element |
Those with with d, y, c and probably others. As in daf will Delete A Form. Amazeballs.