tags:

views:

435

answers:

3

Hello. It is possible to emulate vim modes, macros and bindings in textmate?

+3  A: 

You can use ViMate.

http://www.macupdate.com/info.php/id/27072

This is the list of features already implemented in ViMate. Hope this helps.

Implemented

Movement
  • k - moveUp
  • j - moveDown
  • l - moveForward
  • h - moveBackward
  • w - moveWordForward
  • b - moveWordBackward
  • e - moveToEndOfWord
  • 0 - moveToBeginningOfLine
  • $ - moveToEndOfLine
  • #[movement] - move # number of times
Insert
  • a - insertForward (not repeatable)
  • i - insertBackward (not repeatable)
  • o - insertBelow (not repeatable)
  • O - insertAbove (not repeatable)
Cut
  • d - cutSelection
  • dd - cutLine (not repeatable)
  • dl,x - cutForward (not repeatable)
  • dh,X - cutBackward (not repeatable)
  • dw - cutWordForward (not repeatable)
  • db - cutWordBackward (not repeatable)
  • de - cutToEndOfWord (not repeatable)
  • d0 - cutToBeginningOfLine
  • D,d$ - cutToEndOfLine
Copy
  • y - copySelection
  • yy - copyLine (not repeatable)
  • yl - copyForward (not repeatable)
  • yh - copyBackward (not repeatable)
  • yw - copyWordForward (not repeatable)
  • yb - copyWordBackward (not repeatable)
  • ye - copyToEndOfWord (not repeatable)
  • y0 - copyToBeginningOfLine
  • y$ - copyToEndOfLine
Change
  • c - changeSelection
  • cc - changeLine (not repeatable)
  • cl - changeForward (not repeatable)
  • ch - changeBackward (not repeatable)
  • cw - changeWordForward (not repeatable)
  • cb - changeWordBackward (not repeatable)
  • ce - changeToEndOfWord (not repeatable)
  • c0 - changeToBeginningOfLine
  • c$ - changeToEndOfLine
Paste
  • P - pasteBefore (hacky near end of file)
  • p - pasteAfter (hacky near end of file)
Scroll
  • ctrl-e - scrollLineDown (not repeatable, doesn't keep caret in view)
  • ctrl-y - scrollLineUp (not repeatable, doesn't keep caret in view)
  • ctrl-f - scrollLineDown (not repeatable, doesn't keep caret in view)
  • ctrl-b - scrollLineUp (not repeatable, doesn't keep caret in view)
TK
+4  A: 

I used to love TextMate, but changed to Vim after finally giving it a chance. I'm somewhat amused that ViMate exists. However, in my experience, vi input modes are kinda hit-and-miss. (Example: viper mode in emacs. It's close, but not enough to make me start to use emacs. Also, the system-wide keybindings for OS X.) I'll be interested to see how it turns out.

If what you're looking for is a "Mac integrated Vim" through TextMate, you might try MacVim too. It's the real Vim, but it has Mac keybindings and looks prettier. :) (It's like gvim, but written in Cocoa, I believe.)

Benjamin Oakes
Thanks! It is what i wanted
SMiX
np :)If you want Terminal.app to be prettier, you might also look at TerminalColors. See also: http://blog.infinitered.com/entries/show/8
Benjamin Oakes
A: 

@TK Here's the complete list of ViMate commands from Starving Cyclist:

Movement:
k - moveUp
j - moveDown
l - moveForward
h - moveBackward
w - moveWordForward
b - moveWordBackward
e - moveToEndOfWord
0 - moveToBeginningOfLine
$ - moveToEndOfLine
#[movement] - move # number of times
Insert:
a - insertForward (not repeatable)
i - insertBackward (not repeatable)
o - insertBelow (not repeatable)
O - insertAbove (not repeatable)
Cut:
d - cutSelection
dd - cutLine (not repeatable)
dl,x - cutForward (not repeatable)
dh,X - cutBackward (not repeatable)
dw - cutWordForward (not repeatable)
db - cutWordBackward (not repeatable)
de - cutToEndOfWord (not repeatable)
d0 - cutToBeginningOfLine
D,d$ - cutToEndOfLine
Copy:
y - copySelection
yy - copyLine (not repeatable)
yl - copyForward (not repeatable)
yh - copyBackward (not repeatable)
yw - copyWordForward (not repeatable)
yb - copyWordBackward (not repeatable)
ye - copyToEndOfWord (not repeatable)
y0 - copyToBeginningOfLine
y$ - copyToEndOfLine
Change:
c - changeSelection
cc - changeLine (not repeatable)
cl - changeForward (not repeatable)
ch - changeBackward (not repeatable)
cw - changeWordForward (not repeatable)
cb - changeWordBackward (not repeatable)
ce - changeToEndOfWord (not repeatable)
c0 - changeToBeginningOfLine
c$ - changeToEndOfLine
Paste:
P - pasteBefore (hacky near end of file)
p - pasteAfter (hacky near end of file)
Scroll:
ctrl-e - scrollLineDown (not repeatable, doesn't keep caret in view)
ctrl-y - scrollLineUp (not repeatable, doesn't keep caret in view)
ctrl-f - scrollLineDown (not repeatable, doesn't keep caret in view)
ctrl-b - scrollLineUp (not repeatable, doesn't keep caret in view)
Visual Mode:
V - highlight line
v - visual mode
Repeat:
1,2,3... - repeat next command (buggy)
msutherl