Skip to content

Instantly share code, notes, and snippets.

@s1n7ax
Created February 1, 2023 05:49
Show Gist options
  • Save s1n7ax/5397a788e871621e60fc23cf566bc450 to your computer and use it in GitHub Desktop.
Save s1n7ax/5397a788e871621e60fc23cf566bc450 to your computer and use it in GitHub Desktop.
Colemakify the QWERTY keymaps in Neovim
local mode = { 'n', 'x', 'o' }
vim.keymap.set(mode, 'm', 'h', { desc = 'Left' })
vim.keymap.set(mode, 'M', 'H', { desc = 'Top line of window' })
vim.keymap.set(mode, 'h', 'i', { desc = 'Insert' })
vim.keymap.set(mode, 'H', 'I', { desc = 'Insert at line start' })
vim.keymap.set(mode, 'n', 'j', { desc = 'Down' })
vim.keymap.set(mode, 'N', 'J', { desc = 'Join below line' })
vim.keymap.set(mode, 'k', 'n', { desc = 'Find next' })
vim.keymap.set(mode, 'K', 'N', { desc = 'Find previous' })
vim.keymap.set(mode, 'e', 'k', { desc = 'Up' })
vim.keymap.set(mode, 'E', 'K', { desc = 'Keyword lookup' })
vim.keymap.set(mode, 'l', 'e', { desc = 'Next end of word' })
vim.keymap.set(mode, 'L', 'E', { desc = 'Last char before white space' })
vim.keymap.set(mode, 'i', 'l', { desc = 'Right' })
vim.keymap.set(mode, 'I', 'L', { desc = 'Last line of window' })
vim.keymap.set(mode, 'j', 'm', { desc = 'Create mark' })
vim.keymap.set(mode, 'J', 'M', { desc = 'Middle line of window' })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment