diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 0e1e578..4ce04b4 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -8,9 +8,10 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "6a28c90082a67f62a323ab90d988e000a718a8c7" }, + "conform.nvim": { "branch": "master", "commit": "4dd429fe3f47077f4e50cdaf03f7877ce9b213e0" }, "dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "gitsigns-yadm.nvim": { "branch": "main", "commit": "9813de8c122c62ce27a83a80e27c9b4fb662b018" }, "gitsigns.nvim": { "branch": "main", "commit": "7c27a30450130cd59c4994a6755e3c5d74d83e76" }, "indent-blankline.nvim": { "branch": "master", "commit": "04e44b09ee3ff189c69ab082edac1ef7ae2e256c" }, "lazy.nvim": { "branch": "main", "commit": "cf8ecc2c5e4332760431a33534240b0cbc6680ab" }, @@ -23,6 +24,7 @@ "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, "nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-lint": { "branch": "master", "commit": "36da8dd0ddc4f88e0beae234c20e75397326f143" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, "nvim-lspconfig": { "branch": "master", "commit": "54617a18f4cf46f0c2f6d024fa6feb7515fe036d" }, diff --git a/.config/nvim/lua/core/colorscheme.lua b/.config/nvim/lua/core/colorscheme.lua index dddd0dd..d496a1d 100644 --- a/.config/nvim/lua/core/colorscheme.lua +++ b/.config/nvim/lua/core/colorscheme.lua @@ -1,16 +1,9 @@ -- 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 { "shaunsingh/nord.nvim", lazy = false, priority = 1000, config = function() - vim.cmd([[colorscheme nord]]) + vim.cmd [[colorscheme nord]] end, } diff --git a/.config/nvim/lua/plugins/alpha.lua b/.config/nvim/lua/plugins/alpha.lua index ba08d76..fc0bde0 100644 --- a/.config/nvim/lua/plugins/alpha.lua +++ b/.config/nvim/lua/plugins/alpha.lua @@ -2,35 +2,38 @@ return { "goolord/alpha-nvim", event = "VimEnter", config = function() - local alpha = require("alpha") - local dashboard = require("alpha.themes.dashboard") + local alpha = require "alpha" + local dashboard = require "alpha.themes.dashboard" -- Set header dashboard.section.header.val = { - " ", - " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", - " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", - " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", - " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", - " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", - " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", - " ", + " @@@@@@@ @@@@@@@@ @@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@ @@@@@@@ @@@ @@@ @@@@@@@@ @@@@@@@ ", + "@@@@@@@@ @@@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@ @@@ @@@ @@@@@@@@ @@@@@@@@ ", + "!@@ @@! @@@@ @@! @@@ @@! @@! @@! @@@ @@! @@! @@@ @@! @@! @@@ ", + "!@! !@! @!@!@ !@! @!@ !@! !@! !@! @!@ !@! !@! @!@ !@! !@! @!@ ", + "!@! @!@ @! !@! @!@ !@! @!!!:! @!!!:! @!@!@!@! @!! @!@!@!@! @!!!:! @!@!!@! ", + "!!! !@!!! !!! !@! !!! !!!!!: !!!!!: !!!@!!!! !!! !!!@!!!! !!!!!: !!@!@! ", + ":!! !!:! !!! !!: !!! !!: !!: !!: !!! !!: !!: !!! !!: !!: :!! ", + ":!: :!: !:! :!: !:! :!: :!: :!: !:! :!: :!: !:! :!: :!: !:! ", + " ::: ::: ::::::: :: :::: :: :: :::: :: :: ::: :: :: ::: :: :::: :: ::: ", + " :: :: : : : : : :: : : : :: :: : : : : : : : : : :: :: : : : ", + " ", } -- Set menu dashboard.section.buttons.val = { - dashboard.button("e", " > New File", "ene"), - dashboard.button("SPC ee", " > Toggle file explorer", "NvimTreeToggle"), - dashboard.button("SPC ff", "󰱼 > Find File", "Telescope find_files"), - dashboard.button("SPC fs", " > Find Word", "Telescope live_grep"), - dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "SessionRestore"), - dashboard.button("q", " > Quit NVIM", "qa"), + dashboard.button("e", " > New File", "ene"), + dashboard.button("SPC ee", " > Toggle file explorer", "NvimTreeToggle"), + dashboard.button("SPC ff", "󰱼 > Find File", "Telescope find_files"), + dashboard.button("SPC fs", " > Find Word", "Telescope live_grep"), + dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "SessionRestore"), + dashboard.button("q", " > Quit NVIM", "qa"), } -- Send config to alpha alpha.setup(dashboard.opts) -- Disable folding on alpha buffer - vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) + vim.cmd [[autocmd FileType alpha setlocal nofoldenable]] end, } diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index a59b23e..4bee44c 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -1,10 +1,26 @@ return { "lewis6991/gitsigns.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + { + "purarue/gitsigns-yadm.nvim", + opts = { + shell_timeout_ms = 1000, + }, + }, + }, event = { "BufReadPre", "BufNewFile" }, 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) local gs = package.loaded.gitsigns - + local function map(mode, l, r, desc) vim.keuymap.set(mode, l, r, { buffer = bufnr, desc = desc }) end @@ -15,7 +31,7 @@ return { map("n", "hs", gs.stage_hunk, "Stage Hunk") map("n", "hr", gs.reset_hunk, "Reset Hunk") map("v", "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") map("n", "hS", gs.stage_buffer, "Stage buffer") @@ -24,14 +40,14 @@ return { map("n", "hp", gs.preview_hunk, "Preview hunk") map("n", "hb", function() - gs.blame_line({ full = true }) + gs.blame_line { full = true } end, "Blame line") map("n", "hB", gs.toggle_current_line_blame, "Toggle line blame") map("n", "hd", gs.diffthis, "Diff this") map("n", "hD", function() - gs.diffthis("~") + gs.diffthis "~" end, "Diff this ~") map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "Gitsigns select hunk") @@ -39,45 +55,45 @@ return { }, config = function() - local gitsigns = require("gitsigns") - + local gitsigns = require "gitsigns" + gitsigns.setup { signs = { - add = { text = '+' }, - change = { text = '│' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - untracked = { text = '┆' }, + add = { text = "+" }, + change = { text = "│" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + untracked = { text = "┆" }, }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = false, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` watch_gitdir = { - interval = 1000, - follow_files = true + interval = 1000, + follow_files = true, }, attach_to_untracked = true, current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame` current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 200, - ignore_whitespace = false, + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 200, + ignore_whitespace = false, }, - current_line_blame_formatter = ', - ', + current_line_blame_formatter = ", - ", sign_priority = 6, update_debounce = 100, status_formatter = nil, -- Use default max_file_length = 40000, -- Disable if file is longer than this (in lines) preview_config = { - -- Options passed to nvim_open_win - border = 'single', - style = 'minimal', - relative = 'cursor', - row = 0, - col = 1 + -- Options passed to nvim_open_win + border = "single", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, }, } end,