From 2639f27f8445468d228cdce518e303ef02c4ea28 Mon Sep 17 00:00:00 2001 From: dlond Date: Fri, 9 May 2025 12:19:20 +1200 Subject: [PATCH] fixing keymaps --- init.lua | 3 +++ lua/custom/keymaps.lua | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 lua/custom/keymaps.lua diff --git a/init.lua b/init.lua index ed464d6e..f63c4ca3 100644 --- a/init.lua +++ b/init.lua @@ -219,6 +219,9 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +require 'custom.options' +require 'custom.keymaps' + -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' diff --git a/lua/custom/keymaps.lua b/lua/custom/keymaps.lua new file mode 100644 index 00000000..46a8e101 --- /dev/null +++ b/lua/custom/keymaps.lua @@ -0,0 +1,25 @@ +-- [[ Basic Keymaps ]] +-- See `:help vim.keymap.set()` + +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` +vim.keymap.set('n', '', 'nohlsearch', { desc = 'Clear Search Highlight' }) + +-- Diagnostic keymaps (These might also be set by LSP config, but having them here is fine) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + +-- Exit terminal mode in the builtin terminal +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + +-- Keybinds to make split navigation easier. +-- Use CTRL+ to switch between windows +-- See `:help wincmd` +vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) + +-- Add any other general-purpose keymaps you want here + +-- Standard practice for Lua modules that don't need to return complex data +return {}