GitHub
Expand All | Collapse All

Vim emulation

Vim emulation: ESC to enter normal mode

Vim emulation: Ctrl-[ to enter normal mode

Vim emulation: Simultaneous jk to toggle normal-insert mode

Vim emulation: Simultaneous sd to toggle normal-insert mode

Vim emulation: Vim emulation core part

Sticky Example

sticky semicolon - shift modifier

Key bindings
semicolon set_variable: {"name"=>"sticky_semicolon", "value"=>1}
a shift-a, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
b shift-b, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
c shift-c, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
d shift-d, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
e shift-e, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
f shift-f, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
g shift-g, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
h shift-h, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
i shift-i, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
j shift-j, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
k shift-k, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
l shift-l, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
m shift-m, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
n shift-n, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
o shift-o, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
p shift-p, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
q shift-q, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
r shift-r, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
s shift-s, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
t shift-t, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
u shift-u, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
v shift-v, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
w shift-w, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
x shift-x, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
y shift-y, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
z shift-z, set_variable: {"name"=>"sticky_semicolon", "value"=>0}
vk_none, set_variable: {"name"=>"sticky_semicolon", "value"=>0}

Personal Settings

For HHKB ((Shift-)Esc to grave accent (tilde))

  • For HHKB (vendor id = 2131).
  • And only for terminal, vim, emacs.
  • As HHKB's ESC is place for ` (gravce accent (back quote)) and ~ (tilde) at other keyboards.
  • Better to bind Control-[ to ESC as in below setting.
Key bindings

iTerm2 command (Meta) keys

  • Command to Option (i.e. Meta key) for other than n, v, w.

ESC sends EISU ESC ESC when language is ja

  • For terminal, vim, emacs, browsers.
Key bindings
escape japanese_eisuu, escape, escape

Control-[ sends EISU ESC ESC when language is ja

  • For terminal, vim, emacs, browsers.
Key bindings
control-open_bracket japanese_eisuu, escape, escape

Copy and Paste, ctrl-z/x/c/v to cmd-z/x/c/v

  • For other than terminal, vim, emacs.
  • Copy and Paste with control key.
Key bindings
control-z command-z
control-x command-x
control-c command-c
control-v command-v

Next/Prev by ctrl-i/o, option-left/right arrow at Finder

  • For Finder.
Key bindings
control-i command-close_bracket
control-o command-open_bracket
option-right_arrow command-close_bracket
option-left_arrow command-open_bracket

Cmd-(Shift-)Tab to Cmd-Opt-Right(Left) (Select Next(Previous) Tab), 次(前)のタブを表示)

Key bindings
command-tab command-shift-close_bracket
command-shift-tab command-shift-open_bracket

Opt-(Shift-)Tab to Cmd-(Shift-)Tab (Select Next(Previous) App), 次(前)のアプリを表示)

Key bindings
option-tab command-tab
option-shift-tab command-shift-tab

Ctrl-N(P) to Cmd-Opt-Right(Left) (Select Next(Previous) Tab), 次(前)のタブを表示)

  • For Finder, Preview and Safari
  • If vim_emu is enabled, following commands are available, too:
  • d: tab close
  • u: tab restore (Safari Only)
  • t: tab open
Key bindings
control-n command-shift-close_bracket
control-p command-shift-open_bracket
d command-w
u command-z
t command-t

Microsoft Office (ctrl-h, font, superscript/subscript)

  • For Microsoft Office (Word, PowerPoint, Excel).
Key bindings
control-h delete_or_backspace
control-command-shift-s command-t, tab, s, y, m, b, o, l, return_or_enter
control-command-shift-h command-t, tab, h, e, l, v, e, t, i, c, a, return_or_enter
control-equal_sign command-t, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, spacebar, return_or_enter
control-hyphen command-t, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, spacebar, return_or_enter

Change cmd-ctrl-h/j/k/l to arrow keys

  • Vim like move.
Key bindings
control-command-h left_arrow
control-command-j down_arrow
control-command-k up_arrow
control-command-l right_arrow

Window Actions

  • Window actions with AppleScript.
  • Need [rcmdnk/AppleScript](https://github.com/rcmdnk/AppleScript) to be installed.
Key bindings
command-4 shell_command: osascript ~/Library/Scripts/close.scpt
control-4 shell_command: osascript ~/Library/Scripts/close.scpt
control-command-a shell_command: osascript ~/Library/Scripts/closeToDock.scpt
option-spacebar shell_command: osascript ~/Library/Scripts/focusMenu.scpt
option-period shell_command: osascript ~/Library/Scripts/moveForMon.scpt
command-shift-slash shell_command: osascript ~/Library/Scripts/moveForMonAll.scpt
control-shift-y shell_command: osascript ~/Library/Scripts/windowMoveLeft.scpt
control-shift-u shell_command: osascript ~/Library/Scripts/windowMoveDown.scpt
control-shift-i shell_command: osascript ~/Library/Scripts/windowMoveUp.scpt
control-shift-o shell_command: osascript ~/Library/Scripts/windowMoveRight.scpt
command-control-shift-y shell_command: osascript ~/Library/Scripts/winMoveScreenLeft.scpt
command-control-shift-u shell_command: osascript ~/Library/Scripts/winMoveScreenDown.scpt
command-control-shift-i shell_command: osascript ~/Library/Scripts/winMoveScreenUp.scpt
command-control-shift-o shell_command: osascript ~/Library/Scripts/winMoveScreenRight.scpt
command-control-return_or_enter shell_command: osascript ~/Library/Scripts/wsFull.scpt
command-shift-return_or_enter shell_command: osascript ~/Library/Scripts/wsFull.scpt
command-control-shift-return_or_enter shell_command: osascript ~/Library/Scripts/wsHalf.scpt
command-shift-h shell_command: osascript ~/Library/Scripts/wsHalfLeft.scpt
command-shift-j shell_command: osascript ~/Library/Scripts/wsHalfBottom.scpt
command-shift-k shell_command: osascript ~/Library/Scripts/wsHalfTop.scpt
command-shift-l shell_command: osascript ~/Library/Scripts/wsHalfRight.scpt
command-shift-y shell_command: osascript ~/Library/Scripts/windowResizeWidthMinus.scpt
command-shift-u shell_command: osascript ~/Library/Scripts/windowResizeHeightPlus.scpt
command-shift-i shell_command: osascript ~/Library/Scripts/windowResizeHeightMinus.scpt
command-shift-o shell_command: osascript ~/Library/Scripts/windowResizeWidthPlus.scpt

Mouse cursor move using Karabiner's functions

  • Mouse move using Karabiner's functions
Key bindings
control-shift-h
control-shift-j
control-shift-k
control-shift-l
control-shift-n button1
control-shift-m button3
control-shift-p button2

Control-[ to ESC

Key bindings
control-open_bracket escape

Control-j to Return

  • Other than browsers.
Key bindings
control-j return_or_enter

Control-h to Backspace

Key bindings
control-h delete_or_backspace

Others (Dock, Sleep, Delete, IME, Misison Control, Spotlight)

Key bindings
control-m control-f3
option-l control-shift-eject
command-d command-delete_or_backspace
control-delete_or_backspace command-delete_or_backspace
control-spacebar option-control-spacebar
command-spacebar option-control-spacebar
command-control-shift-h control-left_arrow
command-control-shift-l control-right_arrow
command-control-f command-spacebar