Skip to content

Instantly share code, notes, and snippets.

@nfbvieira
Created August 2, 2012 21:20
Show Gist options
  • Select an option

  • Save nfbvieira/3240747 to your computer and use it in GitHub Desktop.

Select an option

Save nfbvieira/3240747 to your computer and use it in GitHub Desktop.
Ctrl+Enter uri expansion
-- Expand ':open example' to ':open www.example.com' when Ctrl+Return is pressed
add_binds("command", {
key({"Control"}, "Return", function (w)
local tld = "com" -- The top level domain to be used on completion
local input_tokens = split(w.ibar.input.text, "%s+")
if input_tokens[1] == ":open" and #input_tokens == 2 then
w:enter_cmd(":open www." .. input_tokens[2] .. '.' .. tld)
end
w:activate()
end)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment