Files
dotfiles/.config/nvim/lua/config/keymaps.lua

25 lines
902 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- ~/.config/nvim/lua/config/keymaps.lua
local map = vim.keymap.set
local opts = { noremap = true, silent = true }
-- Alt+1 → Project view (NvimTree)
vim.keymap.set("n", "<A-1>", function ()
Snacks.explorer()
end, { noremap = true, silent = true })
-- Ctrl+Y → Delete current line
map("n", "<C-y>", "dd", opts)
-- Ctrl+Q → Close window / scope (like JetBrains splits default)
map("n", "<C-q>", "<C-w>q", opts)
-- Ctrl+W → Close buffer/file
map("n", "<C-w>", "<cmd>bd<cr>", opts)
-- Triple Shift (Shift+Shift+Shift) → "Search Everywhere"
-- Neovim cant detect triple-modifier presses, so we fake it.
-- Best workaround: map <leader><leader> to Telescope live_grep
map("n", "<leader><leader>", "<cmd>Telescope find_files<cr>", opts)
map("n", "<leader><leader><leader>", "<cmd>Telescope live_grep<cr>", opts)
map("n", "<A-Left>", "<C-w>h", opts)
map("n", "<A-Right>", "<C-w>l", opts)