From 40d94e85bfd5ae422aa0b8b5ae147229896994f5 Mon Sep 17 00:00:00 2001 From: Franciszek Malinka Date: Sat, 5 Nov 2022 11:41:28 +0100 Subject: Added gitsigns; added shortcuts to change colorscheme --- lua/user/cmp.lua | 2 +- lua/user/gitsigns.lua | 7 +++++++ lua/user/keymaps.lua | 4 ++++ lua/user/lsp/handlers.lua | 2 +- lua/user/plugins.lua | 3 +++ 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 lua/user/gitsigns.lua (limited to 'lua') diff --git a/lua/user/cmp.lua b/lua/user/cmp.lua index b52f421..51eecfc 100644 --- a/lua/user/cmp.lua +++ b/lua/user/cmp.lua @@ -10,7 +10,7 @@ end require("luasnip/loaders/from_vscode").lazy_load() -local check_backspace = function() +local check_backspace = function() local col = vim.fn.col "." - 1 return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" end diff --git a/lua/user/gitsigns.lua b/lua/user/gitsigns.lua new file mode 100644 index 0000000..2780a58 --- /dev/null +++ b/lua/user/gitsigns.lua @@ -0,0 +1,7 @@ +local status_ok, gitsigns = pcall(require, "gitsigns") +if not status_ok then + print "nvim-lsp-installer not opened correctly" + return +end + +gitsigns.setup({}) diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index c0291c9..e6fa25c 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -63,3 +63,7 @@ keymap("n", "so", "SessionManager load_session", opts) -- Bbye keymap("n", "q", "Bdelete", opts) + +-- Random +keymap("n", "b", ":colorscheme gruvbox:set background=light", opts) +keymap("n", "n", ":colorscheme darkplus:set background=daret background=light", opts) diff --git a/lua/user/lsp/handlers.lua b/lua/user/lsp/handlers.lua index 9b35d98..a5f78d7 100644 --- a/lua/user/lsp/handlers.lua +++ b/lua/user/lsp/handlers.lua @@ -83,6 +83,6 @@ if not status_ok then return end -M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities) +M.capabilities = cmp_nvim_lsp.default_capabilities(capabilities) return M diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index c1c8e8c..2e363ec 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -88,6 +88,9 @@ return packer.startup(function(use) use "goolord/alpha-nvim" use "Shatur/neovim-session-manager" + + use "lewis6991/gitsigns.nvim" + if PACKER_BOOTSTRAP then require("packer").sync() end -- cgit v1.2.3