small tweaks to new neovim config

re-added yadm-gitsigns
This commit is contained in:
2024-10-31 20:23:54 -04:00
parent dc613843e8
commit 681f9ee032
4 changed files with 69 additions and 55 deletions
+3 -1
View File
@@ -8,9 +8,10 @@
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "6a28c90082a67f62a323ab90d988e000a718a8c7" }, "conform.nvim": { "branch": "master", "commit": "4dd429fe3f47077f4e50cdaf03f7877ce9b213e0" },
"dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" }, "dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" },
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
"gitsigns-yadm.nvim": { "branch": "main", "commit": "9813de8c122c62ce27a83a80e27c9b4fb662b018" },
"gitsigns.nvim": { "branch": "main", "commit": "7c27a30450130cd59c4994a6755e3c5d74d83e76" }, "gitsigns.nvim": { "branch": "main", "commit": "7c27a30450130cd59c4994a6755e3c5d74d83e76" },
"indent-blankline.nvim": { "branch": "master", "commit": "04e44b09ee3ff189c69ab082edac1ef7ae2e256c" }, "indent-blankline.nvim": { "branch": "master", "commit": "04e44b09ee3ff189c69ab082edac1ef7ae2e256c" },
"lazy.nvim": { "branch": "main", "commit": "cf8ecc2c5e4332760431a33534240b0cbc6680ab" }, "lazy.nvim": { "branch": "main", "commit": "cf8ecc2c5e4332760431a33534240b0cbc6680ab" },
@@ -23,6 +24,7 @@
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
"nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" },
"nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" }, "nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-lint": { "branch": "master", "commit": "36da8dd0ddc4f88e0beae234c20e75397326f143" }, "nvim-lint": { "branch": "master", "commit": "36da8dd0ddc4f88e0beae234c20e75397326f143" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" },
"nvim-lspconfig": { "branch": "master", "commit": "54617a18f4cf46f0c2f6d024fa6feb7515fe036d" }, "nvim-lspconfig": { "branch": "master", "commit": "54617a18f4cf46f0c2f6d024fa6feb7515fe036d" },
+1 -8
View File
@@ -1,16 +1,9 @@
-- set colorscheme if it's installed -- set colorscheme if it's installed
-- local status, _ = pcall(vim.cmd, "colorscheme nord")
-- if not status then
-- print("Color scheme not found!")
-- return
-- end
return { return {
"shaunsingh/nord.nvim", "shaunsingh/nord.nvim",
lazy = false, lazy = false,
priority = 1000, priority = 1000,
config = function() config = function()
vim.cmd([[colorscheme nord]]) vim.cmd [[colorscheme nord]]
end, end,
} }
+20 -17
View File
@@ -2,35 +2,38 @@ return {
"goolord/alpha-nvim", "goolord/alpha-nvim",
event = "VimEnter", event = "VimEnter",
config = function() config = function()
local alpha = require("alpha") local alpha = require "alpha"
local dashboard = require("alpha.themes.dashboard") local dashboard = require "alpha.themes.dashboard"
-- Set header -- Set header
dashboard.section.header.val = { dashboard.section.header.val = {
" ", " @@@@@@@ @@@@@@@@ @@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@ @@@@@@@ @@@ @@@ @@@@@@@@ @@@@@@@ ",
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", "@@@@@@@@ @@@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@ @@@ @@@ @@@@@@@@ @@@@@@@@ ",
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", "!@@ @@! @@@@ @@! @@@ @@! @@! @@! @@@ @@! @@! @@@ @@! @@! @@@ ",
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", "!@! !@! @!@!@ !@! @!@ !@! !@! !@! @!@ !@! !@! @!@ !@! !@! @!@ ",
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", "!@! @!@ @! !@! @!@ !@! @!!!:! @!!!:! @!@!@!@! @!! @!@!@!@! @!!!:! @!@!!@! ",
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", "!!! !@!!! !!! !@! !!! !!!!!: !!!!!: !!!@!!!! !!! !!!@!!!! !!!!!: !!@!@! ",
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", ":!! !!:! !!! !!: !!! !!: !!: !!: !!! !!: !!: !!! !!: !!: :!! ",
" ", ":!: :!: !:! :!: !:! :!: :!: :!: !:! :!: :!: !:! :!: :!: !:! ",
" ::: ::: ::::::: :: :::: :: :: :::: :: :: ::: :: :: ::: :: :::: :: ::: ",
" :: :: : : : : : :: : : : :: :: : : : : : : : : : :: :: : : : ",
" ",
} }
-- Set menu -- Set menu
dashboard.section.buttons.val = { dashboard.section.buttons.val = {
dashboard.button("e", " > New File", "<cmd>ene<CR>"), dashboard.button("e", " > New File", "<cmd>ene<CR>"),
dashboard.button("SPC ee", " > Toggle file explorer", "<cmd>NvimTreeToggle<CR>"), dashboard.button("SPC ee", " > Toggle file explorer", "<cmd>NvimTreeToggle<CR>"),
dashboard.button("SPC ff", "󰱼 > Find File", "<cmd>Telescope find_files<CR>"), dashboard.button("SPC ff", "󰱼 > Find File", "<cmd>Telescope find_files<CR>"),
dashboard.button("SPC fs", " > Find Word", "<cmd>Telescope live_grep<CR>"), dashboard.button("SPC fs", " > Find Word", "<cmd>Telescope live_grep<CR>"),
dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "<cmd>SessionRestore<CR>"), dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "<cmd>SessionRestore<CR>"),
dashboard.button("q", " > Quit NVIM", "<cmd>qa<CR>"), dashboard.button("q", " > Quit NVIM", "<cmd>qa<CR>"),
} }
-- Send config to alpha -- Send config to alpha
alpha.setup(dashboard.opts) alpha.setup(dashboard.opts)
-- Disable folding on alpha buffer -- Disable folding on alpha buffer
vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) vim.cmd [[autocmd FileType alpha setlocal nofoldenable]]
end, end,
} }
+43 -27
View File
@@ -1,7 +1,23 @@
return { return {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
{
"purarue/gitsigns-yadm.nvim",
opts = {
shell_timeout_ms = 1000,
},
},
},
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
opts = { opts = {
_on_attach_pre = function(_, callback)
if vim.fn.executable "yadm" == 1 then
require("gitsigns-yadm").yadm_signs(callback)
else
callback()
end
end,
on_attach = function(bufnr) on_attach = function(bufnr)
local gs = package.loaded.gitsigns local gs = package.loaded.gitsigns
@@ -15,7 +31,7 @@ return {
map("n", "<leader>hs", gs.stage_hunk, "Stage Hunk") map("n", "<leader>hs", gs.stage_hunk, "Stage Hunk")
map("n", "<leader>hr", gs.reset_hunk, "Reset Hunk") map("n", "<leader>hr", gs.reset_hunk, "Reset Hunk")
map("v", "<leader>hs", function() map("v", "<leader>hs", function()
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) gs.stage_hunk { vim.fn.line ".", vim.fn.line "v" }
end, "Reset Hunk") end, "Reset Hunk")
map("n", "<leader>hS", gs.stage_buffer, "Stage buffer") map("n", "<leader>hS", gs.stage_buffer, "Stage buffer")
@@ -24,14 +40,14 @@ return {
map("n", "<leader>hp", gs.preview_hunk, "Preview hunk") map("n", "<leader>hp", gs.preview_hunk, "Preview hunk")
map("n", "<leader>hb", function() map("n", "<leader>hb", function()
gs.blame_line({ full = true }) gs.blame_line { full = true }
end, "Blame line") end, "Blame line")
map("n", "<leader>hB", gs.toggle_current_line_blame, "Toggle line blame") map("n", "<leader>hB", gs.toggle_current_line_blame, "Toggle line blame")
map("n", "<leader>hd", gs.diffthis, "Diff this") map("n", "<leader>hd", gs.diffthis, "Diff this")
map("n", "<leader>hD", function() map("n", "<leader>hD", function()
gs.diffthis("~") gs.diffthis "~"
end, "Diff this ~") end, "Diff this ~")
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "Gitsigns select hunk") map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "Gitsigns select hunk")
@@ -39,45 +55,45 @@ return {
}, },
config = function() config = function()
local gitsigns = require("gitsigns") local gitsigns = require "gitsigns"
gitsigns.setup { gitsigns.setup {
signs = { signs = {
add = { text = '+' }, add = { text = "+" },
change = { text = '' }, change = { text = "" },
delete = { text = '_' }, delete = { text = "_" },
topdelete = { text = '' }, topdelete = { text = "" },
changedelete = { text = '~' }, changedelete = { text = "~" },
untracked = { text = '' }, untracked = { text = "" },
}, },
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl` numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl` linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = { watch_gitdir = {
interval = 1000, interval = 1000,
follow_files = true follow_files = true,
}, },
attach_to_untracked = true, attach_to_untracked = true,
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame` current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = { current_line_blame_opts = {
virt_text = true, virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 200, delay = 200,
ignore_whitespace = false, ignore_whitespace = false,
}, },
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>', current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
sign_priority = 6, sign_priority = 6,
update_debounce = 100, update_debounce = 100,
status_formatter = nil, -- Use default status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines) max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = { preview_config = {
-- Options passed to nvim_open_win -- Options passed to nvim_open_win
border = 'single', border = "single",
style = 'minimal', style = "minimal",
relative = 'cursor', relative = "cursor",
row = 0, row = 0,
col = 1 col = 1,
}, },
} }
end, end,