Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Textmate and vim modes

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

like image 978
Andrey Kuznetsov Avatar asked Dec 08 '09 14:12

Andrey Kuznetsov


4 Answers

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.)

like image 82
Benjamin Oakes Avatar answered Nov 13 '22 18:11

Benjamin Oakes


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)
like image 37
TK. Avatar answered Nov 13 '22 19:11

TK.


@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)
like image 42
terrace Avatar answered Nov 13 '22 18:11

terrace


Try VicoApp. It's similar to textmate and has support many Vim key-bindings.

like image 1
Resure Avatar answered Nov 13 '22 20:11

Resure