Created
October 16, 2012 11:30
-
-
Save mason-larobina/3898762 to your computer and use it in GitHub Desktop.
jj exit insert mode luakit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_binds("insert", { | |
lousy.bind.key({}, "j", function (w) | |
local now = luakit.time() | |
if now - (w.last_j_press or 0) < 1 then | |
-- Success! | |
w:set_mode() | |
return true | |
end | |
w.last_j_press = now | |
return false | |
end), | |
lousy.bind.any(function (w, o) | |
if #o.mods == 0 and o.key ~= "j" then | |
w.last_j_press = 0 | |
end | |
return false | |
end), | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment