From e63b9dfa60135c00364bdfb0439050437b707978 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 7 Mar 2021 20:49:51 +0530 Subject: [PATCH] gitsigns --- init.lua | 1 + lua/gitsigns/lua.lua | 29 +++++++++++++++++++++++++++++ lua/lsp_config/lua.lua | 1 + lua/mappings/lua.lua | 1 + lua/web-devicons/gitsigns | 0 5 files changed, 32 insertions(+) create mode 100644 lua/gitsigns/lua.lua create mode 100644 lua/web-devicons/gitsigns diff --git a/init.lua b/init.lua index 6a53fe1..944ca21 100644 --- a/init.lua +++ b/init.lua @@ -3,6 +3,7 @@ require('pluginsList.lua') require('utils.lua') require('nvimTree.lua') +require('gitsigns.lua') require('lsp_config.lua') require'colorizer'.setup() diff --git a/lua/gitsigns/lua.lua b/lua/gitsigns/lua.lua new file mode 100644 index 0000000..3dbd424 --- /dev/null +++ b/lua/gitsigns/lua.lua @@ -0,0 +1,29 @@ +require('gitsigns').setup { + signs = { + add = {hl = 'DiffAdd' , text = '▌', numhl='GitSignsAddNr'}, + change = {hl = 'DiffChange', text = '▌', numhl='GitSignsChangeNr'}, + delete = {hl = 'DiffDelete', text = '_', numhl='GitSignsDeleteNr'}, + topdelete = {hl = 'DiffDelete', text = '‾', numhl='GitSignsDeleteNr'}, + changedelete = {hl = 'DiffChange', text = '~', numhl='GitSignsChangeNr'}, + }, + numhl = false, + keymaps = { + -- Default keymap options + noremap = true, + buffer = true, + + ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns\".next_hunk()'"}, + ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns\".prev_hunk()'"}, + + ['n hs'] = 'lua require"gitsigns".stage_hunk()', + ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', + ['n hr'] = 'lua require"gitsigns".reset_hunk()', + ['n hp'] = 'lua require"gitsigns".preview_hunk()', + ['n hb'] = 'lua require"gitsigns".blame_line()', + }, + watch_index = { + interval = 100 + }, + sign_priority = 5, + status_formatter = nil, -- Use default +} diff --git a/lua/lsp_config/lua.lua b/lua/lsp_config/lua.lua index 23890bc..e2cc19a 100644 --- a/lua/lsp_config/lua.lua +++ b/lua/lsp_config/lua.lua @@ -54,6 +54,7 @@ end local servers = { "html" , "cssls" , "tsserver"} for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { on_attach = on_attach } + require"completion".on_attach(client) end -- keybinds diff --git a/lua/mappings/lua.lua b/lua/mappings/lua.lua index 8d1d148..645fc28 100644 --- a/lua/mappings/lua.lua +++ b/lua/mappings/lua.lua @@ -7,3 +7,4 @@ end -- keybind list map('', 'c', '"+y') +--map('' , '' , '%y+') diff --git a/lua/web-devicons/gitsigns b/lua/web-devicons/gitsigns new file mode 100644 index 0000000..e69de29