From 4dd8d14dff60d7a90f16afee8d4870dbfdb46c99c9173983633efccf01de3570 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 26 Jun 2024 10:56:56 +0200 Subject: [PATCH] Added git integrations, refactor keymaps to vim-settings.lua --- nvim/.config/nvim/lua/plugins/git.lua | 11 +++++++++++ nvim/.config/nvim/lua/vim-settings.lua | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 nvim/.config/nvim/lua/plugins/git.lua diff --git a/nvim/.config/nvim/lua/plugins/git.lua b/nvim/.config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..0f7d10c --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/git.lua @@ -0,0 +1,11 @@ +return { + { + "tpope/vim-fugitive" + }, + { + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup() + end + } +} diff --git a/nvim/.config/nvim/lua/vim-settings.lua b/nvim/.config/nvim/lua/vim-settings.lua index 97685f4..37ab5d6 100644 --- a/nvim/.config/nvim/lua/vim-settings.lua +++ b/nvim/.config/nvim/lua/vim-settings.lua @@ -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", "", "Neotree toggle") -- Open Neotree fs with CTRL - n +vim.keymap.set("n", "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", "gp", "Gitsigns preview_hunk") -- Open tab with changes with Space - gp +vim.keymap.set("n", "gt", "Gitsigns toggle_current_line_blame") -- Shows when and who changed with Space - gt