From 2cce8ffdc890ef4363b6643fbe3c432a5e2a0a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Mon, 16 Oct 2023 12:46:37 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(nvim):=20rewrite=20of=20a=20?= =?UTF-8?q?lot=20of=20the=20config=20style,=20options=20and=20plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit new terminal, telescope plugins moved into telescope.lua for eassier management and a lot more --- .config/nvim/lazyvim.json | 1 + .config/nvim/lua/config/keymaps.lua | 138 +++++++++--------- .config/nvim/lua/config/options.lua | 3 + .config/nvim/lua/plugins/actions-preview.lua | 30 ++-- .config/nvim/lua/plugins/autolist.lua | 70 ++++----- ...etter-escape.lua => better-escape.lua.bak} | 0 .config/nvim/lua/plugins/block.lua | 20 ++- .config/nvim/lua/plugins/cinnamon.lua | 20 ++- .config/nvim/lua/plugins/color-picker.lua | 30 ++-- .config/nvim/lua/plugins/conform.lua | 3 +- .config/nvim/lua/plugins/dadbod.lua | 79 +++++----- .config/nvim/lua/plugins/dashboard.lua | 75 ---------- .config/nvim/lua/plugins/diffview.lua | 18 +-- .config/nvim/lua/plugins/dropbar.lua | 16 +- .../{floaterm.lua => floaterm.lua.bak} | 0 .config/nvim/lua/plugins/glance.lua | 18 +-- .config/nvim/lua/plugins/highlight-undo.lua | 14 +- .config/nvim/lua/plugins/lightbulb.lua | 38 +++-- .config/nvim/lua/plugins/lint.lua | 1 - .config/nvim/lua/plugins/lsp-lens.lua.bak | 12 +- .config/nvim/lua/plugins/lualine.lua | 15 +- .config/nvim/lua/plugins/markdown-preview.lua | 11 -- .../nvim/lua/plugins/markdown-preview.lua.bak | 11 ++ .config/nvim/lua/plugins/neogen.lua | 120 ++++++--------- .config/nvim/lua/plugins/none-ls.lua.bak | 50 +++---- .config/nvim/lua/plugins/numb.lua | 12 +- .config/nvim/lua/plugins/package-info.lua | 52 ++++--- .../lua/plugins/persistent-breakpoints.lua | 24 ++- .../nvim/lua/plugins/rainbow-delimeters.lua | 34 ++--- .config/nvim/lua/plugins/refactor.lua | 18 +-- .config/nvim/lua/plugins/regex.lua | 17 +-- .config/nvim/lua/plugins/satellite.lua | 122 ++++++++-------- .config/nvim/lua/plugins/smart-splits.lua.bak | 16 +- .../nvim/lua/plugins/telescope-all-recent.lua | 26 ---- .../nvim/lua/plugins/telescope-floaterm.lua | 10 -- .config/nvim/lua/plugins/telescope-import.lua | 10 -- .config/nvim/lua/plugins/telescope-lazy.lua | 9 -- .../nvim/lua/plugins/telescope-luasnip.lua | 9 -- .../nvim/lua/plugins/telescope-undotree.lua | 10 -- .config/nvim/lua/plugins/telescope-zoxide.lua | 9 -- .config/nvim/lua/plugins/telescope.lua | 71 ++++++++- .config/nvim/lua/plugins/toggleterm.lua | 38 +++++ .config/nvim/lua/plugins/toggleterm.lua.bak | 38 ----- .config/nvim/lua/plugins/twilight.lua | 50 +++---- .config/nvim/lua/plugins/undotree.lua | 8 +- .config/nvim/lua/plugins/urlview.lua | 16 +- .config/nvim/lua/plugins/which-key.lua | 2 +- .../{wildfire.lua => wildfire.lua.bak} | 0 .config/nvim/lua/plugins/winbar.lua.bak | 100 +++++++++++++ .config/nvim/lua/plugins/windows.lua | 31 ++-- 50 files changed, 740 insertions(+), 785 deletions(-) rename .config/nvim/lua/plugins/{better-escape.lua => better-escape.lua.bak} (100%) delete mode 100644 .config/nvim/lua/plugins/dashboard.lua rename .config/nvim/lua/plugins/{floaterm.lua => floaterm.lua.bak} (100%) delete mode 100644 .config/nvim/lua/plugins/markdown-preview.lua create mode 100644 .config/nvim/lua/plugins/markdown-preview.lua.bak delete mode 100644 .config/nvim/lua/plugins/telescope-all-recent.lua delete mode 100644 .config/nvim/lua/plugins/telescope-floaterm.lua delete mode 100644 .config/nvim/lua/plugins/telescope-import.lua delete mode 100644 .config/nvim/lua/plugins/telescope-lazy.lua delete mode 100644 .config/nvim/lua/plugins/telescope-luasnip.lua delete mode 100644 .config/nvim/lua/plugins/telescope-undotree.lua delete mode 100644 .config/nvim/lua/plugins/telescope-zoxide.lua create mode 100644 .config/nvim/lua/plugins/toggleterm.lua delete mode 100644 .config/nvim/lua/plugins/toggleterm.lua.bak rename .config/nvim/lua/plugins/{wildfire.lua => wildfire.lua.bak} (100%) create mode 100644 .config/nvim/lua/plugins/winbar.lua.bak diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json index ba6c2051..92abcb51 100644 --- a/.config/nvim/lazyvim.json +++ b/.config/nvim/lazyvim.json @@ -10,6 +10,7 @@ "lazyvim.plugins.extras.lang.go", "lazyvim.plugins.extras.lang.java", "lazyvim.plugins.extras.lang.json", + "lazyvim.plugins.extras.lang.markdown", "lazyvim.plugins.extras.lang.omnisharp", "lazyvim.plugins.extras.lang.python", "lazyvim.plugins.extras.lang.rust", diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 752dd797..b2e5dbdf 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -15,56 +15,56 @@ local function map(mode, lhs, rhs, opts) end end -map( - "n", - "xs", - ":FloatermNew --disposable --name=duaroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= dua i", - { desc = "Workspace Size (root dir)" } -) +-- map( +-- "n", +-- "xs", +-- ":FloatermNew --disposable --name=duaroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= dua i", +-- { desc = "Workspace Size (root dir)" } +-- ) +-- +-- map( +-- "n", +-- "xS", +-- ":FloatermNew --disposable --name=duabuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= dua i", +-- { desc = "Workspace Size (cwd)" } +-- ) +-- +-- map( +-- "n", +-- "fx", +-- ":FloatermNew --disposable --name=xplrroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= xplr", +-- { desc = "Xplr (root dir)" } +-- ) +-- +-- map( +-- "n", +-- "fX", +-- ":FloatermNew --disposable --name=xplrbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= xplr", +-- { desc = "Xplr (cwd)" } +-- ) +-- +-- map( +-- "n", +-- "gg", +-- ":FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", +-- { desc = "Lazygit (root dir)" } +-- ) +-- +-- map( +-- "n", +-- "gG", +-- ":FloatermNew --disposable --name=lazygitbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", +-- { desc = "Lazygit (cwd)" } +-- ) +-- +-- map( +-- "n", +-- "fd", +-- ":FloatermNew --disposable --name=lazydocker --opener=edit --titleposition=center --height=0.85 --width=0.85 lazydocker", +-- { desc = "Lazydocker" } +-- ) -map( - "n", - "xS", - ":FloatermNew --disposable --name=duabuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= dua i", - { desc = "Workspace Size (cwd)" } -) - -map( - "n", - "fx", - ":FloatermNew --disposable --name=xplrroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= xplr", - { desc = "Xplr (root dir)" } -) - -map( - "n", - "fX", - ":FloatermNew --disposable --name=xplrbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= xplr", - { desc = "Xplr (cwd)" } -) - -map( - "n", - "gg", - ":FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", - { desc = "Lazygit (root dir)" } -) - -map( - "n", - "gG", - ":FloatermNew --disposable --name=lazygitbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", - { desc = "Lazygit (cwd)" } -) - -map( - "n", - "fd", - ":FloatermNew --disposable --name=lazydocker --opener=edit --titleposition=center --height=0.85 --width=0.85 lazydocker", - { desc = "Lazydocker" } -) - -map("n", "T", ":Telescope floaterm", { desc = "Terminals" }) +-- map("n", "T", ":Telescope floaterm", { desc = "Terminals" }) map("n", "sz", ":Telescope zoxide list", { desc = "Zoxide" }) @@ -78,24 +78,18 @@ map("n", "sI", ":Gitignore", { desc = "Gitignore" }) map("n", "cC", ":ConformInfo", { desc = "Conform Info" }) -map("n", "um", ":MarkdownPreviewToggle", { desc = "Toggle Markdown Preview" }) - -map( - "n", - "ft", - ":FloatermNew --name=termroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", - { desc = "New Terminal (root dir)" } -) -map( - "n", - "fT", - ":FloatermNew --name=termcwd --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", - { desc = "New Terminal (cwd)" } -) -map("n", "", ":FloatermToggle", { desc = "Toggle Terminal" }) -map("t", "", ":FloatermToggle", { desc = "Toggle Terminal", nowait = true }) - -vim.keymap.set("n", "gU", vim.cmd.UndotreeToggle, { noremap = true, silent = true, desc = "Toggle Undotree" }) +-- map( +-- "n", +-- "ft", +-- ":FloatermNew --name=termroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", +-- { desc = "New Terminal (root dir)" } +-- ) +-- map( +-- "n", +-- "fT", +-- ":FloatermNew --name=termcwd --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", +-- { desc = "New Terminal (cwd)" } +-- ) vim.keymap.set("n", "", "PickColor", { noremap = true, silent = true, desc = "Pick Color" }) vim.keymap.set("i", "", "PickColorInsert", { noremap = true, silent = true, desc = "Pick Color" }) @@ -118,35 +112,35 @@ vim.keymap.set( vim.api.nvim_set_keymap( "n", - "cps", + "cPs", "lua require('package-info').show({ force = true })", { silent = true, noremap = true, desc = "Show Package Versions" } ) vim.api.nvim_set_keymap( "n", - "cpu", + "cPu", "lua require('package-info').update()", { silent = true, noremap = true, desc = "Update Package" } ) vim.api.nvim_set_keymap( "n", - "cpr", + "cPr", "lua require('package-info').delete()", { silent = true, noremap = true, desc = "Remove Package" } ) vim.api.nvim_set_keymap( "n", - "cpv", + "cPv", "lua require('package-info').change_version()", { silent = true, noremap = true, desc = "Change Package Version" } ) vim.api.nvim_set_keymap( "n", - "cpn", + "cPn", "lua require('package-info').install()", { silent = true, noremap = true, desc = "Install New Dependency" } ) diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua index 0b6196ca..6a549730 100644 --- a/.config/nvim/lua/config/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -99,6 +99,9 @@ vim.api.nvim_set_var("terminal_color_15", "#B8C0E0") vim.opt.shell = "fish" +vim.o.winwidth = 10 +vim.o.winminwidth = 10 +vim.o.equalalways = false -- vim.opt.shiftwidth = 4 -- vim.opt.tabstop = 4 -- vim.opt.smartindent = true diff --git a/.config/nvim/lua/plugins/actions-preview.lua b/.config/nvim/lua/plugins/actions-preview.lua index 21202260..cb6742dc 100644 --- a/.config/nvim/lua/plugins/actions-preview.lua +++ b/.config/nvim/lua/plugins/actions-preview.lua @@ -2,22 +2,20 @@ return { { "aznhe21/actions-preview.nvim", event = "BufRead", - config = function() - require("actions-preview").setup({ - telescope = { - sorting_strategy = "ascending", - layout_strategy = "vertical", - layout_config = { - width = 0.8, - height = 0.9, - prompt_position = "top", - preview_cutoff = 20, - preview_height = function(_, _, max_lines) - return max_lines - 15 - end, - }, + opts = { + telescope = { + sorting_strategy = "ascending", + layout_strategy = "vertical", + layout_config = { + width = 0.8, + height = 0.9, + prompt_position = "top", + preview_cutoff = 20, + preview_height = function(_, _, max_lines) + return max_lines - 15 + end, }, - }) - end, + }, + }, }, } diff --git a/.config/nvim/lua/plugins/autolist.lua b/.config/nvim/lua/plugins/autolist.lua index b579538e..76582f6e 100644 --- a/.config/nvim/lua/plugins/autolist.lua +++ b/.config/nvim/lua/plugins/autolist.lua @@ -1,38 +1,38 @@ return { - { - "gaoDean/autolist.nvim", - ft = { - "markdown", - "text", - "tex", - "plaintex", - "norg", - }, - config = function() - require("autolist").setup() - - vim.keymap.set("i", "", "AutolistTab") - vim.keymap.set("i", "", "AutolistShiftTab") - -- vim.keymap.set("i", "", "AutolistRecalculate") -- an example of using to indent - vim.keymap.set("i", "", "AutolistNewBullet") - vim.keymap.set("n", "o", "oAutolistNewBullet") - vim.keymap.set("n", "O", "OAutolistNewBulletBefore") - vim.keymap.set("n", "", "AutolistToggleCheckbox") - vim.keymap.set("n", "", "AutolistRecalculate") - - -- cycle list types with dot-repeat - vim.keymap.set("n", "cn", require("autolist").cycle_next_dr, { expr = true }) - vim.keymap.set("n", "cp", require("autolist").cycle_prev_dr, { expr = true }) - - -- if you don't want dot-repeat - -- vim.keymap.set("n", "cn", "AutolistCycleNext") - -- vim.keymap.set("n", "cp", "AutolistCycleNext") - - -- functions to recalculate list on edit - vim.keymap.set("n", ">>", ">>AutolistRecalculate") - vim.keymap.set("n", "<<", "<<AutolistRecalculate") - vim.keymap.set("n", "dd", "ddAutolistRecalculate") - vim.keymap.set("v", "d", "dAutolistRecalculate") - end, + { + "gaoDean/autolist.nvim", + ft = { + "markdown", + "text", + "tex", + "plaintex", + "norg", }, + config = function() + require("autolist").setup() + + vim.keymap.set("i", "", "AutolistTab") + vim.keymap.set("i", "", "AutolistShiftTab") + -- vim.keymap.set("i", "", "AutolistRecalculate") -- an example of using to indent + vim.keymap.set("i", "", "AutolistNewBullet") + vim.keymap.set("n", "o", "oAutolistNewBullet") + vim.keymap.set("n", "O", "OAutolistNewBulletBefore") + vim.keymap.set("n", "", "AutolistToggleCheckbox") + vim.keymap.set("n", "", "AutolistRecalculate") + + -- cycle list types with dot-repeat + vim.keymap.set("n", "].", require("autolist").cycle_next_dr, { desc = "Next List Type", expr = true }) + vim.keymap.set("n", "[.", require("autolist").cycle_prev_dr, { desc = "Prev List Type", expr = true }) + + -- if you don't want dot-repeat + -- vim.keymap.set("n", "cn", "AutolistCycleNext") + -- vim.keymap.set("n", "cp", "AutolistCycleNext") + + -- functions to recalculate list on edit + vim.keymap.set("n", ">>", ">>AutolistRecalculate") + vim.keymap.set("n", "<<", "<<AutolistRecalculate") + vim.keymap.set("n", "dd", "ddAutolistRecalculate") + vim.keymap.set("v", "d", "dAutolistRecalculate") + end, + }, } diff --git a/.config/nvim/lua/plugins/better-escape.lua b/.config/nvim/lua/plugins/better-escape.lua.bak similarity index 100% rename from .config/nvim/lua/plugins/better-escape.lua rename to .config/nvim/lua/plugins/better-escape.lua.bak diff --git a/.config/nvim/lua/plugins/block.lua b/.config/nvim/lua/plugins/block.lua index d5e2b3a2..902583fb 100644 --- a/.config/nvim/lua/plugins/block.lua +++ b/.config/nvim/lua/plugins/block.lua @@ -1,14 +1,12 @@ return { - { - "HampusHauffman/block.nvim", - keys = { { "ub", ":Block", desc = "Toggle Block" } }, - config = function() - require("block").setup({ - percent = 0.9, - depth = 4, - colors = nil, - automatic = false, - }) - end, + { + "HampusHauffman/block.nvim", + keys = { { "ub", "Block", desc = "Toggle Block" } }, + opts = { + percent = 0.9, + depth = 4, + colors = nil, + automatic = false, }, + }, } diff --git a/.config/nvim/lua/plugins/cinnamon.lua b/.config/nvim/lua/plugins/cinnamon.lua index 605ae2d2..d4db64a9 100644 --- a/.config/nvim/lua/plugins/cinnamon.lua +++ b/.config/nvim/lua/plugins/cinnamon.lua @@ -1,14 +1,12 @@ return { - { - "declancm/cinnamon.nvim", - event = "VeryLazy", - config = function() - require("cinnamon").setup({ - default_keymaps = true, - extra_keymaps = true, - extended_keymaps = true, - override_keymaps = true, - }) - end, + { + "declancm/cinnamon.nvim", + event = "VeryLazy", + opts = { + default_keymaps = true, + extra_keymaps = true, + extended_keymaps = true, + override_keymaps = true, }, + }, } diff --git a/.config/nvim/lua/plugins/color-picker.lua b/.config/nvim/lua/plugins/color-picker.lua index d64bc9ed..1193078b 100644 --- a/.config/nvim/lua/plugins/color-picker.lua +++ b/.config/nvim/lua/plugins/color-picker.lua @@ -1,19 +1,17 @@ return { - { - "ziontee113/color-picker.nvim", - cmd = { "PickColor", "PickColorInsert" }, - config = function() - require("color-picker").setup({ - ["icons"] = { "ﱢ", "" }, - ["border"] = "rounded", -- none | single | double | rounded | solid | shadow - ["keymap"] = { -- mapping example: - ["U"] = "ColorPickerSlider5Decrease", - ["O"] = "ColorPickerSlider5Increase", - }, - ["background_highlight_group"] = "Normal", -- default - ["border_highlight_group"] = "FloatBorder", -- default - ["text_highlight_group"] = "Normal", --default - }) - end, + { + "ziontee113/color-picker.nvim", + cmd = { "PickColor", "PickColorInsert" }, + opts = { + ["icons"] = { "ﱢ", "" }, + ["border"] = "rounded", -- none | single | double | rounded | solid | shadow + ["keymap"] = { -- mapping example: + ["U"] = "ColorPickerSlider5Decrease", + ["O"] = "ColorPickerSlider5Increase", + }, + ["background_highlight_group"] = "Normal", -- default + ["border_highlight_group"] = "FloatBorder", -- default + ["text_highlight_group"] = "Normal", --default }, + }, } diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua index 5940d30f..6d7a0169 100644 --- a/.config/nvim/lua/plugins/conform.lua +++ b/.config/nvim/lua/plugins/conform.lua @@ -25,7 +25,7 @@ return { lua = { "stylua" }, fish = { "fish_indent" }, sh = { "shfmt", "shellharden" }, - python = { "isort", "black" }, + python = { "black" }, bash = { "shfmt", "shellharden" }, javascript = { { "prettierd", "prettier", "rustywind" } }, javascriptreact = { { "prettierd", "prettier", "rustywind" } }, @@ -39,6 +39,7 @@ return { css = { { "prettierd", "prettier", "stylelint" } }, scss = { { "prettierd", "prettier", "stylelint" } }, less = { { "prettierd", "prettier", "stylelint" } }, + markdown = { { "prettierd", "prettier" } }, }, -- LazyVim will merge the options you set here with builtin formatters. -- You can also define any custom formatters here. diff --git a/.config/nvim/lua/plugins/dadbod.lua b/.config/nvim/lua/plugins/dadbod.lua index dcebb09c..d40316ae 100644 --- a/.config/nvim/lua/plugins/dadbod.lua +++ b/.config/nvim/lua/plugins/dadbod.lua @@ -1,41 +1,44 @@ return { - { - "tpope/vim-dadbod", - dependencies = { - "kristijanhusak/vim-dadbod-ui", - "kristijanhusak/vim-dadbod-completion", - }, - opts = { - db_competion = function() - require("cmp").setup.buffer({ sources = { { name = "vim-dadbod-completion" } } }) - end, - }, - config = function(_, opts) - vim.g.db_ui_save_location = vim.fn.stdpath("config") .. require("plenary.path").path.sep .. "db_ui" - - vim.api.nvim_create_autocmd("FileType", { - pattern = { - "sql", - }, - command = [[setlocal omnifunc=vim_dadbod_completion#omni]], - }) - - vim.api.nvim_create_autocmd("FileType", { - pattern = { - "sql", - "mysql", - "plsql", - }, - callback = function() - vim.schedule(opts.db_completion) - end, - }) - end, - keys = { - { "Dt", "DBUIToggle", desc = "Toggle UI" }, - { "Df", "DBUIFindBuffer", desc = "Find Buffer" }, - { "Dr", "DBUIRenameBuffer", desc = "Rename Buffer" }, - { "Dq", "DBUILastQueryInfo", desc = "Last Query Info" }, - }, + { + "tpope/vim-dadbod", + dependencies = { + "kristijanhusak/vim-dadbod-ui", + "kristijanhusak/vim-dadbod-completion", + "jsborjesson/vim-uppercase-sql", }, + cmd = { "DBUI", "DBUIToggle" }, + ft = "sql", + opts = { + db_competion = function() + require("cmp").setup.buffer({ sources = { { name = "vim-dadbod-completion" } } }) + end, + }, + config = function(_, opts) + vim.g.db_ui_save_location = vim.fn.stdpath("config") .. require("plenary.path").path.sep .. "db_ui" + + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "sql", + }, + command = [[setlocal omnifunc=vim_dadbod_completion#omni]], + }) + + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "sql", + "mysql", + "plsql", + }, + callback = function() + vim.schedule(opts.db_completion) + end, + }) + end, + keys = { + { "Dt", "DBUIToggle", desc = "Toggle UI" }, + { "Df", "DBUIFindBuffer", desc = "Find Buffer" }, + { "Dr", "DBUIRenameBuffer", desc = "Rename Buffer" }, + { "Dq", "DBUILastQueryInfo", desc = "Last Query Info" }, + }, + }, } diff --git a/.config/nvim/lua/plugins/dashboard.lua b/.config/nvim/lua/plugins/dashboard.lua deleted file mode 100644 index c53bafc0..00000000 --- a/.config/nvim/lua/plugins/dashboard.lua +++ /dev/null @@ -1,75 +0,0 @@ -return { - { - "glepnir/dashboard-nvim", - event = "VimEnter", - opts = function() - local logo = [[ -  - ███████████ █████ ██ - ███████████ █████  - ████████████████ ███████████ ███ ███████ - ████████████████ ████████████ █████ ██████████████ - ██████████████ █████████████ █████ █████ ████ █████ - ██████████████████████████████████ █████ █████ ████ █████ - ██████ ███ █████████████████ ████ █████ █████ ████ ██████ - ]] - -- local logo = [[ - -- ▄ ▄ - -- ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ - -- █ ▄ █▄█ ▄▄▄ █ █▄█ █ █ - -- ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █ - -- ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ - -- █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄ - -- ▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █ - -- █▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █ - -- █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█ - -- ]] - - logo = string.rep("\n", 8) .. logo .. "\n\n" - - local opts = { - theme = "doom", - hide = { - -- this is taken care of by lualine - -- enabling this messes up the actual laststatus setting after loading a file - statusline = false, - }, - config = { - header = vim.split(logo, "\n"), - center = { - { action = "Telescope find_files", desc = " Find file", icon = " ", key = "f" }, - { action = "ene | startinsert", desc = " New file", icon = " ", key = "n" }, - { action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" }, - { action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" }, - { action = "e $MYVIMRC", desc = " Config", icon = " ", key = "c" }, - { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, - { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, - { action = "qa", desc = " Quit", icon = " ", key = "q" }, - }, - footer = function() - local stats = require("lazy").stats() - local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) - return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" } - end, - }, - } - - for _, button in ipairs(opts.config.center) do - button.desc = button.desc .. string.rep(" ", 43 - #button.desc) - end - - -- close Lazy and re-open when the dashboard is ready - if vim.o.filetype == "lazy" then - vim.cmd.close() - vim.api.nvim_create_autocmd("User", { - pattern = "DashboardLoaded", - callback = function() - require("lazy").show() - end, - }) - end - - return opts - end, - }, -} diff --git a/.config/nvim/lua/plugins/diffview.lua b/.config/nvim/lua/plugins/diffview.lua index 276669e1..18cfcfb5 100644 --- a/.config/nvim/lua/plugins/diffview.lua +++ b/.config/nvim/lua/plugins/diffview.lua @@ -1,13 +1,11 @@ return { - { - "sindrets/diffview.nvim", - keys = { - { "gdd", "DiffviewFileHistory", desc = "Diff File History" }, - { "gdo", "DiffviewOpen", desc = "Open Diff View" }, - { "gdc", "DiffviewClose", desc = "Close Diff View" }, - }, - config = function() - require("diffview").setup() - end, + { + "sindrets/diffview.nvim", + keys = { + { "gdd", "DiffviewFileHistory", desc = "Diff File History" }, + { "gdo", "DiffviewOpen", desc = "Open Diff View" }, + { "gdc", "DiffviewClose", desc = "Close Diff View" }, }, + opts = {}, + }, } diff --git a/.config/nvim/lua/plugins/dropbar.lua b/.config/nvim/lua/plugins/dropbar.lua index 15350e3a..aee2d53b 100644 --- a/.config/nvim/lua/plugins/dropbar.lua +++ b/.config/nvim/lua/plugins/dropbar.lua @@ -1,9 +1,13 @@ return { - { - "Bekaboo/dropbar.nvim", - event = "BufRead", - config = function() - require("dropbar").setup() - end, + { + "Bekaboo/dropbar.nvim", + event = "BufRead", + opts = { + sources = { + terminal = { + name = "", + }, + }, }, + }, } diff --git a/.config/nvim/lua/plugins/floaterm.lua b/.config/nvim/lua/plugins/floaterm.lua.bak similarity index 100% rename from .config/nvim/lua/plugins/floaterm.lua rename to .config/nvim/lua/plugins/floaterm.lua.bak diff --git a/.config/nvim/lua/plugins/glance.lua b/.config/nvim/lua/plugins/glance.lua index 4b207036..ed85191f 100644 --- a/.config/nvim/lua/plugins/glance.lua +++ b/.config/nvim/lua/plugins/glance.lua @@ -1,13 +1,11 @@ return { - { - "dnlhc/glance.nvim", - cmd = { "Glance" }, - config = function() - require("glance").setup({ - border = { - enable = true, - }, - }) - end, + { + "dnlhc/glance.nvim", + cmd = { "Glance" }, + opts = { + border = { + enable = true, + }, }, + }, } diff --git a/.config/nvim/lua/plugins/highlight-undo.lua b/.config/nvim/lua/plugins/highlight-undo.lua index 0bb60abd..9e1b1135 100644 --- a/.config/nvim/lua/plugins/highlight-undo.lua +++ b/.config/nvim/lua/plugins/highlight-undo.lua @@ -1,11 +1,9 @@ return { - { - "tzachar/highlight-undo.nvim", - event = "BufReadPost", - config = function() - require("highlight-undo").setup({ - duration = 700, - }) - end, + { + "tzachar/highlight-undo.nvim", + event = "BufReadPost", + opts = { + duration = 700, }, + }, } diff --git a/.config/nvim/lua/plugins/lightbulb.lua b/.config/nvim/lua/plugins/lightbulb.lua index ba781613..40f9e25e 100644 --- a/.config/nvim/lua/plugins/lightbulb.lua +++ b/.config/nvim/lua/plugins/lightbulb.lua @@ -1,23 +1,21 @@ return { - { - "kosayoda/nvim-lightbulb", - event = "BufReadPre", - config = function() - require("nvim-lightbulb").setup({ - sign = { - enabled = false, - priority = 10, - }, - float = { - enabled = true, - text = "💡", - win_opts = {}, - }, - virtual_text = { - enabled = false, - text = "💡", - }, - }) - end, + { + "kosayoda/nvim-lightbulb", + event = "BufReadPre", + opts = { + sign = { + enabled = false, + priority = 10, + }, + float = { + enabled = true, + text = "💡", + win_opts = {}, + }, + virtual_text = { + enabled = false, + text = "💡", + }, }, + }, } diff --git a/.config/nvim/lua/plugins/lint.lua b/.config/nvim/lua/plugins/lint.lua index 31a65e6f..a6134000 100644 --- a/.config/nvim/lua/plugins/lint.lua +++ b/.config/nvim/lua/plugins/lint.lua @@ -9,7 +9,6 @@ return { fish = { "fish" }, markdown = { "markdownlint" }, python = { "pylint" }, - yaml = { "yamllint" }, dockerfile = { "hadolint" }, css = { "stylelint" }, sass = { "stylelint" }, diff --git a/.config/nvim/lua/plugins/lsp-lens.lua.bak b/.config/nvim/lua/plugins/lsp-lens.lua.bak index 1b61c7ae..0c04eb70 100644 --- a/.config/nvim/lua/plugins/lsp-lens.lua.bak +++ b/.config/nvim/lua/plugins/lsp-lens.lua.bak @@ -1,9 +1,7 @@ return { - { - "VidocqH/lsp-lens.nvim", - event = "BufReadPost", - config = function() - require("lsp-lens").setup() - end, - }, + { + "VidocqH/lsp-lens.nvim", + event = "BufReadPost", + opts = {}, + }, } diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index aa5455b9..f5762e57 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -34,6 +34,7 @@ return { lualine_a = { "mode" }, lualine_b = { "branch" }, lualine_c = { + Util.lualine.root_dir(), { "diagnostics", symbols = { @@ -45,9 +46,7 @@ return { }, { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, { - function() - return Util.root.pretty_path() - end, + Util.lualine.pretty_path(), }, -- stylua: ignore { @@ -88,6 +87,16 @@ return { modified = icons.git.modified, removed = icons.git.removed, }, + source = function() + local gitsigns = vim.b.gitsigns_status_dict + if gitsigns then + return { + added = gitsigns.added, + modified = gitsigns.changed, + removed = gitsigns.removed, + } + end + end, }, }, lualine_y = { diff --git a/.config/nvim/lua/plugins/markdown-preview.lua b/.config/nvim/lua/plugins/markdown-preview.lua deleted file mode 100644 index f7e1bbaf..00000000 --- a/.config/nvim/lua/plugins/markdown-preview.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - { - "iamcco/markdown-preview.nvim", - cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, - build = "cd app && yarn install", - init = function() - vim.g.mkdp_filetypes = { "markdown" } - end, - ft = { "markdown" }, - }, -} diff --git a/.config/nvim/lua/plugins/markdown-preview.lua.bak b/.config/nvim/lua/plugins/markdown-preview.lua.bak new file mode 100644 index 00000000..8ad52c68 --- /dev/null +++ b/.config/nvim/lua/plugins/markdown-preview.lua.bak @@ -0,0 +1,11 @@ +return { + { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && npx --yes yarn install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, + }, +} diff --git a/.config/nvim/lua/plugins/neogen.lua b/.config/nvim/lua/plugins/neogen.lua index dc5f69d2..64a6f265 100644 --- a/.config/nvim/lua/plugins/neogen.lua +++ b/.config/nvim/lua/plugins/neogen.lua @@ -1,79 +1,47 @@ return { - { - "danymat/neogen", - dependencies = "nvim-treesitter/nvim-treesitter", - opts = { - snippet_engine = "luasnip", - enabled = true, - languages = { - lua = { - template = { - annotation_convention = "ldoc", - }, - }, - python = { - template = { - annotation_convention = "google_docstrings", - }, - }, - rust = { - template = { - annotation_convention = "rustdoc", - }, - }, - javascript = { - template = { - annotation_convention = "jsdoc", - }, - }, - typescript = { - template = { - annotation_convention = "tsdoc", - }, - }, - typescriptreact = { - template = { - annotation_convention = "tsdoc", - }, - }, - }, - }, - keys = { - { - "ad", - function() - require("neogen").generate() - end, - desc = "Default Annotation", - }, - { - "ac", - function() - require("neogen").generate({ type = "class" }) - end, - desc = "Class", - }, - { - "af", - function() - require("neogen").generate({ type = "func" }) - end, - desc = "Function", - }, - { - "at", - function() - require("neogen").generate({ type = "type" }) - end, - desc = "Type", - }, - { - "aF", - function() - require("neogen").generate({ type = "file" }) - end, - desc = "File", - }, - }, + { + "danymat/neogen", + dependencies = "nvim-treesitter/nvim-treesitter", + opts = { + snippet_engine = "luasnip", + enabled = true, }, + keys = { + { + "ad", + function() + require("neogen").generate() + end, + desc = "Default Annotation", + }, + { + "ac", + function() + require("neogen").generate({ type = "class" }) + end, + desc = "Class", + }, + { + "af", + function() + require("neogen").generate({ type = "func" }) + end, + desc = "Function", + }, + { + "at", + function() + require("neogen").generate({ type = "type" }) + end, + desc = "Type", + }, + { + "aF", + function() + require("neogen").generate({ type = "file" }) + end, + desc = "File", + }, + }, + }, } diff --git a/.config/nvim/lua/plugins/none-ls.lua.bak b/.config/nvim/lua/plugins/none-ls.lua.bak index 667aeef9..9858568b 100644 --- a/.config/nvim/lua/plugins/none-ls.lua.bak +++ b/.config/nvim/lua/plugins/none-ls.lua.bak @@ -1,28 +1,28 @@ return { - { - "nvimtools/none-ls.nvim", - opts = function(_, opts) - local nls = require("null-ls") + { + "nvimtools/none-ls.nvim", + opts = function(_, opts) + local nls = require("null-ls") - opts.sources = opts.sources or {} - vim.list_extend(opts.sources, { - nls.builtins.formatting.beautysh, - nls.builtins.formatting.black, - nls.builtins.formatting.csharpier, - nls.builtins.formatting.rustywind, - nls.builtins.formatting.sqlfmt, - nls.builtins.formatting.rustfmt, - nls.builtins.formatting.fish_indent, - nls.builtins.formatting.taplo, - nls.builtins.diagnostics.fish, - --nls.builtins.diagnostics.cspell, - --nls.builtins.code_actions.cspell, - nls.builtins.hover.dictionary, - nls.builtins.hover.printenv, - --nls.builtins.diagnostics.markuplint, - nls.builtins.diagnostics.markdownlint, - --nls.builtins.diagnostics.codespell, - }) - end, - }, + opts.sources = opts.sources or {} + vim.list_extend(opts.sources, { + nls.builtins.formatting.beautysh, + nls.builtins.formatting.black, + nls.builtins.formatting.csharpier, + nls.builtins.formatting.rustywind, + nls.builtins.formatting.sqlfmt, + nls.builtins.formatting.rustfmt, + nls.builtins.formatting.fish_indent, + nls.builtins.formatting.taplo, + nls.builtins.diagnostics.fish, + --nls.builtins.diagnostics.cspell, + --nls.builtins.code_actions.cspell, + nls.builtins.hover.dictionary, + nls.builtins.hover.printenv, + --nls.builtins.diagnostics.markuplint, + nls.builtins.diagnostics.markdownlint, + --nls.builtins.diagnostics.codespell, + }) + end, + }, } diff --git a/.config/nvim/lua/plugins/numb.lua b/.config/nvim/lua/plugins/numb.lua index 7653171b..74a7d511 100644 --- a/.config/nvim/lua/plugins/numb.lua +++ b/.config/nvim/lua/plugins/numb.lua @@ -1,9 +1,7 @@ return { - { - "nacro90/numb.nvim", - event = "BufRead", - config = function() - require("numb").setup({}) - end, - }, + { + "nacro90/numb.nvim", + event = "BufRead", + opts = {}, + }, } diff --git a/.config/nvim/lua/plugins/package-info.lua b/.config/nvim/lua/plugins/package-info.lua index b97892e5..f7c93d17 100644 --- a/.config/nvim/lua/plugins/package-info.lua +++ b/.config/nvim/lua/plugins/package-info.lua @@ -1,30 +1,28 @@ return { - { - "vuki656/package-info.nvim", - requires = "MunifTanjim/nui.nvim", - event = "BufRead", - config = function() - require("package-info").setup({ - colors = { - up_to_date = "#3C4048", -- Text color for up to date dependency virtual text - outdated = "#d19a66", -- Text color for outdated dependency virtual text - }, - icons = { - enable = true, -- Whether to display icons - style = { - up_to_date = "|  ", -- Icon for up to date dependencies - outdated = "|  ", -- Icon for outdated dependencies - }, - }, - autostart = true, -- Whether to autostart when `package.json` is opened - hide_up_to_date = false, -- It hides up to date versions when displaying virtual text - hide_unstable_versions = false, -- It hides unstable versions from version list e.g next-11.1.3-canary3 - -- Can be `npm`, `yarn`, or `pnpm`. Used for `delete`, `install` etc... - -- The plugin will try to auto-detect the package manager based on - -- `yarn.lock` or `package-lock.json`. If none are found it will use the - -- provided one, if nothing is provided it will use `yarn` - package_manager = "npm", - }) - end, + { + "vuki656/package-info.nvim", + requires = "MunifTanjim/nui.nvim", + event = "BufRead", + opts = { + colors = { + up_to_date = "#3C4048", -- Text color for up to date dependency virtual text + outdated = "#d19a66", -- Text color for outdated dependency virtual text + }, + icons = { + enable = true, -- Whether to display icons + style = { + up_to_date = "|  ", -- Icon for up to date dependencies + outdated = "|  ", -- Icon for outdated dependencies + }, + }, + autostart = true, -- Whether to autostart when `package.json` is opened + hide_up_to_date = false, -- It hides up to date versions when displaying virtual text + hide_unstable_versions = false, -- It hides unstable versions from version list e.g next-11.1.3-canary3 + -- Can be `npm`, `yarn`, or `pnpm`. Used for `delete`, `install` etc... + -- The plugin will try to auto-detect the package manager based on + -- `yarn.lock` or `package-lock.json`. If none are found it will use the + -- provided one, if nothing is provided it will use `yarn` + package_manager = "npm", }, + }, } diff --git a/.config/nvim/lua/plugins/persistent-breakpoints.lua b/.config/nvim/lua/plugins/persistent-breakpoints.lua index 039d099c..b6c5b6a0 100644 --- a/.config/nvim/lua/plugins/persistent-breakpoints.lua +++ b/.config/nvim/lua/plugins/persistent-breakpoints.lua @@ -1,16 +1,14 @@ return { - { - "Weissle/persistent-breakpoints.nvim", - event = "BufReadPost", - keys = { - { "dbd", "PBClearAllBreakpoints", desc = "Delete All Breakpoints" }, - { "dbc", "PBSetConditionalBreakpoint", desc = "Set Conditional Breakpoint" }, - { "dbb", "PBToggleBreakpoint", desc = "Toggle Breakpoint" }, - }, - config = function() - require("persistent-breakpoints").setup({ - load_breakpoints_event = { "BufReadPost" }, - }) - end, + { + "Weissle/persistent-breakpoints.nvim", + event = "BufReadPost", + keys = { + { "dbd", "PBClearAllBreakpoints", desc = "Delete All Breakpoints" }, + { "dbc", "PBSetConditionalBreakpoint", desc = "Set Conditional Breakpoint" }, + { "dbb", "PBToggleBreakpoint", desc = "Toggle Breakpoint" }, }, + opts = { + load_breakpoints_event = { "BufReadPost" }, + }, + }, } diff --git a/.config/nvim/lua/plugins/rainbow-delimeters.lua b/.config/nvim/lua/plugins/rainbow-delimeters.lua index 95685822..67442345 100644 --- a/.config/nvim/lua/plugins/rainbow-delimeters.lua +++ b/.config/nvim/lua/plugins/rainbow-delimeters.lua @@ -1,20 +1,20 @@ return { - { - "HiPhish/rainbow-delimiters.nvim", - event = "VeryLazy", - config = function(_, opts) - require("rainbow-delimiters.setup")(opts) - end, - opts = { - highlight = { - "RainbowDelimiterBlue", - "RainbowDelimiterYellow", - "RainbowDelimiterViolet", - "RainbowDelimiterOrange", - "RainbowDelimiterCyan", - "RainbowDelimiterRed", - "RainbowDelimiterGreen", - }, - }, + { + "HiPhish/rainbow-delimiters.nvim", + event = "VeryLazy", + config = function(_, opts) + require("rainbow-delimiters.setup").setup({ opts }) + end, + opts = { + highlight = { + "RainbowDelimiterBlue", + "RainbowDelimiterYellow", + "RainbowDelimiterViolet", + "RainbowDelimiterOrange", + "RainbowDelimiterCyan", + "RainbowDelimiterRed", + "RainbowDelimiterGreen", + }, }, + }, } diff --git a/.config/nvim/lua/plugins/refactor.lua b/.config/nvim/lua/plugins/refactor.lua index 305c5dca..2cdf1bc9 100644 --- a/.config/nvim/lua/plugins/refactor.lua +++ b/.config/nvim/lua/plugins/refactor.lua @@ -1,13 +1,11 @@ return { - { - "ThePrimeagen/refactoring.nvim", - requires = { - { "nvim-lua/plenary.nvim" }, - { "nvim-treesitter/nvim-treesitter" }, - }, - config = function() - require("refactoring").setup() - end, + { + "ThePrimeagen/refactoring.nvim", + requires = { + { "nvim-lua/plenary.nvim" }, + { "nvim-treesitter/nvim-treesitter" }, + }, + opts = {}, -- stylua: ignore keys = { { "Rs", function() require("telescope").extensions.refactoring.refactors() end, mode = { "v" }, desc = "Refactor Options", }, @@ -22,5 +20,5 @@ return { { "cRx", function() require('refactoring').refactor('Extract Variable') end, mode = {"v"}, desc = "Extract Variable" }, { "cRp", function() require('refactoring').debug.print_var({}) end, mode = {"v"}, desc = "Debug Print Variable" }, }, - }, + }, } diff --git a/.config/nvim/lua/plugins/regex.lua b/.config/nvim/lua/plugins/regex.lua index de1fc61d..d721b79a 100644 --- a/.config/nvim/lua/plugins/regex.lua +++ b/.config/nvim/lua/plugins/regex.lua @@ -1,13 +1,10 @@ return { - { - "bennypowers/nvim-regexplainer", - config = function() - require("regexplainer").setup() - end, - event = "BufReadPost", - requires = { - "nvim-treesitter/nvim-treesitter", - "MunifTanjim/nui.nvim", - }, + { + "bennypowers/nvim-regexplainer", + opts = {}, + event = "BufReadPost", + requires = { + "MunifTanjim/nui.nvim", }, + }, } diff --git a/.config/nvim/lua/plugins/satellite.lua b/.config/nvim/lua/plugins/satellite.lua index 66721da0..dafff122 100644 --- a/.config/nvim/lua/plugins/satellite.lua +++ b/.config/nvim/lua/plugins/satellite.lua @@ -1,65 +1,63 @@ return { - { - "lewis6991/satellite.nvim", - event = "BufRead", - config = function() - require("satellite").setup({ - current_only = false, - winblend = 50, - zindex = 40, - excluded_filetypes = {}, - width = 2, - handlers = { - cursor = { - enable = true, - -- Supports any number of symbols - symbols = { "⎺", "⎻", "⎼", "⎽" }, - -- symbols = { '⎻', '⎼' } - -- Highlights: - -- - SatelliteCursor (default links to NonText - }, - search = { - enable = true, - -- Highlights: - -- - SatelliteSearch (default links to Search) - -- - SatelliteSearchCurrent (default links to SearchCurrent) - }, - diagnostic = { - enable = true, - signs = { "-", "=", "≡" }, - min_severity = vim.diagnostic.severity.HINT, - -- Highlights: - -- - SatelliteDiagnosticError (default links to DiagnosticError) - -- - SatelliteDiagnosticWarn (default links to DiagnosticWarn) - -- - SatelliteDiagnosticInfo (default links to DiagnosticInfo) - -- - SatelliteDiagnosticHint (default links to DiagnosticHint) - }, - gitsigns = { - enable = true, - signs = { -- can only be a single character (multibyte is okay) - add = "│", - change = "│", - delete = "-", - }, - -- Highlights: - -- SatelliteGitSignsAdd (default links to GitSignsAdd) - -- SatelliteGitSignsChange (default links to GitSignsChange) - -- SatelliteGitSignsDelete (default links to GitSignsDelete) - }, - marks = { - enable = true, - show_builtins = false, -- shows the builtin marks like [ ] < > - key = "m", - -- Highlights: - -- SatelliteMark (default links to Normal) - }, - quickfix = { - signs = { "-", "=", "≡" }, - -- Highlights: - -- SatelliteQuickfix (default links to WarningMsg) - }, - }, - }) - end, + { + "lewis6991/satellite.nvim", + event = "BufRead", + opts = { + current_only = true, + winblend = 50, + zindex = 40, + excluded_filetypes = {}, + width = 2, + handlers = { + cursor = { + enable = true, + -- Supports any number of symbols + symbols = { "⎺", "⎻", "⎼", "⎽" }, + -- symbols = { '⎻', '⎼' } + -- Highlights: + -- - SatelliteCursor (default links to NonText + }, + search = { + enable = true, + -- Highlights: + -- - SatelliteSearch (default links to Search) + -- - SatelliteSearchCurrent (default links to SearchCurrent) + }, + diagnostic = { + enable = true, + signs = { "-", "=", "≡" }, + min_severity = vim.diagnostic.severity.HINT, + -- Highlights: + -- - SatelliteDiagnosticError (default links to DiagnosticError) + -- - SatelliteDiagnosticWarn (default links to DiagnosticWarn) + -- - SatelliteDiagnosticInfo (default links to DiagnosticInfo) + -- - SatelliteDiagnosticHint (default links to DiagnosticHint) + }, + gitsigns = { + enable = true, + signs = { -- can only be a single character (multibyte is okay) + add = "│", + change = "│", + delete = "-", + }, + -- Highlights: + -- SatelliteGitSignsAdd (default links to GitSignsAdd) + -- SatelliteGitSignsChange (default links to GitSignsChange) + -- SatelliteGitSignsDelete (default links to GitSignsDelete) + }, + marks = { + enable = true, + show_builtins = false, -- shows the builtin marks like [ ] < > + key = "m", + -- Highlights: + -- SatelliteMark (default links to Normal) + }, + quickfix = { + signs = { "-", "=", "≡" }, + -- Highlights: + -- SatelliteQuickfix (default links to WarningMsg) + }, + }, }, + }, } diff --git a/.config/nvim/lua/plugins/smart-splits.lua.bak b/.config/nvim/lua/plugins/smart-splits.lua.bak index 5071e60a..ce39d53d 100644 --- a/.config/nvim/lua/plugins/smart-splits.lua.bak +++ b/.config/nvim/lua/plugins/smart-splits.lua.bak @@ -1,13 +1,13 @@ return { - { - "mrjones2014/smart-splits.nvim", - build = "./kitty/install-kittens.bash", + { + "mrjones2014/smart-splits.nvim", + build = "./kitty/install-kittens.bash", -- stylua: ignore keys = { - { "", function() require("smart-splits").resize_left() end, desc = "Resize left", mode = "n" }, - { "", function() require("smart-splits").resize_down() end, desc = "Resize down", mode = "n" }, - { "", function() require("smart-splits").resize_up() end, desc = "Resize up", mode = "n" }, - { "", function() require("smart-splits").resize_right() end, desc = "Resize right", mode = "n" }, + { "", function() require("smart-splits").resize_left() end, desc = "Resize left", mode = "n" }, + { "", function() require("smart-splits").resize_down() end, desc = "Resize down", mode = "n" }, + { "", function() require("smart-splits").resize_up() end, desc = "Resize up", mode = "n" }, + { "", function() require("smart-splits").resize_right() end, desc = "Resize right", mode = "n" }, { "", function() require("smart-splits").move_cursor_left() end, desc = "Move cursor left", mode = "n" }, { "", function() require("smart-splits").move_cursor_down() end, desc = "Move cursor down", mode = "n" }, { "", function() require("smart-splits").move_cursor_up() end, desc = "Move cursor up", mode = "n" }, @@ -17,5 +17,5 @@ return { { "", function() require("smart-splits").swap_buf_up() end, desc = "Swap buffer up", mode = "n" }, { "", function() require("smart-splits").swap_buf_right() end, desc = "Swap buffer right", mode = "n" }, }, - }, + }, } diff --git a/.config/nvim/lua/plugins/telescope-all-recent.lua b/.config/nvim/lua/plugins/telescope-all-recent.lua deleted file mode 100644 index 5849837b..00000000 --- a/.config/nvim/lua/plugins/telescope-all-recent.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - { - "prochri/telescope-all-recent.nvim", - event = "VeryLazy", - config = function() - require("telescope-all-recent").setup({ - pickers = { - ["workspaces.nvim#workspaces"] = { - disable = false, - sorting = "frecency", - }, - ["project.nvim#projects"] = { - disable = false, - sorting = "frecency", - }, - ["yanky.nvim#yank_history"] = { - disable = true, - }, - ["zoxide.nvim#zoxide"] = { - disable = true, - }, - }, - }) - end, - }, -} diff --git a/.config/nvim/lua/plugins/telescope-floaterm.lua b/.config/nvim/lua/plugins/telescope-floaterm.lua deleted file mode 100644 index 76ef7542..00000000 --- a/.config/nvim/lua/plugins/telescope-floaterm.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - { - "dawsers/telescope-floaterm.nvim", - opts = {}, - event = "VeryLazy", - config = function(_, opts) - require("telescope").load_extension("floaterm") - end, - }, -} diff --git a/.config/nvim/lua/plugins/telescope-import.lua b/.config/nvim/lua/plugins/telescope-import.lua deleted file mode 100644 index cc3d1328..00000000 --- a/.config/nvim/lua/plugins/telescope-import.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - { - "piersolenski/telescope-import.nvim", - requires = "nvim-telescope/telescope.nvim", - event = "VeryLazy", - config = function(_, opts) - require("telescope").load_extension("import") - end, - }, -} diff --git a/.config/nvim/lua/plugins/telescope-lazy.lua b/.config/nvim/lua/plugins/telescope-lazy.lua deleted file mode 100644 index e20fbacb..00000000 --- a/.config/nvim/lua/plugins/telescope-lazy.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - "tsakirist/telescope-lazy.nvim", - event = "VeryLazy", - config = function() - require("telescope").load_extension("lazy") - end, - }, -} diff --git a/.config/nvim/lua/plugins/telescope-luasnip.lua b/.config/nvim/lua/plugins/telescope-luasnip.lua deleted file mode 100644 index 3aa7f18e..00000000 --- a/.config/nvim/lua/plugins/telescope-luasnip.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - "benfowler/telescope-luasnip.nvim", - event = "VeryLazy", - config = function() - require("telescope").load_extension("luasnip") - end, - }, -} diff --git a/.config/nvim/lua/plugins/telescope-undotree.lua b/.config/nvim/lua/plugins/telescope-undotree.lua deleted file mode 100644 index 1afc6721..00000000 --- a/.config/nvim/lua/plugins/telescope-undotree.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - { - "debugloop/telescope-undo.nvim", - opts = {}, - event = "VeryLazy", - config = function(_, opts) - require("telescope").load_extension("undo") - end, - } -} diff --git a/.config/nvim/lua/plugins/telescope-zoxide.lua b/.config/nvim/lua/plugins/telescope-zoxide.lua deleted file mode 100644 index 04accb06..00000000 --- a/.config/nvim/lua/plugins/telescope-zoxide.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - "jvgrootveld/telescope-zoxide", - event = "VeryLazy", - config = function() - require("telescope").load_extension("zoxide") - end, - }, -} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 8c5db333..f3bd84f6 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -17,6 +17,75 @@ return { end) end, }, + { + "debugloop/telescope-undo.nvim", + opts = {}, + event = "VeryLazy", + config = function(_, opts) + Util.on_load("telescope.nvim", function() + require("telescope").load_extension("undo") + end) + end, + }, + { + "prochri/telescope-all-recent.nvim", + event = "VeryLazy", + opts = { + pickers = { + ["workspaces.nvim#workspaces"] = { + disable = false, + sorting = "frecency", + }, + ["project.nvim#projects"] = { + disable = false, + sorting = "frecency", + }, + ["yanky.nvim#yank_history"] = { + disable = true, + }, + ["zoxide.nvim#zoxide"] = { + disable = true, + }, + }, + }, + }, + { + "benfowler/telescope-luasnip.nvim", + event = "VeryLazy", + config = function() + Util.on_load("telescope.nvim", function() + require("telescope").load_extension("luasnip") + end) + end, + }, + { + "piersolenski/telescope-import.nvim", + requires = "nvim-telescope/telescope.nvim", + event = "VeryLazy", + config = function(_, opts) + Util.on_load("telescope.nvim", function() + require("telescope").load_extension("import") + end) + end, + }, + { + "jvgrootveld/telescope-zoxide", + event = "VeryLazy", + config = function() + Util.on_load("telescope.nvim", function() + require("telescope").load_extension("zoxide") + end) + end, + }, + { + "tsakirist/telescope-lazy.nvim", + event = "VeryLazy", + config = function() + Util.on_load("telescope.nvim", function() + require("telescope").load_extension("lazy") + end) + end, + }, }, keys = { { @@ -97,7 +166,7 @@ return { { "sm", "Telescope marks", desc = "Jump to Mark" }, { "so", "Telescope vim_options", desc = "Options" }, { "sR", "Telescope resume", desc = "Resume" }, - { "gu", "Telescope undo", desc = "Telescope Undotree" }, + { "cu", "Telescope undo", desc = "Undotree" }, { "sw", Util.telescope("grep_string", { word_match = "-w" }), diff --git a/.config/nvim/lua/plugins/toggleterm.lua b/.config/nvim/lua/plugins/toggleterm.lua new file mode 100644 index 00000000..5c13400f --- /dev/null +++ b/.config/nvim/lua/plugins/toggleterm.lua @@ -0,0 +1,38 @@ +return { + { + "akinsho/nvim-toggleterm.lua", + cmd = "ToggleTerm", + opts = { + -- size can be a number or function which is passed the current terminal + size = 20, + open_mapping = [[]], + hide_numbers = true, -- hide the number column in toggleterm buffers + shade_filetypes = {}, + shade_terminals = true, + start_in_insert = true, + insert_mappings = true, -- whether or not the open mapping applies in insert mode + persist_size = true, + persist_mode = true, -- if set to true (default) the previous terminal mode will be remembered + direction = "float", + close_on_exit = false, -- close the terminal window when the process exits + shell = "/bin/fish", -- change the default shell + auto_scroll = true, -- automatically scroll to the bottom on terminal output + -- This field is only relevant if direction is set to 'float' + float_opts = { + -- The border key is *almost* the same as 'nvim_win_open' + -- see :h nvim_win_open for details on borders however + -- the 'curved' border is a custom border type + -- not natively supported but implemented in this plugin. + -- border = 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open + border = "curved", + -- width = , + -- height = , + winblend = 3, + highlights = { border = "Normal", background = "Normal" }, + }, + }, + keys = { + { [[]], "ToggleTerm", mode = "n", desc = "Toggle terminal" }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/toggleterm.lua.bak b/.config/nvim/lua/plugins/toggleterm.lua.bak deleted file mode 100644 index 87c5e65b..00000000 --- a/.config/nvim/lua/plugins/toggleterm.lua.bak +++ /dev/null @@ -1,38 +0,0 @@ -return { - { - "akinsho/nvim-toggleterm.lua", - cmd = "ToggleTerm", - opts = { - -- size can be a number or function which is passed the current terminal - size = 20, - open_mapping = [[]], - hide_numbers = true, -- hide the number column in toggleterm buffers - shade_filetypes = {}, - start_in_insert = true, - insert_mappings = true, -- whether or not the open mapping applies in insert mode - persist_size = true, - persist_mode = true, -- if set to true (default) the previous terminal mode will be remembered - direction = "float", - close_on_exit = true, -- close the terminal window when the process exits - shell = "/bin/fish", -- change the default shell - auto_scroll = true, -- automatically scroll to the bottom on terminal output - -- This field is only relevant if direction is set to 'float' - float_opts = { - -- The border key is *almost* the same as 'nvim_win_open' - -- see :h nvim_win_open for details on borders however - -- the 'curved' border is a custom border type - -- not natively supported but implemented in this plugin. - -- border = 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open - border = "curved", - -- width = , - -- height = , - winblend = 3, - highlights = { border = "Normal", background = "Normal" }, - }, - }, - keys = { - { "", "ToggleTerm", mode = "n", desc = "Toggle terminal" }, - { "", ":FloatermToggle", mode = "t", desc = "Toggle terminal" }, - }, - }, -} diff --git a/.config/nvim/lua/plugins/twilight.lua b/.config/nvim/lua/plugins/twilight.lua index 957511e7..6b0d3dba 100644 --- a/.config/nvim/lua/plugins/twilight.lua +++ b/.config/nvim/lua/plugins/twilight.lua @@ -1,29 +1,29 @@ return { - { - "folke/twilight.nvim", - cmd = "Twilight", - keys = { { "ut", "Twilight", desc = "Toggle Twilight" } }, - opts = { - { - dimming = { - alpha = 0.25, -- amount of dimming - -- we try to get the foreground from the highlight groups or fallback color - color = { "Normal", "#ffffff" }, - term_bg = "#000000", -- if guibg=NONE, this will be used to calculate text color - inactive = false, -- when true, other windows will be fully dimmed (unless they contain the same buffer) - }, - context = 20, -- amount of lines we will try to show around the current line - treesitter = true, -- use treesitter when available for the filetype - -- treesitter is used to automatically expand the visible text, - -- but you can further control the types of nodes that should always be fully expanded - expand = { -- for treesitter, we always try to expand to the top-most ancestor with these types - "function", - "method", - "table", - "if_statement", - }, - exclude = {}, -- exclude these filetypes - }, + { + "folke/twilight.nvim", + cmd = "Twilight", + keys = { { "uZ", "Twilight", desc = "Toggle Twilight" } }, + opts = { + { + dimming = { + alpha = 0.25, -- amount of dimming + -- we try to get the foreground from the highlight groups or fallback color + color = { "Normal", "#ffffff" }, + term_bg = "#000000", -- if guibg=NONE, this will be used to calculate text color + inactive = false, -- when true, other windows will be fully dimmed (unless they contain the same buffer) }, + context = 20, -- amount of lines we will try to show around the current line + treesitter = true, -- use treesitter when available for the filetype + -- treesitter is used to automatically expand the visible text, + -- but you can further control the types of nodes that should always be fully expanded + expand = { -- for treesitter, we always try to expand to the top-most ancestor with these types + "function", + "method", + "table", + "if_statement", + }, + exclude = {}, -- exclude these filetypes + }, }, + }, } diff --git a/.config/nvim/lua/plugins/undotree.lua b/.config/nvim/lua/plugins/undotree.lua index 89c89951..d0b4dd4d 100644 --- a/.config/nvim/lua/plugins/undotree.lua +++ b/.config/nvim/lua/plugins/undotree.lua @@ -1,6 +1,6 @@ return { - { - "mbbill/undotree", - cmd = "UndotreeToggle", - }, + { + "mbbill/undotree", + event = "BufReadPost", + }, } diff --git a/.config/nvim/lua/plugins/urlview.lua b/.config/nvim/lua/plugins/urlview.lua index c4fb6783..e0e926c4 100644 --- a/.config/nvim/lua/plugins/urlview.lua +++ b/.config/nvim/lua/plugins/urlview.lua @@ -1,12 +1,10 @@ return { - { - "axieax/urlview.nvim", - cmd = { "UrlView" }, - keys = { { "su", "UrlView", desc = "Search Urls" } }, - config = function() - require("urlview").setup({ - default_picker = "telescope", - }) - end, + { + "axieax/urlview.nvim", + cmd = { "UrlView" }, + keys = { { "su", "UrlView", desc = "Search Urls" } }, + opts = { + default_picker = "telescope", }, + }, } diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua index a8c92acf..93fa8002 100644 --- a/.config/nvim/lua/plugins/which-key.lua +++ b/.config/nvim/lua/plugins/which-key.lua @@ -23,7 +23,7 @@ return { ["w"] = { name = "+windows" }, ["x"] = { name = "+diagnostics/quickfix" }, ["cc"] = { name = "+compile" }, - ["cp"] = { name = "+packages" }, + ["cP"] = { name = "+packages" }, ["gd"] = { name = "+diff" }, ["gw"] = { name = "+worktrees" }, ["cR"] = { name = "+refactor" }, diff --git a/.config/nvim/lua/plugins/wildfire.lua b/.config/nvim/lua/plugins/wildfire.lua.bak similarity index 100% rename from .config/nvim/lua/plugins/wildfire.lua rename to .config/nvim/lua/plugins/wildfire.lua.bak diff --git a/.config/nvim/lua/plugins/winbar.lua.bak b/.config/nvim/lua/plugins/winbar.lua.bak new file mode 100644 index 00000000..e745eba7 --- /dev/null +++ b/.config/nvim/lua/plugins/winbar.lua.bak @@ -0,0 +1,100 @@ +local M = {} + +M.winbar_filetype_exclude = { + "help", + "startify", + "dashboard", + "packer", + "neogitstatus", + "neo-tree", + "Trouble", + "alpha", + "lir", + "Outline", + "spectre_panel", + "toggleterm", +} + +local get_filename = function() + local filename = vim.fn.expand("%:t") + local extension = vim.fn.expand("%:e") + local f = require("user.functions") + + if not f.isempty(filename) then + local file_icon, file_icon_color = + require("nvim-web-devicons").get_icon_color(filename, extension, { default = true }) + + local hl_group = "FileIconColor" .. extension + + vim.api.nvim_set_hl(0, hl_group, { fg = file_icon_color }) + if f.isempty(file_icon) then + file_icon = "" + file_icon_color = "" + end + + return " " .. "%#" .. hl_group .. "#" .. file_icon .. "%*" .. " " .. "%#LineNr#" .. filename .. "%*" + end +end + +local get_gps = function() + local status_gps_ok, gps = pcall(require, "nvim-gps") + if not status_gps_ok then + return "" + end + + local status_ok, gps_location = pcall(gps.get_location, {}) + if not status_ok then + return "" + end + + if not gps.is_available() or gps_location == "error" then + return "" + end + + if not require("user.functions").isempty(gps_location) then + return require("user.icons").ui.ChevronRight .. " " .. gps_location + else + return "" + end +end + +local excludes = function() + if vim.tbl_contains(M.winbar_filetype_exclude, vim.bo.filetype) then + vim.opt_local.winbar = nil + return true + end + return false +end + +M.get_winbar = function() + if excludes() then + return + end + local f = require("user.functions") + local value = get_filename() + + local gps_added = false + if not f.isempty(value) then + local gps_value = get_gps() + value = value .. " " .. gps_value + if not f.isempty(gps_value) then + gps_added = true + end + end + + if not f.isempty(value) and f.get_buf_option("mod") then + local mod = "%#LineNr#" .. require("user.icons").ui.Circle .. "%*" + if gps_added then + value = value .. " " .. mod + else + value = value .. mod + end + end + + local status_ok, _ = pcall(vim.api.nvim_set_option_value, "winbar", value, { scope = "local" }) + if not status_ok then + return + end +end + +return M diff --git a/.config/nvim/lua/plugins/windows.lua b/.config/nvim/lua/plugins/windows.lua index dd967fa0..367d53cc 100644 --- a/.config/nvim/lua/plugins/windows.lua +++ b/.config/nvim/lua/plugins/windows.lua @@ -1,21 +1,16 @@ return { - { - "anuvyklack/windows.nvim", - event = "WinNew", - dependencies = { - { "anuvyklack/middleclass" }, - { "anuvyklack/animation.nvim" }, - }, - keys = { - { "wv", "WindowsMaximizeVertically", desc = "Vertical Zoom" }, - { "wh", "WindowsMaximizeHorizontally", desc = "Horizontal Zoom" }, - { "we", "WindowsEqualize", desc = "Equalize Zoom" }, - }, - config = function() - vim.o.winwidth = 10 - vim.o.winminwidth = 10 - vim.o.equalalways = false - require("windows").setup() - end, + { + "anuvyklack/windows.nvim", + event = "WinNew", + dependencies = { + { "anuvyklack/middleclass" }, + { "anuvyklack/animation.nvim" }, }, + keys = { + { "wv", "WindowsMaximizeVertically", desc = "Vertical Zoom" }, + { "wh", "WindowsMaximizeHorizontally", desc = "Horizontal Zoom" }, + { "we", "WindowsEqualize", desc = "Equalize Zoom" }, + }, + opts = {}, + }, }