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) -- vim.tbl_deep_extend("force", M.ui.hl_add, custom_theme)
M.ui = { M.ui = {
theme = "gruvbox_light", theme = "monekai",
theme_toggle = { "monekai", "gruvbox_light" }, theme_toggle = { "monekai", "gruvbox_light" },
hl_override = { hl_override = {
Comment = { 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 -- Treesitter dev/exploration tool
["nvim-treesitter/playground"] = { ["nvim-treesitter/playground"] = {
opt = true, opt = true,
cmd = {"TSPlayground*"}, cmd = { "TSPlayground*" },
}, },
["nvim-treesitter/nvim-treesitter-context"] = { ["nvim-treesitter/nvim-treesitter-context"] = {
@ -194,22 +194,22 @@ return {
after = "nvim-dap", after = "nvim-dap",
config = function() config = function()
require("nvim-dap-virtual-text").setup({ require("nvim-dap-virtual-text").setup({
enabled = true, -- enable this plugin (the default) 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) 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_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) 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 show_stop_reason = true, -- show stop reason when stopped for exceptions
commented = false, -- prefix virtual text with comment string commented = false, -- prefix virtual text with comment string
only_first_definition = true, -- only show virtual text at first definition (if there are multiple) 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) 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) filter_references_pattern = '<module', -- filter references (not definitions) pattern when all_references is activated (Lua gmatch pattern, default filters out Python modules)
-- experimental features: -- experimental features:
virt_text_pos = 'eol', -- position of virtual text, 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. 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_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) , 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()` -- e.g. 80 to position at column 80, see `:h nvim_buf_set_extmark()`
}) })
end end
}, -- }}} }, -- }}}
@ -304,15 +304,15 @@ return {
}, },
["https://git.sp4ke.xyz/sp4ke/vim-vimux"] = { ["https://git.sp4ke.xyz/sp4ke/vim-vimux"] = {
cond = function() cond = function()
return vim.env.TMUX ~= nil return vim.env.TMUX ~= nil
end, end,
setup = function() setup = function()
require("core.utils").load_mappings "vimux" require("core.utils").load_mappings "vimux"
-- vim.g.VimuxDebug = 1 -- vim.g.VimuxDebug = 1
vim.g.VimuxHeight = 20 vim.g.VimuxHeight = 20
end end
}, },
-- Job management (use nvim startjob ) -- Job management (use nvim startjob )
-- Run async commands (make & errors) -- Run async commands (make & errors)
@ -328,13 +328,23 @@ return {
}, -- }}} }, -- }}}
-- Git -- 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"] = { ["tpope/vim-fugitive"] = {
cmd = { "G", "Git", "G*" } cmd = { "G", "Git", "G*" }
}, },
["sindrets/diffview.nvim"] = { ["sindrets/diffview.nvim"] = {
requires = {"nvim-lua/plenary.nvim"}, requires = { "nvim-lua/plenary.nvim" },
after = {"plenary.nvim"}, after = { "plenary.nvim" },
config = function() config = function()
require("diffview").setup({ require("diffview").setup({
@ -385,22 +395,22 @@ return {
delay_ms = 1000, -- How long repeated usage of a key should be prevented delay_ms = 1000, -- How long repeated usage of a key should be prevented
grace_period = 1, -- How many repeated keypresses are allowed grace_period = 1, -- How many repeated keypresses are allowed
keys = { -- Which keys (in which modes) should be delayed keys = { -- Which keys (in which modes) should be delayed
['n'] = { 'h', 'j', 'k', 'l' }, ['n'] = { 'h', 'j', 'k', 'l' },
-- ['nvi'] = { '<Left>', '<Down>', '<Up>', '<Right>' }, -- ['nvi'] = { '<Left>', '<Down>', '<Up>', '<Right>' },
}, },
ignore_filetypes = { ignore_filetypes = {
"qf", "qf",
"NvimTree", "NvimTree",
"help", "help",
"qf", "qf",
"netrw", "netrw",
"neorepl", "neorepl",
"dapui*", "dapui*",
"mason", "mason",
"guihua*", "guihua*",
"terminal*", "terminal*",
}, },
}) })
end end
}, },
-- ["takac/vim-hardtime"] = {-- {{{ -- ["takac/vim-hardtime"] = {-- {{{
@ -505,9 +515,9 @@ return {
-- --
['stevearc/aerial.nvim'] = { ['stevearc/aerial.nvim'] = {
after = {"base46"}, after = { "base46" },
keys = {"<Right>"}, keys = { "<Right>" },
cmd = {"Aerial*"}, cmd = { "Aerial*" },
config = function() config = function()
require("core.utils").load_mappings "aerial" require("core.utils").load_mappings "aerial"
require('aerial').setup({}) require('aerial').setup({})

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

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

@ -106,28 +106,6 @@ M.comment = function()
nvim_comment.setup(options) nvim_comment.setup(options)
end 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() M.devicons = function()
local present, devicons = pcall(require, "nvim-web-devicons") local present, devicons = pcall(require, "nvim-web-devicons")

@ -86,17 +86,6 @@ local plugins = {
end, 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 -- lsp stuff
["williamboman/mason.nvim"] = { ["williamboman/mason.nvim"] = {

Loading…
Cancel
Save