gitsigns mappings + tweaks

master
spike 2 years ago
parent f31f3649e9
commit e4189180ef

@ -9,7 +9,7 @@ end
local M = {}
M.general = { --{{{
i = {--{{{
i = { --{{{
["jk"] = { "<esc>", "escape" },
@ -24,9 +24,9 @@ M.general = { --{{{
-- luasnip change choice
["<C-l>"] = { "<Plug>luasnip-next-choice", "change luasnip choice" },
-- ["<C-u>"] = { "<cmd>lua require('luasnip.extras.select_choice')()<CR>", "change luasnip choice" },
},--}}}
}, --}}}
n = {--{{{
n = { --{{{
["<ESC>"] = {
function()
if vim.o.filetype == "qf" then
@ -51,7 +51,7 @@ M.general = { --{{{
["<C-Up>"] = { "<cmd>res +2 <CR>", "window height +" },
["<C-Down>"] = { "<cmd>res -2 <CR>", "window height -" },
["<leader>="] = { "<C-w>=", "adjust viewports "},
["<leader>="] = { "<C-w>=", "adjust viewports " },
-- quit dont save
["<leader>qq"] = { "<cmd> quitall! <cr>", "quit/close all windows, don't save" },
@ -85,9 +85,9 @@ M.general = { --{{{
-- option toggle cursor line
["<BS>l"] = { "<cmd> set cul!<CR>", "toggle line number" },
["<BS>c"] = {"<cmd>cclose<CR><cmd>lclose<CR>", "close quickfix"},
["<BS>c"] = { "<cmd>cclose<CR><cmd>lclose<CR>", "close quickfix" },
["<BS>d"] = {"<cmd>DelayTrainToggle<CR>", "disable delay train"},
["<BS>d"] = { "<cmd>DelayTrainToggle<CR>", "disable delay train" },
@ -96,8 +96,8 @@ M.general = { --{{{
-- lua source current file
["<leader>."] = {"<cmd> :w | source %<CR>", "save and source script "},
["<leader>rm"] = { function ()
["<leader>."] = { "<cmd> :w | source %<CR>", "save and source script " },
["<leader>rm"] = { function()
local ok, core = pcall(require, "core")
if not ok then
return
@ -108,10 +108,10 @@ M.general = { --{{{
require("plenary.reload").reload_module("core.mappings")
require("core.utils").load_mappings()
print("mappings reloaded !")
end, "config reload mappings"},
end, "config reload mappings" },
["<leader>ss"] = { "<cmd> mks! <CR>", "save session"},
["<leader>sl"] = { "<cmd> source Session.vim <CR>", "load session"},
["<leader>ss"] = { "<cmd> mks! <CR>", "save session" },
["<leader>sl"] = { "<cmd> source Session.vim <CR>", "load session" },
["<leader>tt"] = {
function()
@ -159,7 +159,7 @@ M.general = { --{{{
},
-- quick close window
["<C-x><C-x>"] = {"<C-w>c", "close window"},
["<C-x><C-x>"] = { "<C-w>c", "close window" },
-- Increase number is with double <C-a> and decrease with simple C-x
@ -196,9 +196,9 @@ M.general = { --{{{
-- ["<leader>f9"] = { ":set foldlevel=9<CR>", "set fold level" },
["<leader>tf"] = { "<cmd> set foldmethod=expr<CR>|<cmd> set foldexpr=nvim_treesitter#foldexpr()<CR>",
"enable Treesitter folding"},
"enable Treesitter folding" },
["<leader>tp"]= {
["<leader>tp"] = {
function()
vim.cmd("TSPlaygroundToggle")
end,
@ -206,46 +206,46 @@ M.general = { --{{{
},
-- Moving lines around
["<M-Down>"] = {"<cmd>:m +1<CR>==", "move line up"},
["<M-Up>"] = {"<cmd>:m .-2<CR>==", "move line up"},
["<M-Down>"] = { "<cmd>:m +1<CR>==", "move line up" },
["<M-Up>"] = { "<cmd>:m .-2<CR>==", "move line up" },
-- syntax-tree-surfer
-- visual selection from nomral mode
["vm"] = {"<cmd>STSSelectMasterNode<CR>", "select master node"},
["vn"] = {"<cmd>STSSelectCurrentNode<CR>", "select master node"},
["vm"] = { "<cmd>STSSelectMasterNode<CR>", "select master node" },
["vn"] = { "<cmd>STSSelectCurrentNode<CR>", "select master node" },
-- normal mode swapping
-- swappint up/down
["vU"] = {function()
["vU"] = { function()
vim.opt.opfunc = "v:lua.STSSwapUpNormal_Dot"
return "g@l"
end, "TS swap Up master node with sibling", opts = { expr = true}},
["<BS><Up>"] = {function()
end, "TS swap Up master node with sibling", opts = { expr = true } },
["<BS><Up>"] = { function()
vim.opt.opfunc = "v:lua.STSSwapUpNormal_Dot"
return "g@l"
end, "TS swap Up master node with sibling", opts = { expr = true}},
end, "TS swap Up master node with sibling", opts = { expr = true } },
["vD"] = {function()
["vD"] = { function()
vim.opt.opfunc = "v:lua.STSSwapDownNormal_Dot"
return "g@l"
end, "TS swap Down master node with sibling", opts = { expr = true}},
["<BS><Down>"] = {function()
end, "TS swap Down master node with sibling", opts = { expr = true } },
["<BS><Down>"] = { function()
vim.opt.opfunc = "v:lua.STSSwapDownNormal_Dot"
return "g@l"
end, "TS swap Down master node with sibling", opts = { expr = true}},
end, "TS swap Down master node with sibling", opts = { expr = true } },
-- swapping left/right sibling nodes
["<M-Right>"] = {function()
["<M-Right>"] = { function()
vim.opt.opfunc = "v:lua.STSSwapCurrentNodeNextNormal_Dot"
return "g@l"
end, "TS swap right with sibling", opts = { expr = true}},
end, "TS swap right with sibling", opts = { expr = true } },
["<M-Left>"] = {function()
["<M-Left>"] = { function()
vim.opt.opfunc = "v:lua.STSSwapCurrentNodePrevNormal_Dot"
return "g@l"
end, "TS swap left with sibling", opts = { expr = true}},
end, "TS swap left with sibling", opts = { expr = true } },
["]e"] = { "<cmd> cn <CR>", "quickfix next error" },
["[e"] = { "<cmd> cp <CR>", "quickfix previous error" },
@ -270,10 +270,10 @@ M.general = { --{{{
local packer = require 'packer'
packer.snapshot(snapname)
end
, "packer snapshot"},
["<leader>pst"] = { "<cmd> PackerStatus<CR>", "packer status"},
["<leader>psc"] = { "<cmd> PackerSync<CR>", "packer sync"},
["<leader>pc"] = { "<cmd> PackerCompile<CR>", "packer compile"},
, "packer snapshot" },
["<leader>pst"] = { "<cmd> PackerStatus<CR>", "packer status" },
["<leader>psc"] = { "<cmd> PackerSync<CR>", "packer sync" },
["<leader>pc"] = { "<cmd> PackerCompile<CR>", "packer compile" },
["<leader>pr"] = { function()
@ -308,10 +308,10 @@ M.general = { --{{{
-- TODO: move to lspconfig section
-- ["<leader>lsp"] = { "<cmd> lua require('custom.plugins.configs.navigator').enable()<CR>", "lsp enable"},
["<leader>lsp"] = { "<cmd> LspStart<CR>", "lsp enable"},
["<M-s><M-s>"] = { "<cmd> LspStart<CR>", "lsp enable"},
["<M-t><M-t>"] = { "<cmd> LspStop<CR>", "lsp disable"},
["<leader>lst"] = { "<cmd> LspStop<CR>", "lsp disable"},
["<leader>lsp"] = { "<cmd> LspStart<CR>", "lsp enable" },
["<M-s><M-s>"] = { "<cmd> LspStart<CR>", "lsp enable" },
["<M-t><M-t>"] = { "<cmd> LspStop<CR>", "lsp disable" },
["<leader>lst"] = { "<cmd> LspStop<CR>", "lsp disable" },
@ -320,16 +320,12 @@ M.general = { --{{{
---------------
-- config files
["<leader>ev"] = {"<cmd> source ~/.config/nvim/Session.vim<CR>" , "edit vim config"},
},--}}}
["<leader>ev"] = { "<cmd> source ~/.config/nvim/Session.vim<CR>", "edit vim config" },
}, --}}}
t = { ["<C-x>"] = { termcodes "<C-\\><C-N>", "escape terminal mode" } },
v = {--{{{
-- ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
-- ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
["j"] = { "gj" },
["k"] = { "gk" },
v = { --{{{
-- yank from cursor to eol to system and primary clipboard
@ -350,10 +346,10 @@ M.general = { --{{{
["<leader>a,"] = { "<cmd> Tabularize /,<CR>" },
["<leader>a<Bar>"] = { "<cmd> Tabularize /<Bar><CR>" },
},--}}}
}, --}}}
-- command line mappings
c = {--{{{
c = { --{{{
["Tabe"] = { "tabe" },
-- Change Working Directory to that of the current file
@ -361,38 +357,43 @@ M.general = { --{{{
["cd."] = { "lcd %:p:h", "change dir to current file" },
["w!!"] = { "w !doas tee %", "write file with root perms" },
["%%"] = { "<C-R>=fnameescape(expand('%:h')).'/'<cr>",
"alias to current working dir"},
["Tab"] = { "Tabularize"},
"alias to current working dir" },
["Tab"] = { "Tabularize" },
["%c"] = { "~/.config/nvim/", "shortcut to nvim config dir"},
["%c"] = { "~/.config/nvim/", "shortcut to nvim config dir" },
-- ["tsf"] = { "set foldmethod=expr | set foldexpr=nvim_treesitter#foldexpr()",
-- "enable Treesitter folding"}
},--}}}
}, --}}}
-- visual exclusive mode (ignore select)
x = { -- {{{
-- ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
-- ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
["j"] = { "gj" },
["k"] = { "gk" },
-- Don't copy the replaced text after pasting in visual mode
-- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste
["p"] = { 'p:let @+=@0<CR>:let @"=@0<CR>', opts = { silent = true } },
-- syntax-tree-surfer
["J"] = {"<cmd>STSSelectNextSiblingNode<CR>", "select next sibling node"},
["K"] = {"<cmd>STSSelectPrevSiblingNode<CR>", "select prev sibling node"},
["H"] = {"<cmd>STSSelectParentNode<CR>", "select prev sibling node"},
["L"] = {"<cmd>STSSelectChildNode<CR>", "select prev sibling node"},
["J"] = { "<cmd>STSSelectNextSiblingNode<CR>", "select next sibling node" },
["K"] = { "<cmd>STSSelectPrevSiblingNode<CR>", "select prev sibling node" },
["H"] = { "<cmd>STSSelectParentNode<CR>", "select prev sibling node" },
["L"] = { "<cmd>STSSelectChildNode<CR>", "select prev sibling node" },
-- swap nodes tip: start first with master/child node selection then use these
["<M-Up>"] = {"<cmd>STSSwapPrevVisual<CR>", "select prev sibling node"},
["<M-Left>"] = {"<cmd>STSSwapPrevVisual<CR>", "select prev sibling node"},
["<M-Down>"] = {"<cmd>STSSwapNextVisual<CR>", "select next sibling node"},
["<M-Right>"] = {"<cmd>STSSwapNextVisual<CR>", "select next sibling node"},
["<M-Up>"] = { "<cmd>STSSwapPrevVisual<CR>", "select prev sibling node" },
["<M-Left>"] = { "<cmd>STSSwapPrevVisual<CR>", "select prev sibling node" },
["<M-Down>"] = { "<cmd>STSSwapNextVisual<CR>", "select next sibling node" },
["<M-Right>"] = { "<cmd>STSSwapNextVisual<CR>", "select next sibling node" },
},-- }}}
} --}}}
}, -- }}}
} --}}}
M.tabufline = { --{{{
M.tabufline = { --{{{
plugin = true,
n = {
@ -414,9 +415,9 @@ M.general = { --{{{
-- pick buffers via numbers
["<Bslash>"] = { "<cmd> TbufPick <CR>", "Pick buffer" },
},
} --}}}
} --}}}
M.comment = { --{{{
M.comment = { --{{{
plugin = true,
-- toggle comment in both modes
@ -439,9 +440,9 @@ M.general = { --{{{
"toggle comment",
},
},
} --}}}
} --}}}
M.lspconfig = { --{{{
M.lspconfig = { --{{{
plugin = true,
-- See `<cmd> :help vim.lsp.*` for documentation on any of the below functions
@ -566,9 +567,9 @@ M.general = { --{{{
"lsp list workspace folders",
},
},
} --}}}
} --}}}
M.dap = {-- {{{
M.dap = { -- {{{
plugin = true,
n = {
["<leader>ds"] = {
@ -600,11 +601,11 @@ M.general = { --{{{
"stop dap session"
},
["<leader>dd"] = {"<cmd> DapToggleBreakpoint <CR>"},
["<leader>dd"] = { "<cmd> DapToggleBreakpoint <CR>" },
["<leader>dc"] = {
function()
vim.ui.input({ prompt = "condition> "}, function(input)
vim.ui.input({ prompt = "condition> " }, function(input)
require("dap").set_breakpoint(input)
end)
end,
@ -616,28 +617,28 @@ M.general = { --{{{
end,
"enter dap mode"
},
["<leader>dr"] = {"<cmd>lua require'dap'.run_last()<CR>", "[dap] rerun last"},
["<leader>dr"] = { "<cmd>lua require'dap'.run_last()<CR>", "[dap] rerun last" },
["<leader>dl"] = {
function()
require('spike.dap.utils').dap_logpoint()
end,
"[dap] add log point"
},
["<leader>dt"] = {"<cmd>lua require'dapui'.toggle()<CR>", "[dap] toggle UI"},
["<leader>dt"] = { "<cmd>lua require'dapui'.toggle()<CR>", "[dap] toggle UI" },
},
}-- }}}
} -- }}}
M.nvimtree = { --{{{
M.nvimtree = { --{{{
plugin = true,
n = {
-- toggle
["<Left>"] = { "<cmd> NvimTreeToggle <CR>", "toggle nvimtree" },
},
} --}}}
} --}}}
M.fzf_lua = { --{{{
M.fzf_lua = { --{{{
plugin = true,
n = {
@ -676,9 +677,9 @@ M.general = { --{{{
-- ["<leader>tk"] = { "<cmd> FzfLua keymaps <CR>", "FzfLua show keymaps" },
}
} --}}}
} --}}}
M.telescope = { --{{{
M.telescope = { --{{{
plugin = true,
n = {
@ -688,7 +689,7 @@ M.general = { --{{{
--
["<leader>fa"] = { "<cmd> Telescope find_files follow=true no_ignore=true hidden=true <CR>", "find all" },
["<C-p>"] = {
function ()
function()
local ignored_bufs = {
"qf",
"guihua",
@ -702,7 +703,8 @@ M.general = { --{{{
end
end
vim.cmd "Telescope find_files"
end, "FzfLua find files" },
end, "FzfLua find files"
},
["<leader>f."] = { "<cmd> Telescope live_grep <CR>", "telescope live grep" },
["<leader>fw"] = { "<cmd> Telescope grep_string <CR>", "telescope grep cword" },
["<leader>;"] = { "<cmd> Telescope buffers <CR>", "telescope find buffers" },
@ -728,9 +730,9 @@ M.general = { --{{{
-- theme switcher
["<leader>th"] = { "<cmd> Telescope themes <CR>", "nvchad themes" },
},
} --}}}
} --}}}
M.nvterm = { --{{{
M.nvterm = { --{{{
plugin = true,
t = {
@ -789,9 +791,9 @@ M.general = { --{{{
"new vertical term",
},
},
} --}}}
} --}}}
M.whichkey = { --{{{
M.whichkey = { --{{{
plugin = true,
n = {
@ -809,9 +811,9 @@ M.general = { --{{{
"which-key query lookup",
},
},
} --}}}
} --}}}
M.blankline = { --{{{
M.blankline = { --{{{
plugin = true,
n = {
@ -831,17 +833,17 @@ M.general = { --{{{
"Jump to current context",
},
},
} --}}}
} --}}}
-- code outline panel
M.aerial = {
-- code outline panel
M.aerial = {
plugin = true,
n = {
["<Right>"] = {"<cmd> AerialToggle! right<CR>"},
}
["<Right>"] = { "<cmd> AerialToggle! right<CR>" },
}
}
M.asyncrun = { --{{{
M.asyncrun = { --{{{
plugin = true,
n = {
@ -852,57 +854,57 @@ M.general = { --{{{
["<leader>pd"] = { "<cmd> AsyncRun lpr -P PDF_PRINT %<CR>", "PDF print file" },
["<leader>pp"] = { "<cmd> AsyncRun lpr %<CR>" },
},
} --}}}
} --}}}
M.vim_bookmarks = {--{{{
M.vim_bookmarks = { --{{{
n = {
["<BS>m"] = {"<cmd> Telescope vim_bookmarks<CR>", "show bookmarks"},
["mk"] = {"<cmd> BookmarkToggle<CR>", "toggle bookmarks"},
["<leader>mm"] = {"<cmd> BookmarkAnnotate<CR>", "annotation bookmarks"},
["<leader>mc"] = {"<cmd> BookmarkClear<CR>", "clear bookmarks in buffer"},
["<leader>mx"] = {"<cmd> BookmarkClearAll<CR>", "clear bookmarks in all buffers"},
["]b"] = {"<cmd>BookmarkNext<CR>", "jump to next bookmark"},
["[b"] = {"<cmd>BookmarkNext<CR>", "jump to prev bookmark"},
["<BS>m"] = { "<cmd> Telescope vim_bookmarks<CR>", "show bookmarks" },
["mk"] = { "<cmd> BookmarkToggle<CR>", "toggle bookmarks" },
["<leader>mm"] = { "<cmd> BookmarkAnnotate<CR>", "annotation bookmarks" },
["<leader>mc"] = { "<cmd> BookmarkClear<CR>", "clear bookmarks in buffer" },
["<leader>mx"] = { "<cmd> BookmarkClearAll<CR>", "clear bookmarks in all buffers" },
["]b"] = { "<cmd>BookmarkNext<CR>", "jump to next bookmark" },
["[b"] = { "<cmd>BookmarkNext<CR>", "jump to prev bookmark" },
},
}--}}}
} --}}}
M.iron = {-- {{{{{{
M.iron = { -- {{{{{{
plugin = true,
n = {
["<leader>ir"] = {"<cmd>IronRepl<CR>", "start IronRepl"},
}
["<leader>ir"] = { "<cmd>IronRepl<CR>", "start IronRepl" },
}
}
-- }}}
--
-- color picker
M.ccc = {
-- color picker
M.ccc = {
plugin = true,
n = {
["<leader>cp"] = {"<cmd>CccPick<CR>", "color picker"}
["<leader>cp"] = { "<cmd>CccPick<CR>", "color picker" }
},
}
}
-- }}}
-- M.neorepl = {{{{
-- plugin = true,
--
-- i = {
-- ["C-p"] = { "<Plug>(neorepl-hist-prev)"},
-- }
--
-- }
-- M.neorepl = {{{{
-- plugin = true,
--
-- i = {
-- ["C-p"] = { "<Plug>(neorepl-hist-prev)"},
-- }
--
-- }
-- }}}
M.vimux = {
plugin = true,
n = {
-- rerun last
["<leader><Down>"] = {"<cmd>VimuxRunLastCommand<CR>", "vimux run last command"},
["<leader><Down>"] = { "<cmd>VimuxRunLastCommand<CR>", "vimux run last command" },
-- prompt
["<leader>vv"] = {"<cmd>VimuxPromptCommand<CR>", "vimux prompt command"},
["<leader>vc"] = {"<cmd>VimuxInterruptRunner<CR>", "vimux interrupt command"},
["<leader>vl"] = {"<cmd>VimuxClearTerminalScreen<CR>", "vimux clear terminal"},
["<leader>vx"] = {"<cmd>VimuxCloseRunner<CR>", "vimux close runner"},
["<leader>vv"] = { "<cmd>VimuxPromptCommand<CR>", "vimux prompt command" },
["<leader>vc"] = { "<cmd>VimuxInterruptRunner<CR>", "vimux interrupt command" },
["<leader>vl"] = { "<cmd>VimuxClearTerminalScreen<CR>", "vimux clear terminal" },
["<leader>vx"] = { "<cmd>VimuxCloseRunner<CR>", "vimux close runner" },
}
}
@ -913,5 +915,33 @@ M.golang = {
["<leader>da"] = { "<cmd> GoDebug -a<CR>", "go debug attach" },
}
}
--
-- git
M.gitsigns = {
plugin = true,
n = {
["<leader>gs"] = { "<cmd> lua require'gitsigns'.stage_hunk()<CR>",
"Git stage hunk",
},
["<leader>gS"] = { "<cmd> lua require'gitsigns'.stage_buffer()<CR>",
"Git stage buffer",
},
["<leader>gR"] = { "<cmd> lua require'gitsigns'.reset_buffer_index()<CR>",
"Git stage buffer",
},
["<leader>gp"] = { "<cmd> lua require'gitsigns'.preview_hunk()<CR>",
"Git stage buffer",
},
["<leader>gu"] = {"<cmd> lua require'gitsigns'.undo_stage_hunk()<CR>",
"Git undo stage hunk",
},
["]h"] = { "<cmd> lua require'gitsigns'.next_hunk()<CR>",
"Git next hunk",
},
["[h"] = { "<cmd> lua require'gitsigns'.prev_hunk()<CR>",
"Git prev hunk",
}
}
}
return M

@ -14,7 +14,7 @@ local colors = {
-- vim.tbl_deep_extend("force", M.ui.hl_add, custom_theme)
M.ui = {
theme = "gruvbox_light",
theme = "monekai",
theme_toggle = { "monekai", "gruvbox_light" },
hl_override = {
Comment = {

@ -0,0 +1,32 @@
local M = {}
local on_attach = function(bufnr)
require("custom.utils").set_plugin_mappings "gitsigns"
end
M.setup = function()
local present, gitsigns = pcall(require, "gitsigns")
if not present then
return
end
require("base46").load_highlight "git"
local options = {
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 = "DiffChangeDelete", text = "~", numhl = "GitSignsChangeNr" },
},
on_attach = on_attach,
}
gitsigns.setup(options)
end
return M

@ -80,7 +80,7 @@ return {
-- Treesitter dev/exploration tool
["nvim-treesitter/playground"] = {
opt = true,
cmd = {"TSPlayground*"},
cmd = { "TSPlayground*" },
},
["nvim-treesitter/nvim-treesitter-context"] = {
@ -328,13 +328,23 @@ return {
}, -- }}}
-- Git
["lewis6991/gitsigns.nvim"] = {
ft = "gitcommit",
setup = function()
require("core.lazy_load").gitsigns()
end,
config = function()
require("custom.plugins.configs.gitsigns").setup()
end,
},
["tpope/vim-fugitive"] = {
cmd = { "G", "Git", "G*" }
},
["sindrets/diffview.nvim"] = {
requires = {"nvim-lua/plenary.nvim"},
after = {"plenary.nvim"},
requires = { "nvim-lua/plenary.nvim" },
after = { "plenary.nvim" },
config = function()
require("diffview").setup({
@ -505,9 +515,9 @@ return {
--
['stevearc/aerial.nvim'] = {
after = {"base46"},
keys = {"<Right>"},
cmd = {"Aerial*"},
after = { "base46" },
keys = { "<Right>" },
cmd = { "Aerial*" },
config = function()
require("core.utils").load_mappings "aerial"
require('aerial').setup({})

@ -13,6 +13,7 @@ local M = {}
mapping_info.opts, opts.mode = nil, nil
opts.desc = mapping_info[2]
P(keybind)
vim.keymap.set(mode, keybind, mapping_info[1], opts)
end
end

@ -92,7 +92,10 @@ local options = {
elseif luasnip.expandable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.confirm()
cmp.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = false,
})
else
fallback()
end

@ -106,28 +106,6 @@ M.comment = function()
nvim_comment.setup(options)
end
M.gitsigns = function()
local present, gitsigns = pcall(require, "gitsigns")
if not present then
return
end
require("base46").load_highlight "git"
local options = {
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 = "DiffChangeDelete", text = "~", numhl = "GitSignsChangeNr" },
},
}
options = load_override(options, "lewis6991/gitsigns.nvim")
gitsigns.setup(options)
end
M.devicons = function()
local present, devicons = pcall(require, "nvim-web-devicons")

@ -86,17 +86,6 @@ local plugins = {
end,
},
-- git stuff
["lewis6991/gitsigns.nvim"] = {
ft = "gitcommit",
setup = function()
require("core.lazy_load").gitsigns()
end,
config = function()
require("plugins.configs.others").gitsigns()
end,
},
-- lsp stuff
["williamboman/mason.nvim"] = {

Loading…
Cancel
Save