Skip to content

Instantly share code, notes, and snippets.

@gim-
Last active November 24, 2024 08:36
Show Gist options
  • Save gim-/4266afd946081032f634df3bca420071 to your computer and use it in GitHub Desktop.
Save gim-/4266afd946081032f634df3bca420071 to your computer and use it in GitHub Desktop.
Nvim Disable Arrow Keys
local map = vim.keymap.set
-- Disable arrows in every mode
map("n", "<Up>", ":echoe 'Get off my lawn!'<CR>")
map("n", "<Down>", ":echoe 'Get off my lawn!'<CR>")
map("n", "<Left>", ":echoe 'Get off my lawn!'<CR>")
map("n", "<Right>", ":echoe 'Get off my lawn!'<CR>")
map("i", "<Up>", "<C-o>:echoe 'Get off my lawn!'<CR>")
map("i", "<Down>", "<C-o>:echoe 'Get off my lawn!'<CR>")
map("i", "<Left>", "<C-o>:echoe 'Get off my lawn!'<CR>")
map("i", "<Right>", "<C-o>:echoe 'Get off my lawn!'<CR>")
map("v", "<Up>", ":<C-u>echoe 'Get off my lawn!'<CR>")
map("v", "<Down>", ":<C-u>echoe 'Get off my lawn!'<CR>")
map("v", "<Left>", ":<C-u>echoe 'Get off my lawn!'<CR>")
map("v", "<Right>", ":<C-u>echoe 'Get off my lawn!'<CR>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment