Răsfoiți Sursa

refactor(neovim): `lazy` is dead, long live `vim.pack`!

Joe 4 luni în urmă
părinte
comite
a4e9687b08

+ 752 - 34
.config/nvim/init.lua

@@ -50,42 +50,11 @@ vim.opt.shiftwidth = 4
 -- Leader
 -- Leader
 --
 --
 -- === === === === === === === === === === === === === === === === === === ===
 -- === === === === === === === === === === === === === === === === === === ===
-vim.keymap.set({'n', 'v'}, 's', '<Nop>', { noremap = true, silent = true })
-vim.keymap.set({'n', 'v'}, 'S', '<Nop>', { noremap = true, silent = true })
+vim.keymap.set({ 'n', 'v' }, 's', '<Nop>', { noremap = true, silent = true })
+vim.keymap.set({ 'n', 'v' }, 'S', '<Nop>', { noremap = true, silent = true })
 vim.g.mapleader = 's'
 vim.g.mapleader = 's'
 vim.g.maplocalleader = vim.g.mapleader
 vim.g.maplocalleader = vim.g.mapleader
 
 
--- === === === === === === === === === === === === === === === === === === ===
---
--- Lazy.nvim Configuration
---
--- `lazy.nvim` is a modern plugin manager for Neovim.
---
--- === === === === === === === === === === === === === === === === === === ===
--- Bootstrapping `lazy`, as directed by GitHub docs:
--- https://github.com/folke/lazy.nvim#-installation
-local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
----@diagnostic disable-next-line: undefined-field
-if not vim.loop.fs_stat(lazypath) then
-    vim.fn.system({
-        "git", "clone", "--filter=blob:none",
-        "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath
-    })
-end
-vim.opt.rtp:prepend(lazypath)
--- Add custom plugins to the runtimepath via lazy.
-local custom_runtime_path_root = vim.fn.stdpath("config") .. "/custom"
-local custom_runtime_paths = {}
-for _, filename in pairs(vim.split(vim.fn.glob(custom_runtime_path_root .. "/*"),
-    "\n")) do
-    table.insert(custom_runtime_paths, filename)
-end
--- Load plugins
-require("lazy").setup("plugins", {
-    performance = { rtp = { paths = custom_runtime_paths } },
-    change_detection = { enabled = false },
-    defaults = { lazy = false }
-})
 -- === === === === === === === === === === === === === === === === === === ===
 -- === === === === === === === === === === === === === === === === === === ===
 --
 --
 -- Keymaps
 -- Keymaps
@@ -125,7 +94,7 @@ vim.keymap.set("n", "Syf", function() yank_filename(false, false) end)
 -- Language Servers
 -- Language Servers
 --
 --
 -- === === === === === === === === === === === === === === === === === === ===
 -- === === === === === === === === === === === === === === === === === === ===
--- See also configurations in `lsp/*.lua` and `custom/proj-conf/`
+-- See configurations in `lsp/*.lua`
 vim.lsp.config("*", {
 vim.lsp.config("*", {
     cmd_cwd = vim.fn.expand("~"),
     cmd_cwd = vim.fn.expand("~"),
     root_markers = { ".git" },
     root_markers = { ".git" },
@@ -166,3 +135,752 @@ vim.api.nvim_create_autocmd("LspAttach", {
         end)
         end)
     end
     end
 })
 })
+
+-- === === === === === === === === === === === === === === === === === === ===
+--
+-- Plugins Declarations
+--
+-- === === === === === === === === === === === === === === === === === === ===
+
+vim.pack.add({
+    "https://github.com/hrsh7th/cmp-buffer",
+    "https://github.com/hrsh7th/cmp-calc",
+    "https://github.com/hrsh7th/cmp-cmdline",
+    "https://github.com/hrsh7th/cmp-nvim-lsp",
+    "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help",
+    "https://github.com/hrsh7th/cmp-nvim-lua",
+    "https://github.com/hrsh7th/cmp-path",
+    "https://github.com/hrsh7th/nvim-cmp",
+    "https://github.com/kylechui/nvim-surround",
+    "https://github.com/lewis6991/gitsigns.nvim",
+    "https://github.com/lukas-reineke/virt-column.nvim",
+    "https://github.com/norcalli/nvim-colorizer.lua",
+    "https://github.com/nvim-lua/plenary.nvim",
+    "https://github.com/nvim-telescope/telescope-file-browser.nvim",
+    "https://github.com/nvim-telescope/telescope-ui-select.nvim",
+    "https://github.com/nvim-telescope/telescope.nvim",
+    "https://github.com/nvim-treesitter/nvim-treesitter",
+    "https://github.com/nvim-treesitter/nvim-treesitter-context",
+    "https://github.com/nvim-treesitter/nvim-treesitter-textobjects",
+    "https://github.com/psliwka/vim-dirtytalk",
+    "https://github.com/tpope/vim-commentary"
+})
+
+for _, plugin in ipairs({
+    "like-a-butterfly",
+    "bit-browser",
+    "command-palette",
+    "jonathandarker",
+    "jxdash",
+    "like-a-butterfly",
+    "maj-peg",
+    "pandoctrinated",
+    "proj-conf",
+    "save-formatter",
+    "status-beast",
+    "telescope-shroud",
+}) do
+    vim.opt.runtimepath:prepend(vim.fn.stdpath("config") ..
+        "/custom/" .. plugin)
+end
+
+
+-- === === === === === === === === === === === === === === === === === === ===
+--
+-- Plugins Configurations
+--
+-- === === === === === === === === === === === === === === === === === === ===
+
+local function config_command_palette()
+    local palette = require("command-palette")
+    palette.add({
+        {
+            "Manage project", "", {
+            {
+                "Close project",
+                "Safely close the project and then close the associated tmux pane",
+                function()
+                    vim.api.nvim_create_autocmd({ "VimLeave" }, {
+                        pattern = { "*" },
+                        group = vim.api.nvim_create_augroup(
+                            "tmux_close_group", { clear = true }),
+                        callback = function()
+                            vim.api.nvim_exec("!tmux kill-pane",
+                                false)
+                        end
+                    })
+                    vim.api.nvim_exec("qa", true)
+                end
+            }
+        }
+        }, {
+        "Manage Neovim", "", {
+        {
+            "Update plugins",
+            "",
+            function() vim.pack.update() end
+        }
+    }
+    }
+    })
+    vim.keymap.set("n", "<Leader>P", palette.open)
+    vim.keymap.set("n", "<Leader>p", palette.open_full)
+    vim.keymap.set("n", "<Leader>L", function()
+        palette.open({}, "LSP Finders", {
+            { "Treesitter",         "", ":Telescope treesitter" },
+            { "LSP References",     "", ":Telescope lsp_references" },
+            { "LSP Incoming Calls", "", ":Telescope lsp_incoming_calls" },
+            { "LSP Outgoing Calls", "", ":Telescope lsp_outgoing_calls" },
+            {
+                "LSP Document Symbols", "",
+                ":Telescope lsp_document_symbols"
+            },
+            {
+                "LSP Workspace Symbols", "",
+                ":Telescope lsp_workspace_symbols"
+            }, {
+            "LSP Dynamic Workspace Symbols", "",
+            ":Telescope lsp_workspace_symbols"
+        }, { "Diagnostics",  "", ":Telescope diagnostics" },
+            {
+                "LSP Implementations", "",
+                ":Telescope lsp_implementations"
+            }, { "LSP Definitions", "", ":Telescope lsp_definitions" },
+            {
+                "LSP Type Definitions", "",
+                ":Telescope lsp_type_definitions"
+            }
+        })
+    end)
+end
+
+local function config_bit_browser()
+    local bitbrowser = require("bit-browser")
+    vim.keymap.set("n", "n", bitbrowser.next)
+    vim.keymap.set("n", "N", bitbrowser.prev)
+    for i, v in pairs({ 'e', 'w', 'i', 'd', 's', 'g' }) do
+        vim.keymap.set("n", "<Leader>n" .. v, function()
+            bitbrowser.set_target(i);
+            bitbrowser.next()
+        end)
+        vim.keymap.set("n", "<Leader>N" .. v, function()
+            bitbrowser.set_target(i);
+            bitbrowser.prev()
+        end)
+    end
+end
+
+local function config_save_formatter()
+    local formatter = require("save-formatter")
+    formatter.setup()
+    vim.keymap.set("n", "Sw",
+        function() vim.api.nvim_exec2("write", {}) end)
+    require("command-palette").add({ {
+        "Save Formatter", "Configure automatic formatters", formatter.picker }
+    })
+end
+
+local function config_pandoctrinated()
+    local pandoctrinated = require("pandoctrinated")
+    vim.keymap.set("n", "Sfd", pandoctrinated.pandoc_format_docstring)
+    require("command-palette").add({ {
+        "Pandoctrinated", "Format \"\"\"docstring\"\"\" with `pandoc`",
+        pandoctrinated.pandoc_format_docstring }
+    })
+end
+
+local function config_nvim_cmp()
+    local cmp = require("cmp")
+    local mapping = {
+        ["<Tab>"] = function(fallback)
+            if cmp.visible() then
+                cmp.select_next_item(
+                    { behavior = cmp.SelectBehavior.Select })
+            else
+                fallback()
+            end
+        end,
+        ["<S-Tab>"] = function(fallback)
+            if cmp.visible() then
+                cmp.select_prev_item(
+                    { behavior = cmp.SelectBehavior.Select })
+            else
+                fallback()
+            end
+        end,
+        ["<CR>"] = function(fallback)
+            if cmp.visible() and cmp.get_active_entry() then
+                cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace })
+            else
+                fallback()
+            end
+        end
+    }
+    cmp.setup({
+        snippet = {},
+        mapping = mapping,
+        sources = cmp.config.sources({ { name = "nvim_lsp" } }, {
+            { name = "buffer" }, { name = "nvim_lua" }, { name = "calc" },
+            { name = "nvim_lsp_signature_help" }, { name = "path" }
+        })
+    })
+    cmp.setup.cmdline("/", {
+        mapping = cmp.mapping.preset.cmdline(),
+        sources = { { name = "buffer" } }
+    })
+    cmp.setup.cmdline(":", {
+        mapping = cmp.mapping.preset.cmdline(),
+        sources = cmp.config.sources({ { name = "path" } }, {
+            { name = "cmdline", option = { ignore_cmds = { "Man", "!" } } }
+        })
+    })
+
+    vim.api.nvim_create_autocmd("LspAttach", {
+        callback = function(args)
+            local client = vim.lsp.get_client_by_id(args.data.client_id)
+            if client == nil then return end
+            if client:supports_method('textDocument/completion') then
+                vim.lsp.completion.enable(true, client.id, args.buf,
+                    { autotrigger = false })
+            end
+        end
+    })
+end
+
+local function config_maj_peg()
+    local mp = require("maj-peg")
+    mp.setup()
+    require("command-palette").add({
+        {
+            "maj-peg", "Diagnostic integration for `mypy`", {
+            {
+                "Toggle maj-peg",
+                function()
+                    if mp.status().enabled then
+                        return "Disable `mypy` integration"
+                    else
+                        return "Enable `mypy` integration"
+                    end
+                end,
+                mp.toggle } }
+        }
+    })
+end
+
+local function config_like_a_butterfly()
+    local lab = require('like-a-butterfly')
+    local augroup = vim.api.nvim_create_augroup(
+        'like-a-butterfly', { clear = true })
+    function MakeTerm(shortcut, name, command, flaky)
+        lab.create_term(name, command)
+        vim.keymap.set("n", "<Leader>" .. shortcut, function()
+            if flaky then
+                local flaky_redraw_time = 10
+                vim.api.nvim_create_autocmd({ "BufEnter" },
+                    {
+                        pattern = { "*" },
+                        group = augroup,
+                        once = true,
+                        callback = function()
+                            if (vim.bo.filetype ~= "butterfly") then
+                                return
+                            end
+                            local window = vim.api
+                                .nvim_get_current_win()
+                            vim.cmd(
+                                "setlocal sidescrolloff=" ..
+                                vim.o
+                                .columns)
+                            vim.defer_fn(function()
+                                vim.api.nvim_win_set_height(
+                                    window,
+                                    vim.api
+                                    .nvim_win_get_height(
+                                        window) -
+                                    1)
+                                vim.defer_fn(function()
+                                    vim.api
+                                        .nvim_win_set_height(
+                                            window,
+                                            vim.api
+                                            .nvim_win_get_height(
+                                                window) + 1)
+                                    vim.api.nvim_feedkeys(
+                                        vim.api
+                                        .nvim_replace_termcodes(
+                                            '<C-\\><C-n>^zei',
+                                            true, true, true),
+                                        'i', true)
+                                    vim.schedule(function()
+                                        vim.cmd("redraw!")
+                                    end)
+                                end, flaky_redraw_time)
+                            end, flaky_redraw_time)
+                            vim.cmd("redraw!")
+                        end
+                    })
+            end
+            lab.open_term(name)
+        end)
+    end
+
+    vim.api.nvim_create_autocmd({ "BufEnter" },
+        {
+            pattern = { "*" },
+            group = augroup,
+            callback = function()
+                vim
+                    .schedule(function()
+                        if (vim.bo.filetype ~= "butterfly") then
+                            lab.close_all()
+                        end
+                    end)
+            end
+        })
+    MakeTerm("tt", "Alpha", "zsh")
+    MakeTerm("ts", "Beta", "zsh")
+    MakeTerm("tr", "Gamma", "zsh")
+    MakeTerm("ta", "Delta", "zsh")
+    MakeTerm("tn", "Epsilon", "gemini --model gemini-2.5-pro")
+    MakeTerm("te", "Zeta", "/bin/zsh $DOTFILES_DIR/.scripts/omniscratch.zsh")
+    MakeTerm("ti", "Eta", "lazydocker", true)
+    MakeTerm("to", "Theta", "lazygit", true)
+
+    vim.keymap.set("t", "<C-S-t>", "<C-\\><C-n>")
+    vim.keymap.set("t", "<S-Space>", "<Esc>")
+    local timer_var = "lab_doubletap_timer"
+    vim.keymap.set("t", "<Esc>", function()
+        if vim.b[timer_var] then
+            vim.fn.timer_stop(vim.b[timer_var])
+            vim.b[timer_var] = nil
+            lab.close_all()
+        else
+            vim.b[timer_var] = vim.fn.timer_start(150, function()
+                vim.b[timer_var] = nil
+                vim.api.nvim_chan_send(
+                    vim.b.terminal_job_id,
+                    vim.api.nvim_replace_termcodes("<Esc>", true, false, true))
+            end)
+        end
+    end, { noremap = true, silent = true })
+end
+
+local function config_gitsigns()
+    local gitsigns = require("gitsigns")
+    gitsigns.setup {
+        diff_opts = {
+            internal = true,
+            linematch = 1,
+            algorithm = "minimal"
+        },
+        signcolumn = true,
+        numhl = false,
+        linehl = false,
+        max_file_length = 50000,
+        word_diff = false,
+        auto_attach = true,
+        attach_to_untracked = true
+    }
+
+    local pickers = require("telescope.pickers")
+    local actions = require("telescope.actions")
+    local action_state = require("telescope.actions.state")
+    local finders = require("telescope.finders")
+    local conf = require("telescope.config").values
+    local entry_display = require("telescope.pickers.entry_display")
+    local palette = require("command-palette")
+
+    local open_picker = function(title, command)
+        local displayer = entry_display.create({
+            separator = " ▏",
+            items = {
+                { width = 16 }, { width = 64 }, { width = 24 },
+                { remaining = true }
+            }
+        })
+        local results = vim.split(vim.fn.system(
+                "git log --branches=\\* --pretty='format:%H ||!|| %cr ||!|| %(decorate:prefix=,suffix=,separator= ) ||!|| %an ||!|| %s' --since='last month'"),
+            "\n")
+        pickers.new({}, {
+            prompt_title = title,
+            finder = finders.new_table({
+                results = results,
+                entry_maker = function(entry)
+                    local s = vim.split(entry, "||!||")
+                    return {
+                        value = s[1],
+                        display = function()
+                            return displayer({
+                                { s[2] }, { s[3] }, { s[4] }, { s[5] }
+                            })
+                        end,
+                        ordinal = string.format("%s %s", s[3], s[5])
+                    }
+                end
+            }),
+            sorter = conf.generic_sorter(),
+            attach_mappings = function(prompt_bufnr, _)
+                actions.select_default:replace(function()
+                    actions.close(prompt_bufnr)
+                    local hash = action_state.get_selected_entry().value
+                    if command == "base" then
+                        vim.api.nvim_exec(
+                            ":Gitsigns change_base " .. hash .. " true",
+                            true)
+                    elseif command == "diff" then
+                        vim.api.nvim_exec(":Gitsigns diffthis " .. hash,
+                            true)
+                    end
+                end)
+                return true
+            end
+        }):find()
+    end
+    local open_diff_picker =
+        function()
+            open_picker("Gitsigns Diff", "diff")
+        end
+    local open_base_picker = function()
+        open_picker("Gitsigns Change Base", "base")
+    end
+    vim.keymap.set("n", "Sgd", open_diff_picker)
+    vim.keymap.set("n", "Sgb", open_base_picker)
+    palette.add({
+        {
+            "Gitsigns", "", {
+            {
+                "Diff file",
+                "Open the Gitsigns differ for this file",
+                open_diff_picker
+            },
+            {
+                "Change diff base",
+                "Change base branch for Gitsigns to diff again",
+                open_base_picker
+            }
+        }
+        }
+    })
+end
+
+local function config_proj_conf()
+    require("proj-conf").setup()
+end
+
+local function config_vim_dirtytalk()
+    vim.opt.spelllang = { "en_us", "programming" }
+end
+
+local function config_jonathandarker()
+    vim.cmd.colorscheme("jonathandarker")
+    -- vim.defer_fn(function()
+    --     vim.schedule(function()
+    --         vim.cmd.colorscheme("jonathandarker")
+    --     end)
+    -- end, 100)
+    vim.opt.list = true
+    vim.opt.fillchars = "horiz:-," .. "horizup:-," .. "horizdown:-," ..
+        "vert:¦," .. "verthoriz:¦," ..
+        "vertleft:¦," .. "vertright:¦," ..
+        "eob:⠀"
+    vim.opt.listchars = "extends:›," .. "precedes:‹," ..
+        "tab:\\ ," .. "nbsp:·," .. "trail:·," ..
+        "space:·"
+end
+
+local function config_status_beast()
+    require("status-beast.highlights").setup()
+    require("status-beast").setup()
+    vim.api.nvim_create_autocmd({ "BufEnter" },
+        {
+            group = vim.api.nvim_create_augroup('StatusBeast',
+                { clear = true }),
+            callback =
+                require("status-beast").setup
+        })
+    vim.diagnostic.config({
+        virtual_lines = {
+            current_line = true,
+            format = function(d)
+                return "[" .. d.source .. "] " .. d.message
+            end
+        },
+        float = false,
+        virtual_text = false,
+        update_in_insert = true
+    })
+    local palette = require("command-palette")
+    palette.add({
+        {
+            "Status Beast", "Options for status bars and columns", { {
+            "Toggle Relnum", "Toggle relative line numbers on/off",
+            ":setl rnu!" } } }
+    })
+end
+
+local function config_jxdash()
+    require("jxdash").setup()
+end
+
+local function config_colorizer()
+    require("colorizer").setup({ "*" }, {
+        mode = "background",
+        RGB = true,
+        RRGGBB = true,
+        RRGGBBAA = true,
+        names = false,
+        rgb_fn = false,
+        hsl_fn = false,
+        css = false,
+        css_fn = false
+    })
+end
+
+local function config_virt_column()
+    vim.opt.colorcolumn = tostring(80 + 1)
+    local cc_group = vim.api.nvim_create_augroup("colorcolumn",
+        { clear = true })
+    local filetype_colorcolumn_map = {
+        python = 88,
+        kotlin = 100,
+        julia = 92
+    }
+    vim.api.nvim_create_autocmd({ "FileType" }, {
+        pattern = { "*" },
+        group = cc_group,
+        callback = function(event)
+            local filetype = vim.bo[event.buf].filetype
+            local colorcolumn = filetype_colorcolumn_map[filetype]
+            if colorcolumn == nil then
+                colorcolumn = 80
+            end
+            for _, w in pairs(vim.api.nvim_list_wins()) do
+                if vim.api.nvim_win_get_buf(w) == event.buf then
+                    vim.wo[w].colorcolumn = tostring(colorcolumn + 1)
+                end
+            end
+        end
+    })
+    require("virt-column").setup({ char = "⁚" })
+end
+
+local function config_telescope()
+    local builtin = require("telescope.builtin")
+    require("telescope").setup({
+        extensions = {
+            ["ui-select"] = { require("telescope.themes").get_dropdown() }
+        },
+        defaults = {
+            ["borderchars"] = {
+                "-", "¦", "-", "¦", "⌌", "⌍", "⌏", "⌎"
+            },
+            layout_strategy = "horizontal",
+            layout_config = {
+                horizontal = { width = { padding = 0 }, height = 0.99 }
+            },
+            cache_picker = {
+                num_pickers = 100,
+                limit_entries = 100,
+                ignore_empty_prompt = true
+            }
+        },
+        pickers = {
+            live_grep = {
+                additional_args = function(_)
+                    return { "--hidden", "--glob=!**/.git/*" }
+                end
+            }
+        }
+    })
+    vim.keymap.set("n", "<Leader>f", function()
+        require("telescope").extensions.file_browser.file_browser({
+            select_buffer = true,
+            grouped = true,
+            no_ignore = true,
+            hidden = true,
+            respect_gitignore = false,
+            path = vim.fn.expand("%:p:h")
+        })
+    end, {})
+    vim.keymap.set("n", "<Leader>s", builtin.resume)
+    vim.keymap.set("n", "<Leader>S", builtin.pickers)
+    vim.keymap.set("n", "<Leader>T", builtin.treesitter)
+    vim.keymap.set("n", "<Leader>a", builtin.find_files)
+    vim.keymap.set("n", "<Leader>g", builtin.git_files)
+    vim.keymap.set("n", "<Leader>G", builtin.git_status)
+    vim.keymap.set("n", "<Leader>b", builtin.buffers)
+    vim.keymap.set("n", "<Leader>j", builtin.jumplist)
+    vim.keymap.set("n", "<Leader>w", builtin.grep_string)
+    vim.keymap.set("n", "<Leader>ld", builtin.lsp_definitions)
+    vim.keymap.set("n", "<Leader>lt", builtin.lsp_type_definitions)
+    vim.keymap.set("n", "<Leader>lr", builtin.lsp_references)
+    vim.keymap.set("n", "<Leader>li", builtin.lsp_implementations)
+    vim.keymap.set("n", "<Leader>ls", builtin.lsp_document_symbols)
+    vim.keymap.set("n", "<Leader>lS", builtin.lsp_workspace_symbols)
+    require("telescope").load_extension("ui-select")
+    require("telescope").load_extension("file_browser")
+end
+
+local function config_telescope_file_browser()
+    require("telescope").setup({
+        extensions = {
+            file_browser = {
+                respect_gitignore = false,
+                hidden = { file_browser = true, folder_browser = true },
+                hijack_netrw = true,
+                display_stat = { date = false, size = true, mode = false },
+                mappings = {}
+            }
+        }
+    })
+    require("telescope").load_extension("file_browser")
+end
+
+local function config_telescope_shroud()
+    local shroud = require("telescope-shroud")
+    local palette = require("command-palette")
+    palette.add({
+        {
+            "Telescope Shroud", "Telescope `grep` filter management", { {
+            "Populate", "Reload the list of filter options", shroud.populate
+        }, {
+            "Clear default", "Reset the default filters", function()
+            shroud.set_default({})
+        end
+        }, {
+            "Set default", "Set the default filters", shroud.set_default }, {
+            "Open default", "Set the default filters", shroud.open_default }, {
+            "Open narrow", "Set the default filters", shroud.open_narrow } } }
+    })
+    vim.keymap.set("n", "<Leader>i", shroud.open_default)
+    vim.keymap.set("n", "<Leader>I", shroud.open_narrow)
+end
+
+local function config_nvim_surround()
+    require("nvim-surround").setup({})
+end
+
+local function config_nvim_treesitter_textobjects()
+    require("nvim-treesitter.configs").setup({
+        textobjects = {
+            select = {
+                enable = true,
+                lookahead = true,
+                keymaps = {
+                    ["af"] = "@function.outer",
+                    ["if"] = "@function.inner",
+                    ["ac"] = "@class.outer",
+                    ["ic"] = "@class.inner",
+                    ["ap"] = "@parameter.outer",
+                    ["ip"] = "@parameter.inner",
+                    ["aa"] = "@parameter.outer",
+                    ["ia"] = "@parameter.inner",
+                    ["al"] = "@loop.outer",
+                    ["il"] = "@loop.inner",
+                    ["at"] = "@attribute.outer",
+                    ["it"] = "@attribute.inner",
+                    ["a="] = "@assignment.outer",
+                    ["i="] = "@assignment.inner",
+                    ["ab"] = "@block.outer",
+                    ["ib"] = "@block.inner"
+                },
+                include_surrounding_whitespace = true
+            },
+            swap = {
+                enable = true,
+                swap_next = {
+                    ["csf"] = "@function.inner",
+                    ["csc"] = "@class.inner",
+                    ["csp"] = "@parameter.inner",
+                    ["csa"] = "@parameter.inner",
+                    ["csl"] = "@loop.inner",
+                    ["cst"] = "@attribute.inner",
+                    ["cs="] = "@assignment.inner",
+                    ["csb"] = "@block.inner"
+                },
+                swap_previous = {
+                    ["cSf"] = "@function.inner",
+                    ["cSc"] = "@class.inner",
+                    ["cSp"] = "@parameter.inner",
+                    ["cSa"] = "@parameter.inner",
+                    ["cSl"] = "@loop.inner",
+                    ["cSt"] = "@attribute.inner",
+                    ["cS="] = "@assignment.inner",
+                    ["cSb"] = "@block.inner"
+                }
+            }
+        }
+    })
+end
+
+local function config_nvim_treesitter()
+    local api = require("nvim-treesitter.configs")
+    api.setup({
+        ensure_installed = "all",
+        sync_install = false,
+        auto_install = true,
+        ignore_install = { "ipkg" },
+        highlight = {
+            enable = true,
+            additional_vim_regex_highlighting = false
+        }
+    })
+    vim.opt.foldmethod = "expr"
+    vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
+
+    vim.api.nvim_create_autocmd("LspAttach", {
+        callback = function(args)
+            local client = vim.lsp.get_client_by_id(args.data.client_id)
+            if vim.treesitter ~= nil and client ~= nil and
+                type(vim.treesitter.highlighter.active[args.buf]) ~= "nil" then
+                client.server_capabilities.semanticTokensProvider = nil
+            end
+        end
+    })
+end
+
+local function config_nvim_treesitter_context()
+    require("treesitter-context").setup({
+        enable = true,
+        max_lines = 5,
+        min_window_height = 0,
+        line_numbers = true,
+        multiline_threshold = 20,
+        trim_scope = "outer",
+        mode = "cursor",
+        zindex = 20,
+        on_attach = nil
+    })
+    vim.api.nvim_set_hl(0, "TreesitterContextSeparator",
+        { link = "WinSeparator" })
+    vim.keymap.set("n", "<Leader>c", function()
+        require("treesitter-context").go_to_context(vim.v.count1)
+    end, { silent = true })
+end
+
+local setup_plugins = function()
+    config_nvim_treesitter()
+    config_vim_dirtytalk()
+    config_colorizer()
+    config_virt_column()
+    config_nvim_surround()
+    config_like_a_butterfly()
+    config_nvim_cmp()
+    config_telescope()
+    config_jxdash()
+    config_nvim_treesitter_textobjects()
+    config_nvim_treesitter_context()
+    config_telescope_file_browser()
+    config_command_palette()
+    config_maj_peg()
+    config_bit_browser()
+    config_save_formatter()
+    config_pandoctrinated()
+    config_gitsigns()
+    config_telescope_shroud()
+    config_proj_conf()
+    config_status_beast()
+    config_jonathandarker()
+end
+
+setup_plugins()

