update git diff
This commit is contained in:
parent
769700b5ec
commit
da22992983
4 changed files with 77 additions and 37 deletions
|
|
@ -5,6 +5,8 @@
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = " "
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
vim.o.diffopt = "vertical,closeoff,filler"
|
||||||
|
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
|
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
|
|
|
||||||
|
|
@ -2,36 +2,55 @@ return { -- Change colors.none if not using a transparent background
|
||||||
"catppuccin/nvim",
|
"catppuccin/nvim",
|
||||||
name = "catppuccin",
|
name = "catppuccin",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
opts = {
|
config = function()
|
||||||
flavour = "macchiato",
|
local utils = require("catppuccin.utils.colors")
|
||||||
transparent_background = true,
|
|
||||||
integrations = {
|
local opts = {
|
||||||
aerial = true,
|
flavour = "macchiato",
|
||||||
blink_cmp = true,
|
transparent_background = true,
|
||||||
cmp = true,
|
integrations = {
|
||||||
harpoon = false,
|
aerial = true,
|
||||||
indent_blankline = { enabled = true, scope_color = "text", },
|
blink_cmp = true,
|
||||||
lsp_trouble = true,
|
cmp = true,
|
||||||
mason = true,
|
gitsigns = true,
|
||||||
neogit = true,
|
indent_blankline = { enabled = true, scope_color = "text", },
|
||||||
noice = true,
|
lsp_trouble = true,
|
||||||
notify = true,
|
mason = true,
|
||||||
},
|
noice = true,
|
||||||
custom_highlights = function(colors)
|
notify = true,
|
||||||
return {
|
},
|
||||||
-- Fix colors for cmp
|
custom_highlights = function(colors)
|
||||||
Pmenu = { bg = colors.none, blend = 0 },
|
return {
|
||||||
FloatBorder = { bg = colors.none },
|
-- Fix colors for cmp
|
||||||
CmpItemMenu = { fg = colors.text, bg = colors.none },
|
Pmenu = { bg = colors.none, blend = 0 },
|
||||||
-- dadbod-ui
|
FloatBorder = { bg = colors.none },
|
||||||
NotificationInfo = { bg = colors.none, fg = colors.text },
|
CmpItemMenu = { fg = colors.text, bg = colors.none },
|
||||||
NotificationWarning = { bg = colors.none, fg = colors.yellow },
|
-- dadbod-ui
|
||||||
NotificationError = { bg = colors.none, fg = colors.red },
|
NotificationInfo = { bg = colors.none, fg = colors.text },
|
||||||
}
|
NotificationWarning = { bg = colors.none, fg = colors.yellow },
|
||||||
end,
|
NotificationError = { bg = colors.none, fg = colors.red },
|
||||||
},
|
|
||||||
|
-- for word diff in previews
|
||||||
|
GitSignsAddInline = {
|
||||||
|
fg = colors.teal,
|
||||||
|
bg = utils.darken(colors.teal, 0.4),
|
||||||
|
style = { "bold" },
|
||||||
|
},
|
||||||
|
GitSignsDeleteInline = {
|
||||||
|
fg = colors.red,
|
||||||
|
bg = utils.darken(colors.red, 0.4),
|
||||||
|
style = { "bold" },
|
||||||
|
},
|
||||||
|
GitSignsChangeInline = {
|
||||||
|
fg = colors.mauve,
|
||||||
|
bg = utils.darken(colors.mauve, 0.4),
|
||||||
|
style = { "bold" },
|
||||||
|
},
|
||||||
|
GitSignsDeleteVirtLn = { bg = colors.none, fg = colors.red },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
config = function(_, opts)
|
|
||||||
require("catppuccin").setup(opts)
|
require("catppuccin").setup(opts)
|
||||||
vim.cmd.colorscheme("catppuccin-macchiato")
|
vim.cmd.colorscheme("catppuccin-macchiato")
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,32 @@
|
||||||
|
local const = require("aleidk.constants")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
opts = {
|
opts = {
|
||||||
-- See `:help gitsigns.txt`
|
-- See `:help gitsigns.txt`
|
||||||
signs = {
|
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||||
add = { text = "▎" },
|
numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
|
||||||
change = { text = "▎" },
|
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||||
delete = { text = "" },
|
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||||
topdelete = { text = "" },
|
signs = {
|
||||||
changedelete = { text = "▎" },
|
add = { text = const.icons.git.added },
|
||||||
|
change = { text = const.icons.git.modified },
|
||||||
|
delete = { text = const.icons.git.removed },
|
||||||
|
topdelete = { text = const.icons.git.removed },
|
||||||
|
changedelete = { text = const.icons.git.removed },
|
||||||
untracked = { text = "▎" },
|
untracked = { text = "▎" },
|
||||||
},
|
},
|
||||||
on_attach = function(buffer)
|
signs_staged = {
|
||||||
|
add = { text = const.icons.git.added },
|
||||||
|
change = { text = const.icons.git.modified },
|
||||||
|
delete = { text = const.icons.git.removed },
|
||||||
|
topdelete = { text = const.icons.git.removed },
|
||||||
|
changedelete = { text = const.icons.git.removed },
|
||||||
|
untracked = { text = "▎" },
|
||||||
|
},
|
||||||
|
on_attach = function(buffer)
|
||||||
local gs = package.loaded.gitsigns
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
local function map(mode, l, r, desc)
|
local function map(mode, l, r, desc)
|
||||||
|
|
@ -28,7 +42,10 @@ return {
|
||||||
map("n", "R", gs.reset_buffer, "Reset Buffer")
|
map("n", "R", gs.reset_buffer, "Reset Buffer")
|
||||||
map("n", "<TAB>", gs.preview_hunk, "Preview Hunk")
|
map("n", "<TAB>", gs.preview_hunk, "Preview Hunk")
|
||||||
map("n", "l", function() gs.blame_line({ full = true }) end, "Blame Line")
|
map("n", "l", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||||
map("n", "d", gs.diffthis, "Diff This")
|
map("n", "L", gs.toggle_current_line_blame, "Toggle current line blame")
|
||||||
|
map("n", "d", gs.toggle_word_diff, "Toggle word diff")
|
||||||
|
map("n", "h", "<CMD>diffget<CR>", "Diff This with last commit")
|
||||||
|
map("n", "l", "<CMD>diffput<CR>", "Diff This with last commit")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ prepend_keymap = [
|
||||||
{ on = ["g", "<Space>"], run = "cd --interactive", desc = "Go to a directory interactively" },
|
{ on = ["g", "<Space>"], run = "cd --interactive", desc = "Go to a directory interactively" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[input]
|
||||||
|
keymap = [{ on = ["<Esc>"], run = "escape --all", desc = "Go back the normal mode, or cancel input" }]
|
||||||
[help]
|
[help]
|
||||||
|
|
||||||
prepend_keymap = [{ on = "q", run = "escape", desc = "Clear the filter, or hide the help" }]
|
prepend_keymap = [{ on = "q", run = "escape", desc = "Clear the filter, or hide the help" }]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue