mirror of
https://github.com/mitchell/dotfiles.git
synced 2025-12-17 12:27:22 +00:00
Breakup Neovim config into Lua modules
This commit is contained in:
parent
3179a5b48d
commit
1517f56c86
11 changed files with 662 additions and 584 deletions
22
.config/nvim/lua/core/keymaps.lua
Normal file
22
.config/nvim/lua/core/keymaps.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
-- lua/core/keymaps.lua
|
||||
|
||||
local map = vim.keymap.set
|
||||
local map_opts_silent = { noremap = true, silent = true }
|
||||
|
||||
-- General Mappings
|
||||
map("i", "jj", "<Esc>", { noremap = true, silent = true, desc = "Escape Insert Mode" })
|
||||
map("t", "<Esc>", "<C-\\><C-n>", { noremap = true, silent = true, desc = "Escape Terminal Mode" })
|
||||
map("v", "//", function()
|
||||
vim.cmd("normal! y")
|
||||
local sel = vim.fn.getreg('"')
|
||||
local pattern = vim.fn.escape(sel, "/\\")
|
||||
vim.fn.setreg("/", "\\V" .. pattern)
|
||||
vim.cmd("normal! n")
|
||||
end, { noremap = true, silent = true, desc = "Search for Visual Selection" })
|
||||
|
||||
-- LSP Diagnostic Mappings
|
||||
local diag_opts = { silent = true }
|
||||
vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, diag_opts)
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, diag_opts)
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, diag_opts)
|
||||
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, diag_opts)
|
||||
Loading…
Add table
Add a link
Reference in a new issue