Added git integrations, refactor keymaps to vim-settings.lua

This commit is contained in:
Philipp 2024-06-26 10:56:56 +02:00
parent 53dafa797f
commit 4dd8d14dff
Signed by: Philipp
GPG key ID: 9EBD8439AFBAB750
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,11 @@
return {
{
"tpope/vim-fugitive"
},
{
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup()
end
}
}

View file

@ -4,3 +4,10 @@ vim.cmd("set softtabstop=2")
vim.cmd("set shiftwidth=2")
vim.cmd("set clipboard+=unnamedplus")
vim.g.mapleader = " "
-- Setup custom keybinds
vim.keymap.set("n", "<C-n>", "<CMD>Neotree toggle<CR>") -- Open Neotree fs with CTRL - n
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action) -- Open Code actions with Space - ca
vim.keymap.set("n", "K", vim.lsp.buf.hover) -- Open information with captial K
vim.keymap.set("n", "<leader>gp", "<CMD>Gitsigns preview_hunk<CR>") -- Open tab with changes with Space - gp
vim.keymap.set("n", "<leader>gt", "<CMD>Gitsigns toggle_current_line_blame<CR>") -- Shows when and who changed with Space - gt