+ 0 - 109
.config/nvim/lua/plugins/command-palette.lua

@@ -1,109 +0,0 @@
-return {
-    {
-        dir = vim.fn.stdpath("config") .. "/custom/command-palette",
-        name = "command-palette",
-        dependencies = { "nvim-telescope/telescope.nvim" },
-        enabled = true,
-        config = function(_, _)
-            local palette = require("command-palette")
-            palette.add({
-                {
-                    "Manage project", "", {
-                    {
-                        "Close project",
-                        "Safely close the project and then close the associated tmux pane",
-                        function()
-                            vim.api.nvim_create_autocmd({ "VimLeave" }, {
-                                pattern = { "*" },
-                                group = vim.api.nvim_create_augroup(
-                                    "tmux_close_group", { clear = true }),
-                                callback = function()
-                                    vim.api.nvim_exec("!tmux kill-pane",
-                                        false)
-                                end
-                            })
-                            vim.api.nvim_exec("qa", true)
-                        end
-                    }
-                }
-                }
-            })
-            vim.keymap.set("n", "<Leader>P", palette.open)
-            vim.keymap.set("n", "<Leader>p", palette.open_full)
-            vim.keymap.set("n", "<Leader>L", function()
-                palette.open({}, "LSP Finders", {
-                    { "Treesitter",         "", ":Telescope treesitter" },
-                    { "LSP References",     "", ":Telescope lsp_references" },
-                    { "LSP Incoming Calls", "", ":Telescope lsp_incoming_calls" },
-                    { "LSP Outgoing Calls", "", ":Telescope lsp_outgoing_calls" },
-                    {
-                        "LSP Document Symbols", "",
-                        ":Telescope lsp_document_symbols"
-                    },
-                    {
-                        "LSP Workspace Symbols", "",
-                        ":Telescope lsp_workspace_symbols"
-                    }, {
-                    "LSP Dynamic Workspace Symbols", "",
-                    ":Telescope lsp_workspace_symbols"
-                }, { "Diagnostics",  "", ":Telescope diagnostics" },
-                    {
-                        "LSP Implementations", "",
-                        ":Telescope lsp_implementations"
-                    }, { "LSP Definitions", "", ":Telescope lsp_definitions" },
-                    {
-                        "LSP Type Definitions", "",
-                        ":Telescope lsp_type_definitions"
-                    }
-                })
-            end)
-        end
-    }, {
-    dir = vim.fn.stdpath("config") .. "/custom/bit-browser/",
-    name = "bit-browser",
-    enabled = true,
-    dependencies = { "command-palette" },
-    config = function(_, _)
-        local bitbrowser = require("bit-browser")
-        vim.keymap.set("n", "n", bitbrowser.next)
-        vim.keymap.set("n", "N", bitbrowser.prev)
-        for i, v in pairs({ 'e', 'w', 'i', 'd', 's', 'g' }) do
-            vim.keymap.set("n", "<Leader>n" .. v, function()
-                bitbrowser.set_target(i);
-                bitbrowser.next()
-            end)
-            vim.keymap.set("n", "<Leader>N" .. v, function()
-                bitbrowser.set_target(i);
-                bitbrowser.prev()
-            end)
-        end
-    end
-}, {
-    dir = vim.fn.stdpath("config") .. "/custom/save-formatter",
-    name = "save-formatter",
-    dependencies = { "nvim-telescope/telescope.nvim", "command-palette" },
-    enabled = true,
-    config = function(_, _)
-        local formatter = require("save-formatter")
-        formatter.setup()
-        vim.keymap.set("n", "Sw",
-            function() vim.api.nvim_exec2("write", {}) end)
-        require("command-palette").add({ {
-            "Save Formatter", "Configure automatic formatters", formatter.picker }
-        })
-    end
-}, {
-    dir = vim.fn.stdpath("config") .. "/custom/pandoctrinated",
-    name = "pandoctrinated",
-    dependencies = { "command-palette" },
-    enabled = true,
-    config = function(_, _)
-        local pandoctrinated = require("pandoctrinated")
-        vim.keymap.set("n", "Sfd", pandoctrinated.pandoc_format_docstring)
-        require("command-palette").add({ {
-            "Pandoctrinated", "Format \"\"\"docstring\"\"\" with `pandoc`",
-            pandoctrinated.pandoc_format_docstring }
-        })
-    end
-}
-}

+ 0 - 67
.config/nvim/lua/plugins/completion.lua

@@ -1,67 +0,0 @@
-return {
-    "hrsh7th/nvim-cmp",
-    dependencies = {
-        "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path",
-        "hrsh7th/cmp-cmdline", "hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-calc",
-        "hrsh7th/cmp-nvim-lsp-signature-help"
-    },
-    enabled = true,
-    lazy = false,
-    config = function(_, _)
-        local cmp = require("cmp")
-        local mapping = {
-            ["<Tab>"] = function(fallback)
-                if cmp.visible() then
-                    cmp.select_next_item(
-                        { behavior = cmp.SelectBehavior.Select })
-                else
-                    fallback()
-                end
-            end,
-            ["<S-Tab>"] = function(fallback)
-                if cmp.visible() then
-                    cmp.select_prev_item(
-                        { behavior = cmp.SelectBehavior.Select })
-                else
-                    fallback()
-                end
-            end,
-            ["<CR>"] = function(fallback)
-                if cmp.visible() and cmp.get_active_entry() then
-                    cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace })
-                else
-                    fallback()
-                end
-            end
-        }
-        cmp.setup({
-            snippet = {},
-            mapping = mapping,
-            sources = cmp.config.sources({ { name = "nvim_lsp" } }, {
-                { name = "buffer" }, { name = "nvim_lua" }, { name = "calc" },
-                { name = "nvim_lsp_signature_help" }, { name = "path" }
-            })
-        })
-        cmp.setup.cmdline("/", {
-            mapping = cmp.mapping.preset.cmdline(),
-            sources = { { name = "buffer" } }
-        })
-        cmp.setup.cmdline(":", {
-            mapping = cmp.mapping.preset.cmdline(),
-            sources = cmp.config.sources({ { name = "path" } }, {
-                { name = "cmdline", option = { ignore_cmds = { "Man", "!" } } }
-            })
-        })
-
-        vim.api.nvim_create_autocmd("LspAttach", {
-            callback = function(args)
-                local client = vim.lsp.get_client_by_id(args.data.client_id)
-                if client == nil then return end
-                if client:supports_method('textDocument/completion') then
-                    vim.lsp.completion.enable(true, client.id, args.buf,
-                        { autotrigger = false })
-                end
-            end
-        })
-    end
-}

+ 0 - 28
.config/nvim/lua/plugins/diagnostic.lua

@@ -1,28 +0,0 @@
-return {
-    {
-        dir = vim.fn.stdpath("config") .. "/custom/maj-peg",
-        dependencies = { "nvim-lua/plenary.nvim" },
-        name = "maj-peg",
-        lazy = false,
-        enabled = true,
-        config = function()
-            local mp = require("maj-peg")
-            mp.setup()
-            require("command-palette").add({
-                {
-                    "maj-peg", "Diagnostic integration for `mypy`", {
-                    {
-                        "Toggle maj-peg",
-                        function()
-                            if mp.status().enabled then
-                                return "Disable `mypy` integration"
-                            else
-                                return "Enable `mypy` integration"
-                            end
-                        end,
-                        mp.toggle } }
-                }
-            })
-        end
-    }
-}

+ 0 - 112
.config/nvim/lua/plugins/floatingterminal.lua

@@ -1,112 +0,0 @@
-return {
-    {
-        dir = vim.fn.stdpath("config") .. "/custom/like-a-butterfly",
-        name = "like-a-butterfly",
-        enabled = true,
-        lazy = false,
-        config = function()
-            local lab = require('like-a-butterfly')
-            local augroup = vim.api.nvim_create_augroup(
-                'like-a-butterfly', { clear = true })
-            -- Configure eight homerow terminals
-            -- Some TUIs are "flaky" (*cough* lazygit *cough*), and don't redraw
-            -- properly after being hidden. We try to fix this by aggressively
-            -- resizing and redrawing flaky programs' windows.
-            function MakeTerm(shortcut, name, command, flaky)
-                lab.create_term(name, command)
-                vim.keymap.set("n", "<Leader>"..shortcut, function()
-                    if flaky then
-                        local flaky_redraw_time = 10
-                        vim.api.nvim_create_autocmd({ "BufEnter" },
-                            {
-                                pattern = { "*" },
-                                group = augroup,
-                                once = true,
-                                callback = function()
-                                    if (vim.bo.filetype ~= "butterfly") then
-                                        return
-                                    end
-                                    local window = vim.api
-                                        .nvim_get_current_win()
-                                    vim.cmd(
-                                        "setlocal sidescrolloff=" ..
-                                        vim.o
-                                        .columns)
-                                    vim.defer_fn(function()
-                                        vim.api.nvim_win_set_height(
-                                            window,
-                                            vim.api
-                                            .nvim_win_get_height(
-                                                window) -
-                                            1)
-                                        vim.defer_fn(function()
-                                            vim.api
-                                                .nvim_win_set_height(
-                                                    window,
-                                                    vim.api
-                                                    .nvim_win_get_height(
-                                                        window) + 1)
-                                            vim.api.nvim_feedkeys(
-                                                vim.api
-                                                .nvim_replace_termcodes(
-                                                    '<C-\\><C-n>^zei',
-                                                    true, true, true),
-                                                'i', true)
-                                            vim.schedule(function()
-                                                vim.cmd("redraw!")
-                                            end)
-                                        end, flaky_redraw_time)
-                                    end, flaky_redraw_time)
-                                    vim.cmd("redraw!")
-                                end
-                            })
-                    end
-                    lab.open_term(name)
-                end)
-            end
-
-            vim.api.nvim_create_autocmd({ "BufEnter" },
-                {
-                    pattern = { "*" },
-                    group = augroup,
-                    callback = function()
-                        vim
-                            .schedule(function()
-                                if (vim.bo.filetype ~= "butterfly") then
-                                    lab.close_all()
-                                end
-                            end)
-                    end
-                })
-            MakeTerm("tt", "Alpha", "zsh")
-            MakeTerm("ts", "Beta", "zsh")
-            MakeTerm("tr", "Gamma", "zsh")
-            MakeTerm("ta", "Delta", "zsh")
-            MakeTerm("tn", "Epsilon", "gemini --model gemini-2.5-pro")
-            MakeTerm("te", "Zeta", "/bin/zsh $DOTFILES_DIR/.scripts/omniscratch.zsh")
-            MakeTerm("ti", "Eta", "lazydocker", true)
-            MakeTerm("to", "Theta", "lazygit", true)
-
-            -- Keymaps
-            vim.keymap.set("t", "<C-S-t>", "<C-\\><C-n>")
-            vim.keymap.set("t", "<S-Space>", "<Esc>")
-            -- Double-tapping <Esc> within 150ms closes floating terminals;
-            -- implemented as a timer to minimize normal <ESC> interruptions
-            local timer_var = "lab_doubletap_timer"
-            vim.keymap.set("t", "<Esc>", function()
-              if vim.b[timer_var] then
-                vim.fn.timer_stop(vim.b[timer_var])
-                vim.b[timer_var] = nil
-                lab.close_all()
-              else
-                vim.b[timer_var] = vim.fn.timer_start(150, function()
-                  vim.b[timer_var] = nil
-                    vim.api.nvim_chan_send(
-                        vim.b.terminal_job_id,
-                        vim.api.nvim_replace_termcodes("<Esc>", true, false, true))
-                end)
-              end
-            end, { noremap = true, silent = true})
-        end
-    }
-}

