# HG changeset patch # User Steve Losh # Date 1312829129 14400 # Node ID 5929fc2bb6e39f90b9948eb797690623ffa90b54 # Parent bd2e5609525649712fc5849421ec298f2c80a021 Update subrepository state. diff -r bd2e56095256 -r 5929fc2bb6e3 .hgsub --- 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/ diff -r bd2e56095256 -r 5929fc2bb6e3 .hgsubstate --- 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 diff -r bd2e56095256 -r 5929fc2bb6e3 keymando/keymandorc.rb --- 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 "" 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("") }, - 'j' => lambda { send("") }, - 'k' => lambda { send("") }, - 'l' => lambda { send("") }, - - 'w' => lambda { send("") }, - 'b' => lambda { send("") }, - 'e' => lambda { send("") }, - '0' => lambda { send("") }, - - 'i' => lambda { Vim.mode = 'i' }, - 'a' => lambda { Vim.mode = 'i'; send("") }, - 'A' => lambda { Vim.mode = 'i'; send("") }, - 'I' => lambda { Vim.mode = 'i'; send("") }, - 'o' => lambda { Vim.mode = 'i'; send("") }, - 'O' => lambda { Vim.mode = 'i'; send("") }, - - 'd' => lambda { Vim.mode = 'od' }, - 'c' => lambda { Vim.mode = 'oc' }, - - 'p' => lambda { send("") }, - 'P' => lambda { send("") }, - - 'u' => lambda { send("") }, - '' => lambda { send("") }, - - 'x' => lambda { send("") }, - 's' => lambda { send(""); Vim.mode = 'i' }, - - '' => lambda { send("") }, - } - Vim.maps['i'] = { - '' => lambda { Vim.mode = 'n' }, - '' => lambda { Vim.mode = 'n' }, - } - Vim.maps['od'] = { - 'w' => lambda { send(""); Vim.mode = 'n' }, - 'b' => lambda { send(""); Vim.mode = 'n' }, - 'd' => lambda { send(""); Vim.mode = 'n' }, - - #'iw' => lambda { send(""); Vim.mode = 'n' }, - - '' => lambda { Vim.mode = 'n' }, - } - Vim.maps['oc'] = { - 'w' => lambda { send(""); Vim.mode = 'i' }, - 'b' => lambda { send(""); Vim.mode = 'i' }, - 'c' => lambda { send(""); Vim.mode = 'i' }, - - #'iw' => lambda { send(""); Vim.mode = 'i' }, - - '' => 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 "", lambda { self.toggle } - end -end - -