add some keymaps

This commit is contained in:
2025-10-21 21:49:34 +09:00
parent 6af119073f
commit f087fd2bdb
4 changed files with 27 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
-- LSP keymaps
local opts = { noremap = true, silent = true }
vim.g.mapleader = " "
-- Go to definition
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
@@ -23,4 +25,13 @@ vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
-- Code actions
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts)
-- Show floating error
vim.keymap.set("n", "E", vim.diagnostic.open_float, opts)
-- Window navigation with Ctrl + hjkl
vim.keymap.set('n', '<C-h>', '<C-w>h', opts)
vim.keymap.set('n', '<C-j>', '<C-w>j', opts)
vim.keymap.set('n', '<C-k>', '<C-w>k', opts)
vim.keymap.set('n', '<C-l>', '<C-w>l', opts)

View File

@@ -3,5 +3,8 @@ return {
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {},
keys = {
{ "<leader>dvo", "<Cmd>DiffviewOpen<CR>", desc = "Open Diff view" },
{ "<leader>dvc", "<Cmd>DiffviewClose<CR>", desc = "Close Diff view" },
{ "<leader>dvf", "<Cmd>DiffviewFocusFiles<CR>", desc = "Focus file in Diff view" },
},
}

9
lua/plugins/neotest.lua Normal file
View File

@@ -0,0 +1,9 @@
return {
"nvim-neotest/neotest",
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter"
}
}