--- a/.hgsub Mon Aug 08 13:52:19 2011 -0400
+++ b/.hgsub Mon Aug 08 14:45:29 2011 -0400
@@ -1,4 +1,5 @@
mercurial/templates = ../mercurial-cli-templates
+
vim/bundle/ack = [git]git://github.com/mileszs/ack.vim.git
vim/bundle/gundo = [hg]http://bitbucket.org/sjl/gundo.vim/
vim/bundle/html5 = [git]git://github.com/othree/html5.vim.git
@@ -18,3 +19,5 @@
vim/bundle/threesome = [hg]http://bitbucket.org/sjl/threesome.vim
vim/bundle/vim-makegreen = [git]git://github.com/sjl/vim-makegreen.git
vim/bundle/vim-arpeggio = [git]git://github.com/kana/vim-arpeggio.git
+
+keymando/Plugins/vim = [hg]http://bitbucket.org/sjl/keymando-vim/
--- a/.hgsubstate Mon Aug 08 13:52:19 2011 -0400
+++ b/.hgsubstate Mon Aug 08 14:45:29 2011 -0400
@@ -1,3 +1,4 @@
+d9b936c1bda1414ae96c9d4a0093a816306794eb keymando/Plugins/vim
b9bd86b9f476afd164237dce029a46d2607bd931 mercurial/templates
a41d5d52c39a31128e969e69acf800b198cb07f9 vim/bundle/ack
bfdf714f8ea10a6bcba7a1375a5700b11077dcd9 vim/bundle/command-t
--- a/keymando/keymandorc.rb Mon Aug 08 13:52:19 2011 -0400
+++ b/keymando/keymandorc.rb Mon Aug 08 14:45:29 2011 -0400
@@ -27,119 +27,3 @@
map "<Ctrl-,>" do
input()
end
-
-# Vim ------------------------------------------------------------------------------
-class Vim < Plugin
- @oldmode = 'n'
- @mode = 'n'
- @maps = {}
-
- class << self; attr_accessor :mode, :maps, :oldmode; end
-
- def before
- end
-
- def fire(key)
- fn = Vim.maps[Vim.mode][key]
- if fn
- fn.call()
- else
- send(key)
- end
- end
-
- def tomode(m)
- oldmap = Vim.maps[Vim.mode]
- newmap = Vim.maps[m]
-
- oldmap.keys.each do |k|
- #unmap k
- end
-
- newmap.keys.each do |k|
- #map(k, lambda { self.fire(k) })
- end
- end
-
- def toggle()
- if Vim.mode == 'disabled'
- Vim.mode = Vim.oldmode
- system '/usr/local/bin/growlnotify -m "" -a Keymando Vim mode enabled.'
- else
- Vim.oldmode = Vim.mode
- Vim.mode = 'disabled'
- system '/usr/local/bin/growlnotify -m "" -a Keymando Vim mode disabled.'
- end
- end
-
- def after
- except /iTerm/, /MacVim/, /Firefox/, /PeepOpen/, /Quicksilver/, /1Password/ do
- Vim.maps['disabled'] = {}
- Vim.maps['n'] = {
- 'h' => lambda { send("<Left>") },
- 'j' => lambda { send("<Down>") },
- 'k' => lambda { send("<Up>") },
- 'l' => lambda { send("<Right>") },
-
- 'w' => lambda { send("<Alt-Right><Alt-Right><Alt-Left>") },
- 'b' => lambda { send("<Alt-Left>") },
- 'e' => lambda { send("<Alt-Right>") },
- '0' => lambda { send("<Cmd-Left>") },
-
- 'i' => lambda { Vim.mode = 'i' },
- 'a' => lambda { Vim.mode = 'i'; send("<Right>") },
- 'A' => lambda { Vim.mode = 'i'; send("<Ctrl-e>") },
- 'I' => lambda { Vim.mode = 'i'; send("<Ctrl-a>") },
- 'o' => lambda { Vim.mode = 'i'; send("<Cmd-Right><Return>") },
- 'O' => lambda { Vim.mode = 'i'; send("<Cmd-Left><Return><Up>") },
-
- 'd' => lambda { Vim.mode = 'od' },
- 'c' => lambda { Vim.mode = 'oc' },
-
- 'p' => lambda { send("<Cmd-Left><Down><Cmd-v>") },
- 'P' => lambda { send("<Cmd-Left><Cmd-v>") },
-
- 'u' => lambda { send("<Cmd-z>") },
- '<Ctrl-R>' => lambda { send("<Shift-Cmd-z>") },
-
- 'x' => lambda { send("<Shift-Right><Cmd-x>") },
- 's' => lambda { send("<Shift-Right><Cmd-x>"); Vim.mode = 'i' },
-
- '<Escape>' => lambda { send("<Escape>") },
- }
- Vim.maps['i'] = {
- '<Ctrl-[>' => lambda { Vim.mode = 'n' },
- '<Escape>' => lambda { Vim.mode = 'n' },
- }
- Vim.maps['od'] = {
- 'w' => lambda { send("<Shift-Alt-Right><Cmd-x>"); Vim.mode = 'n' },
- 'b' => lambda { send("<Shift-Alt-Left><Cmd-x>"); Vim.mode = 'n' },
- 'd' => lambda { send("<Cmd-Left><Shift-Down><Cmd-x>"); Vim.mode = 'n' },
-
- #'iw' => lambda { send("<Alt-Right><Shift-Alt-Left><Delete>"); Vim.mode = 'n' },
-
- '<Escape>' => lambda { Vim.mode = 'n' },
- }
- Vim.maps['oc'] = {
- 'w' => lambda { send("<Shift-Alt-Right><Cmd-x>"); Vim.mode = 'i' },
- 'b' => lambda { send("<Shift-Alt-Left><Cmd-x>"); Vim.mode = 'i' },
- 'c' => lambda { send("<Cmd-Left><Shift-Down><Cmd-x><Return><Up>"); Vim.mode = 'i' },
-
- #'iw' => lambda { send("<Alt-Right><Shift-Alt-Left><Delete>"); Vim.mode = 'i' },
-
- '<Escape>' => lambda { Vim.mode = 'n' },
- }
-
- keys = Vim.maps.values.reduce([]) do |l, m|
- l = l + m.keys
- end
- keys.uniq.each do |k|
- map(k, lambda { self.fire(k) })
- end
- end
-
- map "<Alt-Escape>", lambda { self.toggle }
- end
-end
-
-