Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

My Neovim Key Mappings

~/.config/nvim/after/plugin/config-keymappings.lua

-- Setup so the Neovim layer on the moonlander
-- j and k jump paragraphs up and down in the
-- same way regular layer j and k move lines

vim.keymap.set('n', '(', "}", {})
vim.keymap.set('o', '(', "}", {})
vim.keymap.set('v', '(', "}", {})
vim.keymap.set('n', '=', "{", {})
vim.keymap.set('o', '=', "{", {})
vim.keymap.set('v', '=', "{", {})

-- Grimoire File Export
vim.keymap.set({'n', 'i' }, '<M-S-x>', function() 
  require('grimoire_invocations.calls').export_to_file()
end)

-- Run Code Blocks
vim.keymap.set({ 'n', 'i' }, '<M-S-r>', function() 
  Execute_code_block()
end)

-- This was in my config, but I'm not sure what
-- it was for, leaving it here commented out until
-- I figure out what it does/did
-- vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })

-- Make a new tab (not using since moving to bufferline)
-- vim.keymap.set('n', '<M-S-y>', ":tabe<cr>", { desc = 'New Tab Page' })
-- vim.keymap.set('i', '<M-S-y>', "<ESC>:tabe<cr>", { desc = 'New Tab Page' })
-- vim.keymap.set('n', '<M-S-n>', ":tabe<cr>", { desc = 'New Tab Page' })
-- vim.keymap.set('i', '<M-S-n>', "<ESC>:tabe<cr>", { desc = 'New Tab Page' })
-- vim.keymap.set('n', '<M-S-F6>', ":tabe<cr>", { desc = 'New Tab Page' })
-- vim.keymap.set('i', '<M-S-F6>', "<ESC>:tabe<cr>", { desc = 'New Tab Page' })

-- Previous/Next Tab (not using this after switching to nvim-tree
-- and bufferline which makes using buffers like using tabs
-- vim.keymap.set('n', '<M-S-u>', "gT<cr>", { desc = 'Previous tab' })
-- vim.keymap.set('i', '<M-S-u>', "<ESC>gT<cr>", { desc = 'Previous tab' })
-- vim.keymap.set('n', '<M-S-m>', "gT<cr>", { desc = 'Previous tab' })
-- vim.keymap.set('i', '<M-S-m>', "<ESC>gT<cr>", { desc = 'Previous tab' })
-- vim.keymap.set('n', '<M-S-i>', "gt<cr>", { desc = 'Previous tab' })
-- vim.keymap.set('i', '<M-S-i>', "<ESC>gt<cr>", { desc = 'Previous tab' })


-- Ignore space in normal and visual mode
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })


-- Remap for dealing with word wrap
-- This is from kickstart.nvim. I'm not sure yet
-- what it does
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })

-- Grimiore Hotkeys 
-- TODO: See about switching these to function calls
vim.keymap.set('n', '<M-S-g>', ":Telescope grimoire<cr>", { desc = 'Grimoire' })
vim.keymap.set('i', '<M-S-g>', "<ESC>:Telescope grimoire<cr>", { desc = 'Grimoire' })

-- Telescope Help
vim.keymap.set({'n', 'i'}, '<M-S-t>', function()
  require('telescope.builtin').help_tags({ initial_mode = 'insert' })
end, { desc = 'Search Help' })

-- Telescope Recent Files
-- vim.keymap.set({'n', 'i'}, '<M-S-d>', function()
--  require('telescope.builtin').oldfiles({ initial_mode = 'insert' })
-- end, { desc = 'Telescope: Recent files' })

-- Telescope File Search
-- vim.keymap.set({'n', 'i'}, '<M-F>', function()
--   require('telescope.builtin').find_files({ initial_mode = 'insert' })
-- end, { desc = 'File search' })

-- Diagnostic keymaps
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
-- vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
-- vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })

Currently Off

These are some keymaps that came with Telescope, etc... that I've turned off for now becuase it was too much at the start. I want to play with them again though so I'm keeping them around

Code

-- Telescope Currently Open Files
-- (I haven't been using this so it's off, but
-- I want to keep it around for when I need it)

-- vim.keymap.set('n', '<M-S-f>', function()
--   require('telescope.builtin').buffers({ initial_mode = 'normal' })
-- end, { desc = 'Telescope: Current buffers' })
-- 
-- vim.keymap.set('i', '<M-S-f>', function()
--   require('telescope.builtin').buffers({ initial_mode = 'normal' })
-- end, { desc = 'Telescope: Current buffers' })


-- Telescope Search Current Buffer
-- Currently off, but I want to look more into how
-- this works

-- vim.keymap.set('n', '<A-m>', function()
--   require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
--     winblend = 10,
--     previewer = false,
--   })
-- end, { desc = 'Fuzzily search in current buffer' })

-- Telescope Live Grep
-- Not currently in use

--vim.keymap.set('n', '<M-S-e>', function()
--  require('telescope.builtin').live_grep()
-- end, { desc = 'Grep search' })
--
-- vim.keymap.set('i', '<M-S-e>', function()
--  require('telescope.builtin').live_grep()
-- end, { desc = 'Grep search' })

-- Stuff to look at
-- vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
-- vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })

References

  • My personal book of spells and incantations for getting computers to do things. Some folks wold call it a developers noteboook or a notes app. I find it more magical than that

  • There's like 200 variations of this as I've tweaked it over time. One of these days I'm going to make an animation out of that. What you see is up to date though since this is the site that generates the firmware

  • Some of the best money I've spent is on this keyboard. They key features are: 1. it's a split keyboard, 2. it has an ortholinear key layout (i.e. they are in straight lines), and 3. Key mapping.

    The first two are for ergonomics that help prevent RSI. The last is kinda the same as it lets me make common things that would otherwise require a weird move to be mapped to a basic keypress