Browse / download code here.
I guess I should mention that I use Edi Weitz's Lispworks Add-Ons package. I suppose that might make a difference.
Most items have slightly different semantics than in Vim. Just as an example, many movement commands that are supposed to leave the cursor at the first non-blank character on the line, don't. Items marked with a leading (*) have significantly different semantics than in Vim.
Items marked with a (+) are not in Vim. (Obviously this is not to say that Vim can't do them, just that the mapping doesn't exist.)
Some of these mappings are just my own favorites (like C-F12 to save all files), but they're in there, so I should document them.
Changing modes:
- Enter vi mode:
Shift-Ctrl-Esc,c-,,c-,(ctrl-comma twice). All other commands assume you're in vi mode - Exit vi mode:
Shift-Ctrl-Esc - Return to command mode (i.e from insert mode):
C-[
Movement:
- Previous line:
k Up C-p -(minus) - Previous screen line:
gk - Next line:
j Down C-j Return C-n - Next screen line:
gj - Backward character:
h Left C-h Backspace - Forward character:
l(lower-case-L)Right Space - Backward word/WORD:
b C-Left,B - Forward word/WORD:
w C-Right,W - Backward to end of word:
ge - Forward to end of word:
e - Goto line or end of file:
G - Goto line or top of file:
gg - Top/Bottom/Middle of window:
H/L/M - Backward/forward one Lisp form:
(/) - Backward/forward one list:
C-(/C-) - Goto beginning of line:
Home 0(zero) - Goto end of line:
$ End - Move to first non-blank on line:
^ - Move to beginning of defun:
[\ - Move to end of defun:
]\
Scrolling:
- Page down:
C-f - Page up:
C-b - Scroll window down by one line:
C-y S-Up - Scroll window up by one line:
C-e S-Down - Move current line to top/middle/bottom of window:
zt/zz/zborz<CR>/z./z-
Repeating:
- Repeat last change:
.(dot/period/full stop) - Repeat count:
<digits>, e.g. 12j will move down 12 lines
Making changes:
- start insert:
i - exit insert, back to command mode:
Ctrl-[(this is not the same as the Esc key!) - Delete next/previous character:
x/X - Start append at end of line:
A - Start insert at beginning of line:
I - (*)Delete motion:
d{motion}(incomplete/buggy) - Delete line:
dd(maybe should have a (*) in front) - (*)Delete to end of line:
D - (*)Put recent deletiong:
p - Open line up/down:
O/o - Lowercase word:
~w - Lowercase/uppercase region:
vu/vU - shift line right:
>> - (*)Join with previous line:
J(different than Vim's J key, which joins with next line) - Replace characters:
r<char>
Buffers/windows:
- New buffer:
:n - New window:
C-w,n(that's C-w, then n) - Previous/next window:
C-w,k/C-w,j - Close window:
C-w,c - (*)List buffers:
:ls,ReturnF7 - (*)Select buffer:
:b,Space - (*)Next buffer:
:bn,ReturnC-F10
Searching:
- (*)search forward:
/ - (*)search backward:
? - List matching lines (sort of like :g/re/p in Vim):
:gp - Delete matching lines (like :g/re/d in Vim):
:gd
Read/write files:
- Save file:
:w,Return - Save all files:
:wa,ReturnC-F12 - Save all files and exit:
:wqa,Return - (*)Write file (to different filename):
:w,Space - (*)Edit new file: :e,Space
- Reload file from disk:
:e! - Read file into buffer:
:r,Space
Tagging/finding source:
- (*)Find source:
C-] - (*)Find next tag:
:tn,Return - (*)View tag list:
:ts,Return
Evaluate Lisp code:
- (+)Evalute current defun:
,x