Skip to content

Instantly share code, notes, and snippets.

@mason-larobina
Created October 16, 2012 11:30
Show Gist options
  • Save mason-larobina/3898762 to your computer and use it in GitHub Desktop.
Save mason-larobina/3898762 to your computer and use it in GitHub Desktop.
jj exit insert mode luakit
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