+ 0 - 105
.config/nvim/lua/plugins/git.lua

@@ -1,105 +0,0 @@
-return {
-    {
-        "lewis6991/gitsigns.nvim",
-        enabled = true,
-        lazy = false,
-        dependencies = { "nvim-telescope/telescope.nvim", { "command-palette" } },
-        config = function(_, opts)
-            local gitsigns = require("gitsigns")
-            gitsigns.setup {
-                diff_opts = {
-                    internal = true,
-                    linematch = 1,
-                    algorithm = "minimal"
-                },
-                signcolumn = true,
-                numhl = false,
-                linehl = false,
-                max_file_length = 50000,
-                word_diff = false,
-                auto_attach = true,
-                attach_to_untracked = true
-            }
-
-            local pickers = require("telescope.pickers")
-            local actions = require("telescope.actions")
-            local action_state = require("telescope.actions.state")
-            local finders = require("telescope.finders")
-            local conf = require("telescope.config").values
-            local entry_display = require("telescope.pickers.entry_display")
-            local palette = require("command-palette")
-
-            local open_picker = function(title, command)
-                local displayer = entry_display.create({
-                    separator = " ▏",
-                    items = {
-                        { width = 16 }, { width = 64 }, { width = 24 },
-                        { remaining = true }
-                    }
-                })
-                local results = vim.split(vim.fn.system(
-                        "git log --branches=\\* --pretty='format:%H ||!|| %cr ||!|| %(decorate:prefix=,suffix=,separator= ) ||!|| %an ||!|| %s' --since='last month'"),
-                    "\n")
-                pickers.new(opts, {
-                    prompt_title = title,
-                    finder = finders.new_table({
-                        results = results,
-                        entry_maker = function(entry)
-                            local s = vim.split(entry, "||!||")
-                            return {
-                                value = s[1],
-                                display = function()
-                                    return displayer({
-                                        { s[2] }, { s[3] }, { s[4] }, { s[5] }
-                                    })
-                                end,
-                                ordinal = string.format("%s %s", s[3], s[5])
-                            }
-                        end
-                    }),
-                    sorter = conf.generic_sorter(),
-                    attach_mappings = function(prompt_bufnr, _)
-                        actions.select_default:replace(function()
-                            actions.close(prompt_bufnr)
-                            local hash = action_state.get_selected_entry().value
-                            if command == "base" then
-                                vim.api.nvim_exec(
-                                    ":Gitsigns change_base " .. hash .. " true",
-                                    true)
-                            elseif command == "diff" then
-                                vim.api.nvim_exec(":Gitsigns diffthis " .. hash,
-                                    true)
-                            end
-                        end)
-                        return true
-                    end
-                }):find()
-            end
-            local open_diff_picker =
-                function()
-                    open_picker("Gitsigns Diff", "diff")
-                end
-            local open_base_picker = function()
-                open_picker("Gitsigns Change Base", "base")
-            end
-            vim.keymap.set("n", "Sgd", open_diff_picker)
-            vim.keymap.set("n", "Sgb", open_base_picker)
-            palette.add({
-                {
-                    "Gitsigns", "", {
-                    {
-                        "Diff file",
-                        "Open the Gitsigns differ for this file",
-                        open_diff_picker
-                    },
-                    {
-                        "Change diff base",
-                        "Change base branch for Gitsigns to diff again",
-                        open_base_picker
-                    }
-                }
-                }
-            })
-        end
-    }
-}

+ 0 - 10
.config/nvim/lua/plugins/proj-conf.lua

@@ -1,10 +0,0 @@
-return {
-    dir = vim.fn.stdpath("config") .. "/custom/proj-conf",
-    name = "proj-conf",
-    dependencies = {
-        "telescope-shroud"
-    },
-    enabled = true,
-    lazy = false,
-    config = function(_, _) require("proj-conf").setup() end
-}

+ 0 - 5
.config/nvim/lua/plugins/spell.lua

@@ -1,5 +0,0 @@
-return {
-    "psliwka/vim-dirtytalk",
-    build = ":DirtytalkUpdate",
-    config = function() vim.opt.spelllang = { "en_us", "programming" } end
-}

+ 0 - 116
.config/nvim/lua/plugins/style.lua

@@ -1,116 +0,0 @@
-return {
-    {
-        dir = vim.fn.stdpath("config") .. "/custom/jonathandarker",
-        name = "jonathandarker",
-        lazy = false,
-        enabled = true,
-        config = function()
-            vim.cmd.colorscheme("jonathandarker")
-            vim.defer_fn(function()
-                vim.schedule(function()
-                    vim.cmd.colorscheme("jonathandarker")
-                end)
-            end, 100)
-            vim.opt.list = true
-            vim.opt.fillchars = "horiz:-," .. "horizup:-," .. "horizdown:-," ..
-                "vert:¦," .. "verthoriz:¦," ..
-                "vertleft:¦," .. "vertright:¦," ..
-                "eob:⠀"
-            vim.opt.listchars = "extends:›," .. "precedes:‹," ..
-                "tab:\\ ," .. "nbsp:·," .. "trail:·," ..
-                "space:·"
-        end
-    }, {
-    dir = vim.fn.stdpath("config") .. "/custom/status-beast",
-    name = "status-beast",
-    dependencies = { "lewis6991/gitsigns.nvim", "bit-browser", "command-palette" },
-    enabled = true,
-    lazy = false,
-    config = function()
-        require("status-beast.highlights").setup()
-        require("status-beast").setup()
-        vim.api.nvim_create_autocmd({ "BufEnter" },
-            {
-                group = vim.api.nvim_create_augroup('StatusBeast',
-                    { clear = true }),
-                callback =
-                    require("status-beast").setup
-            })
-        vim.diagnostic.config({
-            virtual_lines = {
-                current_line = true,
-                format = function(d)
-                    return "[" .. d.source .. "] " .. d.message
-                end
-            },
-            float = false,
-            virtual_text = false,
-            update_in_insert = true
-        })
-        local palette = require("command-palette")
-        palette.add({
-            {
-                "Status Beast", "Options for status bars and columns", { {
-                "Toggle Relnum", "Toggle relative line numbers on/off",
-                ":setl rnu!" } } }
-        })
-    end
-}, {
-    dir = vim.fn.stdpath("config") .. "/custom/jxdash",
-    name = "jxdash",
-    dependencies = { "jonathandarker" },
-    enabled = true,
-    lazy = false,
-    config = function()
-        require("jxdash").setup()
-    end
-}, {
-    "norcalli/nvim-colorizer.lua",
-    enabled = true,
-    lazy = false,
-    config = function()
-        require("colorizer").setup({ "*" }, {
-            mode = "background",
-            RGB = true,
-            RRGGBB = true,
-            RRGGBBAA = true,
-            names = false,
-            rgb_fn = false,
-            hsl_fn = false,
-            css = false,
-            css_fn = false
-        })
-    end
-}, {
-    "lukas-reineke/virt-column.nvim",
-    enabled = true,
-    lazy = false,
-    config = function()
-        vim.opt.colorcolumn = tostring(80 + 1)
-        local cc_group = vim.api.nvim_create_augroup("colorcolumn",
-            { clear = true })
-        local filetype_colorcolumn_map = {
-            python = 88,
-            kotlin = 100,
-            julia = 92
-        }
-        vim.api.nvim_create_autocmd({ "FileType" }, {
-            pattern = { "*" },
-            group = cc_group,
-            callback = function(event)
-                local filetype = vim.bo[event.buf].filetype
-                local colorcolumn = filetype_colorcolumn_map[filetype]
-                if colorcolumn == nil then
-                    colorcolumn = 80
-                end
-                for _, w in pairs(vim.api.nvim_list_wins()) do
-                    if vim.api.nvim_win_get_buf(w) == event.buf then
-                        vim.wo[w].colorcolumn = tostring(colorcolumn + 1)
-                    end
-                end
-            end
-        })
-        require("virt-column").setup({ char = "⁚" })
-    end
-},
-}

+ 0 - 112
.config/nvim/lua/plugins/telescope.lua

