Skip to content

Instantly share code, notes, and snippets.

@shurizzle
Created August 26, 2023 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shurizzle/0d0b66183327c6140ab10a9605089656 to your computer and use it in GitHub Desktop.
Save shurizzle/0d0b66183327c6140ab10a9605089656 to your computer and use it in GitHub Desktop.
Just learn vim
for _, key in ipairs({ "Left", "Right", "Up", "Down", "PageUp", "PageDown", "End", "Home", "Del" }) do
local name = key == "Del" and "Delete" or key
for mode, prefix in pairs({ n = "<cmd>", v = "<cmd><C-u>", i = "<C-o><cmd>" }) do
vim.keymap.set(
mode,
("<" .. key .. ">"),
(prefix .. 'echo "No ' .. name .. ' for you!<CR>"'),
{ silent = true, noremap = false }
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment