gitsigns mappings + tweaks

master
spike 2 years ago
parent f31f3649e9
commit e4189180ef

File diff suppressed because it is too large Load Diff

@ -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"] = {
@ -194,22 +194,22 @@ return {
after = "nvim-dap",
config = function()
require("nvim-dap-virtual-text").setup({
enabled = true, -- enable this plugin (the default)
enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination)
highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables)
show_stop_reason = true, -- show stop reason when stopped for exceptions
commented = false, -- prefix virtual text with comment string
only_first_definition = true, -- only show virtual text at first definition (if there are multiple)
all_references = false, -- show virtual text on all all references of the variable (not only definitions)
enabled = true, -- enable this plugin (the default)
enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination)
highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables)
show_stop_reason = true, -- show stop reason when stopped for exceptions
commented = false, -- prefix virtual text with comment string
only_first_definition = true, -- only show virtual text at first definition (if there are multiple)
all_references = false, -- show virtual text on all all references of the variable (not only definitions)
filter_references_pattern = '<module', -- filter references (not definitions) pattern when all_references is activated (Lua gmatch pattern, default filters out Python modules)
-- experimental features:
virt_text_pos = 'eol', -- position of virtual text, see `:h nvim_buf_set_extmark()`
all_frames = true, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine.
virt_lines = false, -- show virtual lines instead of virtual text (will flicker!)
virt_text_win_col = 80 -- position the virtual text at a fixed window column (starting from the first text column) ,
-- e.g. 80 to position at column 80, see `:h nvim_buf_set_extmark()`
})
virt_text_pos = 'eol', -- position of virtual text, see `:h nvim_buf_set_extmark()`
all_frames = true, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine.
virt_lines = false, -- show virtual lines instead of virtual text (will flicker!)
virt_text_win_col = 80 -- position the virtual text at a fixed window column (starting from the first text column) ,
-- e.g. 80 to position at column 80, see `:h nvim_buf_set_extmark()`
})
end
}, -- }}}
@ -304,15 +304,15 @@ return {
},
["https://git.sp4ke.xyz/sp4ke/vim-vimux"] = {
cond = function()
return vim.env.TMUX ~= nil
end,
setup = function()
require("core.utils").load_mappings "vimux"
-- vim.g.VimuxDebug = 1
vim.g.VimuxHeight = 20
end
},
cond = function()
return vim.env.TMUX ~= nil
end,
setup = function()
require("core.utils").load_mappings "vimux"
-- vim.g.VimuxDebug = 1
vim.g.VimuxHeight = 20
end
},
-- Job management (use nvim startjob )
-- Run async commands (make & errors)
@ -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({
@ -385,22 +395,22 @@ return {
delay_ms = 1000, -- How long repeated usage of a key should be prevented
grace_period = 1, -- How many repeated keypresses are allowed
keys = { -- Which keys (in which modes) should be delayed
['n'] = { 'h', 'j', 'k', 'l' },
-- ['nvi'] = { '<Left>', '<Down>', '<Up>', '<Right>' },
},
ignore_filetypes = {
"qf",
"NvimTree",
"help",
"qf",
"netrw",
"neorepl",
"dapui*",
"mason",
"guihua*",
"terminal*",
},
})
['n'] = { 'h', 'j', 'k', 'l' },
-- ['nvi'] = { '<Left>', '<Down>', '<Up>', '<Right>' },
},
ignore_filetypes = {
"qf",
"NvimTree",
"help",
"qf",
"netrw",
"neorepl",
"dapui*",
"mason",
"guihua*",
"terminal*",
},
})
end
},
-- ["takac/vim-hardtime"] = {-- {{{
@ -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