@@ -1,112 +0,0 @@
-return {
-    {
-        "nvim-telescope/telescope.nvim",
-        enabled = true,
-        lazy = false,
-        cmd = "Telescope",
-        dependencies = {
-            "nvim-lua/plenary.nvim", "nvim-telescope/telescope-ui-select.nvim"
-        },
-        config = function(_, _)
-            local builtin = require("telescope.builtin")
-            require("telescope").setup({
-                extensions = {
-                    ["ui-select"] = { require("telescope.themes").get_dropdown() }
-                },
-                defaults = {
-                    ["borderchars"] = {
-                        "-", "¦", "-", "¦", "⌌", "⌍", "⌏", "⌎"
-                    },
-                    layout_strategy = "horizontal",
-                    layout_config = {
-                        horizontal = { width = { padding = 0 }, height = 0.99 }
-                    },
-                    cache_picker = {
-                        num_pickers = 100,
-                        limit_entries = 100,
-                        ignore_empty_prompt = true
-                    }
-                },
-                pickers = {
-                    live_grep = {
-                        additional_args = function(_)
-                            return { "--hidden", "--glob=!**/.git/*" }
-                        end
-                    }
-                }
-            })
-            vim.keymap.set("n", "<Leader>f", function()
-                require("telescope").extensions.file_browser.file_browser({
-                    select_buffer = true,
-                    grouped = true,
-                    no_ignore = true,
-                    hidden = true,
-                    respect_gitignore = false,
-                    path = vim.fn.expand("%:p:h")
-                })
-            end, {})
-            vim.keymap.set("n", "<Leader>s", builtin.resume)
-            vim.keymap.set("n", "<Leader>S", builtin.pickers)
-            vim.keymap.set("n", "<Leader>T", builtin.treesitter)
-            vim.keymap.set("n", "<Leader>a", builtin.find_files)
-            vim.keymap.set("n", "<Leader>g", builtin.git_files)
-            vim.keymap.set("n", "<Leader>G", builtin.git_status)
-            vim.keymap.set("n", "<Leader>b", builtin.buffers)
-            vim.keymap.set("n", "<Leader>j", builtin.jumplist)
-            vim.keymap.set("n", "<Leader>w", builtin.grep_string)
-            vim.keymap.set("n", "<Leader>ld", builtin.lsp_definitions)
-            vim.keymap.set("n", "<Leader>lt", builtin.lsp_type_definitions)
-            vim.keymap.set("n", "<Leader>lr", builtin.lsp_references)
-            vim.keymap.set("n", "<Leader>li", builtin.lsp_implementations)
-            vim.keymap.set("n", "<Leader>ls", builtin.lsp_document_symbols)
-            vim.keymap.set("n", "<Leader>lS", builtin.lsp_workspace_symbols)
-            require("telescope").load_extension("ui-select")
-            require("telescope").load_extension("file_browser")
-        end
-    }, {
-    "nvim-telescope/telescope-file-browser.nvim",
-    dependencies = { "nvim-telescope/telescope.nvim" },
-    enabled = true,
-    lazy = false,
-    config = function(_, _)
-        require("telescope").setup({
-            extensions = {
-                file_browser = {
-                    respect_gitignore = false,
-                    hidden = { file_browser = true, folder_browser = true },
-                    hijack_netrw = true,
-                    display_stat = { date = false, size = true, mode = false },
-                    mappings = {}
-                }
-            }
-        })
-        require("telescope").load_extension("file_browser")
-    end
-}, {
-    dir = vim.fn.stdpath("config") .. "/custom/telescope-shroud",
-    name = "telescope-shroud",
-    dependencies = { "nvim-telescope/telescope.nvim",
-        "command-palette",
-        "nvim-lua/plenary.nvim" },
-    enabled = true,
-    config = function(_, _)
-        local shroud = require("telescope-shroud")
-        local palette = require("command-palette")
-        palette.add({
-            {
-                "Telescope Shroud", "Telescope `grep` filter management", { {
-                "Populate", "Reload the list of filter options", shroud.populate
-            }, {
-                "Clear default", "Reset the default filters", function()
-                shroud.set_default({})
-            end
-            }, {
-                "Set default", "Set the default filters", shroud.set_default }, {
-                "Open default", "Set the default filters", shroud.open_default }, {
-                "Open narrow", "Set the default filters", shroud.open_narrow } } }
-        })
-        vim.keymap.set("n", "<Leader>i", shroud.open_default)
-        vim.keymap.set("n", "<Leader>I", shroud.open_narrow)
-    end
-}
-}

+ 0 - 75
.config/nvim/lua/plugins/text-objects.lua

@@ -1,75 +0,0 @@
-return {
-    {
-        "kylechui/nvim-surround",
-        config = function() require("nvim-surround").setup({}) end
-        -- Surround selection / text objects with characters
-        -- Surround a word in single quotes: viwS'
-        -- Visual mode: S
-        -- Normal mode: ys
-        -- Surrounds: ( { [ < ' " [t]ag [f]unction
-    }, {
-    "tpope/vim-commentary",
-    enabled = true,
-    lazy = false
-    -- Toggle line comments
-    -- Normal mode: gcc
-    -- Visual mode: gc
-}, {
-    "nvim-treesitter/nvim-treesitter-textobjects",
-    enabled = true,
-    lazy = false,
-    dependencies = { "nvim-treesitter/nvim-treesitter" },
-    config = function()
-        require("nvim-treesitter.configs").setup({
-            textobjects = {
-                select = {
-                    enable = true,
-                    lookahead = true,
-                    keymaps = {
-                        ["af"] = "@function.outer",
-                        ["if"] = "@function.inner",
-                        ["ac"] = "@class.outer",
-                        ["ic"] = "@class.inner",
-                        ["ap"] = "@parameter.outer",
-                        ["ip"] = "@parameter.inner",
-                        ["aa"] = "@parameter.outer",
-                        ["ia"] = "@parameter.inner",
-                        ["al"] = "@loop.outer",
-                        ["il"] = "@loop.inner",
-                        ["at"] = "@attribute.outer",
-                        ["it"] = "@attribute.inner",
-                        ["a="] = "@assignment.outer",
-                        ["i="] = "@assignment.inner",
-                        ["ab"] = "@block.outer",
-                        ["ib"] = "@block.inner"
-                    },
-                    include_surrounding_whitespace = true
-                },
-                swap = {
-                    enable = true,
-                    swap_next = {
-                        ["csf"] = "@function.inner",
-                        ["csc"] = "@class.inner",
-                        ["csp"] = "@parameter.inner",
-                        ["csa"] = "@parameter.inner",
-                        ["csl"] = "@loop.inner",
-                        ["cst"] = "@attribute.inner",
-                        ["cs="] = "@assignment.inner",
-                        ["csb"] = "@block.inner"
-                    },
-                    swap_previous = {
-                        ["cSf"] = "@function.inner",
-                        ["cSc"] = "@class.inner",
-                        ["cSp"] = "@parameter.inner",
-                        ["cSa"] = "@parameter.inner",
-                        ["cSl"] = "@loop.inner",
-                        ["cSt"] = "@attribute.inner",
-                        ["cS="] = "@assignment.inner",
-                        ["cSb"] = "@block.inner"
-                    }
-                }
-            }
-        })
-    end
-}
-}

+ 0 - 57
.config/nvim/lua/plugins/treesitter.lua

@@ -1,57 +0,0 @@
-return {
-    {
-        "nvim-treesitter/nvim-treesitter",
-        enabled = true,
-        lazy = false,
-        config = function(_, _)
-            local api = require("nvim-treesitter.configs")
-            api.setup({
-                ensure_installed = "all",
-                sync_install = false,
-                auto_install = true,
-                highlight = {
-                    enable = true,
-                    additional_vim_regex_highlighting = false
-                }
-            })
-            vim.opt.foldmethod = "expr"
-            vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
-
-            vim.api.nvim_create_autocmd("LspAttach", {
-                callback = function(args)
-                    local client = vim.lsp.get_client_by_id(args.data.client_id)
-                    if vim.treesitter ~= nil and client ~= nil and
-                        type(vim.treesitter.highlighter.active[args.buf]) ~= "nil" then
-                        client.server_capabilities.semanticTokensProvider = nil
-                    end
-                end
-            })
-        end,
-        build = function()
-            require("nvim-treesitter.install").update({ with_sync = true })
-        end
-    }, {
-    "nvim-treesitter/nvim-treesitter-context",
-    enabled = true,
-    lazy = false,
-    dependencies = { "nvim-treesitter/nvim-treesitter" },
-    config = function(_, _)
-        require("treesitter-context").setup({
-            enable = true,
-            max_lines = 5,
-            min_window_height = 0,
-            line_numbers = true,
-            multiline_threshold = 20,
-            trim_scope = "outer",
-            mode = "cursor",
-            zindex = 20,
-            on_attach = nil
-        })
-        vim.api.nvim_set_hl(0, "TreesitterContextSeparator",
-            { link = "WinSeparator" })
-        vim.keymap.set("n", "<Leader>c", function()
-            require("treesitter-context").go_to_context(vim.v.count1)
-        end, { silent = true })
-    end
-}
-}