From 9365a8e96827cbf7bc5adad6d29bcd05b4d761b2 Mon Sep 17 00:00:00 2001 From: bee Date: Tue, 5 May 2026 22:37:10 +0530 Subject: Migrate from nixcats to nix-wrapper-modules --- lua/bee/LSPs/init.lua | 148 +++++++++++++++++++++++++++++++ lua/bee/LSPs/on_attach.lua | 54 +++++++++++ lua/bee/format.lua | 35 ++++++++ lua/bee/init.lua | 80 +++++++++++++++++ lua/bee/lint.lua | 18 ++++ lua/bee/plugins/blink.lua | 150 +++++++++++++++++++++++++++++++ lua/bee/plugins/git.lua | 62 +++++++++++++ lua/bee/plugins/init.lua | 9 ++ lua/bee/plugins/oil.lua | 72 +++++++++++++++ lua/bee/plugins/treesitter.lua | 192 ++++++++++++++++++++++++++++++++++++++++ lua/bee/plugins/ui.lua | 69 +++++++++++++++ lua/bee/utils/init.lua | 77 ++++++++++++++++ lua/colorscheme_persistence.lua | 50 ----------- lua/config/init.lua | 4 - lua/config/keys.lua | 35 -------- lua/config/lsp.lua | 92 ------------------- lua/config/options.lua | 52 ----------- lua/nixCatsUtils/lzUtils.lua | 36 -------- lua/plugins/ai.lua | 29 ------ lua/plugins/completion.lua | 65 -------------- lua/plugins/debug.lua | 90 ------------------- lua/plugins/formatter.lua | 47 ---------- lua/plugins/general.lua | 134 ---------------------------- lua/plugins/git.lua | 98 -------------------- lua/plugins/init.lua | 13 --- lua/plugins/linter.lua | 40 --------- lua/plugins/misc.lua | 50 ----------- lua/plugins/picker.lua | 97 -------------------- lua/plugins/tsitter.lua | 187 -------------------------------------- lua/plugins/ui.lua | 86 ------------------ 30 files changed, 966 insertions(+), 1205 deletions(-) create mode 100644 lua/bee/LSPs/init.lua create mode 100644 lua/bee/LSPs/on_attach.lua create mode 100644 lua/bee/format.lua create mode 100644 lua/bee/init.lua create mode 100644 lua/bee/lint.lua create mode 100644 lua/bee/plugins/blink.lua create mode 100644 lua/bee/plugins/git.lua create mode 100644 lua/bee/plugins/init.lua create mode 100644 lua/bee/plugins/oil.lua create mode 100644 lua/bee/plugins/treesitter.lua create mode 100644 lua/bee/plugins/ui.lua create mode 100644 lua/bee/utils/init.lua delete mode 100644 lua/colorscheme_persistence.lua delete mode 100644 lua/config/init.lua delete mode 100644 lua/config/keys.lua delete mode 100644 lua/config/lsp.lua delete mode 100644 lua/config/options.lua delete mode 100644 lua/nixCatsUtils/lzUtils.lua delete mode 100644 lua/plugins/ai.lua delete mode 100644 lua/plugins/completion.lua delete mode 100644 lua/plugins/debug.lua delete mode 100644 lua/plugins/formatter.lua delete mode 100644 lua/plugins/general.lua delete mode 100644 lua/plugins/git.lua delete mode 100644 lua/plugins/init.lua delete mode 100644 lua/plugins/linter.lua delete mode 100644 lua/plugins/misc.lua delete mode 100644 lua/plugins/picker.lua delete mode 100644 lua/plugins/tsitter.lua delete mode 100644 lua/plugins/ui.lua (limited to 'lua') diff --git a/lua/bee/LSPs/init.lua b/lua/bee/LSPs/init.lua new file mode 100644 index 0000000..3bc86a5 --- /dev/null +++ b/lua/bee/LSPs/init.lua @@ -0,0 +1,148 @@ +local MP = ... +local get_nixd_opts = nixInfo(nil, "info", "nixdExtras", "get_configs") +return { + { + "mason.nvim", + auto_enable = true, + priority = 55, + on_plugin = { "nvim-lspconfig" }, + lsp = function(plugin) + vim.cmd.MasonInstall(plugin.name) + end, + }, + { + "nvim-lspconfig", + auto_enable = true, + priority = 50, + lsp = function(plugin) + vim.lsp.config(plugin.name, plugin.lsp or {}) + vim.lsp.enable(plugin.name) + end, + before = function(_) + vim.lsp.config("*", { + on_attach = require(MP:relpath("on_attach")), + }) + end, + }, + { + "lua_ls", + for_cat = "lua", + lsp = { + filetypes = { "lua" }, + settings = { + Lua = { + runtime = { version = "LuaJIT" }, + formatters = { + ignoreComments = true, + }, + signatureHelp = { enabled = true }, + diagnostics = { + globals = { "vim", "make_test" }, + disable = {}, + }, + workspace = { + checkThirdParty = false, + library = { + -- '${3rd}/luv/library', + -- unpack(vim.api.nvim_get_runtime_file('', true)), + }, + }, + completion = { + callSnippet = "Replace", + }, + telemetry = { enabled = false }, + }, + }, + }, + }, + { + "nixd", + for_cat = "nix", + after = function(_) + vim.api.nvim_create_user_command("StartNilLSP", function() + vim.lsp.start(vim.lsp.config.nil_ls) + end, { desc = "Run nil-ls (when you really need docs for the builtins and nixd refuse)" }) + end, + lsp = { + filetypes = { "nix" }, + settings = { + nixd = { + nixpkgs = { + expr = nixInfo("import {}", "info", "nixdExtras", "nixpkgs"), + }, + formatting = { + command = { "nixfmt" }, + }, + options = { + -- (builtins.getFlake "path:${builtins.toString }").legacyPackages..nixosConfigurations."".options + nixos = { + expr = get_nixd_opts + and get_nixd_opts("nixos", nixInfo(nil, "info", "nixdExtras", "flake-path")), + }, + -- (builtins.getFlake "path:${builtins.toString }").legacyPackages..homeConfigurations."".options + ["home-manager"] = { + expr = get_nixd_opts + and get_nixd_opts("home-manager", nixInfo(nil, "info", "nixdExtras", "flake-path")), -- <- if flake-path is nil it will be lsp root dir + }, + }, + diagnostic = { + suppress = { + "sema-escaping-with", + }, + }, + }, + }, + }, + }, + { + "clangd", + for_cat = "C", + lsp = { + filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" }, + on_attach = function(client, bufnr) + require(MP:relpath("on_attach"))(client, bufnr) + -- the stuff they were adding that was overriding my on_attach + dofile(nixInfo.utils.get_nix_plugin_path("nvim-lspconfig") .. "/lsp/clangd.lua").on_attach( + client, + bufnr + ) + end, + -- unneded thanks to clangd_extensions-nvim I think + -- settings = { + -- clangd_config = { + -- init_options = { + -- compilationDatabasePath="./build", + -- }, + -- } + -- } + }, + }, + { + "gopls", + for_cat = "go", + lsp = { + filetypes = { "go", "gomod", "gowork", "gotmpl", "templ" }, + }, + }, + { + "zls", + for_cat = "zig", + lsp = { + filetypes = { "zig", "zir" }, + }, + }, + { + "rust_analyzer", + for_cat = "rust", + lsp = { + filetypes = { "rust" }, + }, + }, + { + "bashls", + for_cat = "bash", + lsp = { + filetypes = { "bash", "sh" }, + }, + }, +} diff --git a/lua/bee/LSPs/on_attach.lua b/lua/bee/LSPs/on_attach.lua new file mode 100644 index 0000000..d4d69e4 --- /dev/null +++ b/lua/bee/LSPs/on_attach.lua @@ -0,0 +1,54 @@ +-- vim.api.nvim_create_autocmd('LspAttach', { +-- group = vim.api.nvim_create_augroup('my-lsp-attach', { clear = true }), +-- callback = function(event) +-- require('birdee.LSPs.on_attach')(vim.lsp.get_client_by_id(event.data.client_id), event.buf) +-- end, +-- }) +return function(_, bufnr) + -- we create a function that lets us more easily define mappings specific + -- for LSP related items. It sets the mode, buffer and description for us each time. + + local map = function(keys, func, desc, mode) + if desc then + desc = "LSP: " .. desc + end + vim.keymap.set(mode or "n", keys, func, { buffer = bufnr, desc = desc }) + end + + map("rn", vim.lsp.buf.rename, "[R]e[n]ame") + map("la", vim.lsp.buf.code_action, "[L]sp [A]ction") + + -- See `:help K` for why this keymap + map("K", vim.lsp.buf.hover, "Hover Documentation") + map("", vim.lsp.buf.signature_help, "Signature Documentation") + + -- Lesser used LSP functionality + map("wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder") + map("wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder") + map("wl", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, "[W]orkspace [L]ist Folders") + + -- Create a command `:Format` local to the LSP buffer + vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_) + vim.lsp.buf.format() + end, { desc = "Format current buffer with LSP" }) + map("Fl", ":Format", "[F]ormat with [l]sp") + map("FL", ":Format", "[F]ormat with [L]SP") + -- The following two autocommands are used to highlight references of the + -- word under your cursor when your cursor rests there for a little while. + -- See `:help CursorHold` for information about when this is executed + -- When you move your cursor, the highlights will be cleared (the second autocommand). + -- local client = vim.lsp.get_client_by_id(event.data.client_id) + -- if client and client.server_capabilities.documentHighlightProvider then + -- vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + -- buffer = event.buf, + -- callback = vim.lsp.buf.document_highlight, + -- }) + + -- vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { + -- buffer = event.buf, + -- callback = vim.lsp.buf.clear_references, + -- }) + -- end +end diff --git a/lua/bee/format.lua b/lua/bee/format.lua new file mode 100644 index 0000000..c8d1214 --- /dev/null +++ b/lua/bee/format.lua @@ -0,0 +1,35 @@ +return { + "conform.nvim", + auto_enable = true, + event = "FileType", + keys = { + { "lf", desc = "[F]ormat [F]ile" }, + }, + after = function(_) + local conform = require("conform") + conform.setup({ + format_on_save = { + timeout_ms = 1000, + lsp_format = "fallback", + quiet = true, + }, + formatters_by_ft = { + lua = { "stylua" }, + nix = { "nixfmt" }, + c = { "clang_format" }, + cpp = { "clang_format" }, + cmake = { "cmake_format" }, + -- Use a sub-list to run only the first available formatter + javascript = { { "prettierd", "prettier" } }, + }, + }) + + vim.keymap.set({ "n", "v" }, "lf", function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = 1000, + }) + end, { desc = "[L]anguage [F]ormat" }) + end, +} diff --git a/lua/bee/init.lua b/lua/bee/init.lua new file mode 100644 index 0000000..23991ef --- /dev/null +++ b/lua/bee/init.lua @@ -0,0 +1,80 @@ +local MP = ... +do + local ok + ok, _G.nixInfo = pcall(require, vim.g.nix_info_plugin_name) + if not ok then + package.loaded[vim.g.nix_info_plugin_name] = setmetatable({}, { + __call = function(_, default) + return default + end, + }) + _G.nixInfo = require(vim.g.nix_info_plugin_name) + end + nixInfo.isNix = vim.g.nix_info_plugin_name ~= nil + nixInfo.utils = require(MP:relpath("utils")) + nixInfo.lze = setmetatable(require("lze"), getmetatable(require("lzextras"))) + function nixInfo.get_nix_plugin_path(name) + return nixInfo(nil, "plugins", "lazy", name) or nixInfo(nil, "plugins", "start", name) + end +end + +nixInfo.lze.register_handlers({ + nixInfo.utils.auto_enable_handler, + nixInfo.utils.for_cat_handler, + nixInfo.lze.lsp, +}) +nixInfo.lze.h.lsp.set_ft_fallback(nixInfo.utils.lsp_ft_fallback) +nixInfo.lze.load({ + { import = MP:relpath("plugins") }, + { import = MP:relpath("format") }, + { import = MP:relpath("lint") }, + { import = MP:relpath("LSPs") }, + { + "base46", + lazy = false, + auto_enable = true, + event = "VimEnter", + after = function(_) + require("base46").setup() + end, + }, + { + "vim-startuptime", + auto_enable = true, + cmd = { "StartupTime" }, + before = function(_) + vim.g.startuptime_event_width = 0 + vim.g.startuptime_tries = 10 + vim.g.startuptime_exe_path = nixInfo(vim.v.progpath, "progpath") + end, + }, + { + "mini.surround", + auto_enable = true, + event = "DeferredUIEnter", + after = function(_) + require("mini.surround").setup() + end, + }, + { + "mini.pick", + lazy = true, + auto_enable = true, + keys = { + { "ff", desc = "File finder" }, + { "bb", desc = "List open buffers" }, + { "sg", desc = "Live grep" }, + { "/", desc = "Grep" }, + }, + after = function(_) + require("mini.pick").setup({ + vim.keymap.set("n", "ff", "Pick files", { desc = "File finder" }), + vim.keymap.set("n", "bb", "Pick buffers", { desc = "List open buffers" }), + vim.keymap.set("n", "sg", "Pick grep_live", { desc = "live grep" }), + vim.keymap.set("n", "/", "Pick grep", { desc = "Grep" }), + }) + end, + }, +}) + +vim.cmd.colorscheme("matugen") diff --git a/lua/bee/lint.lua b/lua/bee/lint.lua new file mode 100644 index 0000000..d29ea3a --- /dev/null +++ b/lua/bee/lint.lua @@ -0,0 +1,18 @@ +return { + "nvim-lint", + auto_enable = true, + event = "FileType", + after = function(_) + require("lint").linters_by_ft = { + cpp = { "cpplint" }, + javascript = { "eslint" }, + typescript = { "eslint" }, + } + + vim.api.nvim_create_autocmd({ "BufWritePost" }, { + callback = function() + require("lint").try_lint() + end, + }) + end, +} diff --git a/lua/bee/plugins/blink.lua b/lua/bee/plugins/blink.lua new file mode 100644 index 0000000..7fd147b --- /dev/null +++ b/lua/bee/plugins/blink.lua @@ -0,0 +1,150 @@ +local MP = ... +return { + { + "luasnip", + auto_enable = true, + dep_of = { "blink.cmp" }, + after = function(_) + local luasnip = require("luasnip") + require("luasnip.loaders.from_vscode").lazy_load() + luasnip.config.setup({}) + + local ls = require("luasnip") + local s = ls.snippet + local t = ls.text_node + local i = ls.insert_node + local extras = require("luasnip.extras") + local rep = extras.rep + local fmta = require("luasnip.extras.fmt").fmta + local c = ls.choice_node + local f = ls.function_node + local d = ls.dynamic_node + local sn = ls.snippet_node + + vim.keymap.set({ "i", "s" }, "", function() + if ls.choice_active() then + ls.change_choice(1) + end + end) + end, + }, + { + "colorful-menu.nvim", + auto_enable = true, + on_plugin = { "blink.cmp" }, + }, + { + "blink.cmp", + auto_enable = true, + event = { "InsertEnter", "CmdlineEnter" }, + after = function(_) + require("blink.cmp").setup({ + keymap = { preset = "default" }, + cmdline = { + enabled = true, + completion = { + menu = { + auto_show = true, + }, + }, + sources = function() + local type = vim.fn.getcmdtype() + -- Search forward and backward + if type == "/" or type == "?" then + return { "buffer" } + end + -- Commands + if type == ":" or type == "@" then + return { "cmdline" } + end + return {} + end, + }, + term = { + enabled = false, + }, + fuzzy = { + sorts = { + "exact", + "score", + "sort_text", + }, + }, + appearance = { + nerd_font_variant = "mono", + }, + signature = { + enabled = true, + window = { + show_documentation = true, + }, + }, + completion = { + menu = { + draw = { + columns = { + { "label", "label_description", gap = 1 }, + { "srckind" }, + }, + treesitter = { "lsp" }, + components = { + srckind = { + ellipsis = false, + width = { fill = true }, + text = function(ctx) + return ctx.kind + end, + highlight = function(ctx) + return ctx.kind_hl + end, + }, + label = { + text = function(ctx) + return require("colorful-menu").blink_components_text(ctx) + end, + highlight = function(ctx) + return require("colorful-menu").blink_components_highlight(ctx) + end, + }, + }, + }, + }, + documentation = { + auto_show = true, + }, + }, + ---@type blink.cmp.SnippetsConfig + snippets = { + preset = "luasnip", + active = function(filter) + local snippet = require("luasnip") + local blink = require("blink.cmp") + if snippet.in_snippet() and not blink.is_visible() then + return true + else + if not snippet.in_snippet() and vim.fn.mode() == "n" then + snippet.unlink_current() + vim.snippet.stop() + end + return false + end + end, + }, + sources = { + default = { "lsp", "path", "snippets", "buffer", "omni" }, + providers = { + path = { + score_offset = 50, + }, + lsp = { + score_offset = 40, + }, + snippets = { + score_offset = 40, + }, + }, + }, + }) + end, + }, +} diff --git a/lua/bee/plugins/git.lua b/lua/bee/plugins/git.lua new file mode 100644 index 0000000..78be9b4 --- /dev/null +++ b/lua/bee/plugins/git.lua @@ -0,0 +1,62 @@ +return { + { + "vim-fugitive", + auto_enable = { + "vim-fugitive", + "vim-rhubarb", + }, + keys = { { "gg", "G", desc = "Open git" } }, + cmd = { + "G", + "Git", + "Gdiffsplit", + "Gvdiffsplit", + "Gedit", + "Gread", + "Gwrite", + "Ggrep", + "GMove", + "Glgrep", + "GRename", + "GDelete", + "GRemove", + "GBrowse", + "DiffviewOpen", + "DiffviewClose", + "DiffviewToggleFiles", + "DiffviewFocusFiles", + "DiffviewRefresh", + "DiffviewFileHistory", + }, + load = function(name) + nixInfo.lze.loaders.multi({ + name, + "vim-rhubarb", + "diffview.nvim", + }) + end, + }, + { + "mini.diff", + auto_enable = true, + event = "DeferredUIEnter", + after = function(_) + require("mini.diff").setup({ + view = { + style = "sign", + signs = { add = "│", change = "~", delete = "-" }, + priority = 9, + }, + mappings = { + apply = "", + reset = "", + textobject = "", + goto_first = "", + goto_prev = "", + goto_next = "", + goto_last = "", + }, + }) + end, + }, +} diff --git a/lua/bee/plugins/init.lua b/lua/bee/plugins/init.lua new file mode 100644 index 0000000..59e0a41 --- /dev/null +++ b/lua/bee/plugins/init.lua @@ -0,0 +1,9 @@ +local MP = ... + +return { + { import = MP:relpath("ui") }, + { import = MP:relpath("oil") }, + { import = MP:relpath("git") }, + { import = MP:relpath("blink") }, + { import = MP:relpath("treesitter") }, +} diff --git a/lua/bee/plugins/oil.lua b/lua/bee/plugins/oil.lua new file mode 100644 index 0000000..5f8c6d6 --- /dev/null +++ b/lua/bee/plugins/oil.lua @@ -0,0 +1,72 @@ +return { + { + "oil.nvim", + lazy = true, + keys = { { "o", "Oil", desc = "Open oil" } }, + auto_enable = true, + after = function() + vim.g.loaded_netrwPlugin = 1 + vim.keymap.set("n", "o", "Oil .", { noremap = true, desc = "Open nvim root directory" }) + require("oil").setup({ + keymaps = { + ["-"] = "actions.parent", + [""] = "actions.select", + [""] = "actions.select_vsplit", + [""] = "actions.select_split", + }, + vim.keymap.set("n", "o", "Oil", { desc = "Open Oil" }), + + -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) + -- Set to false if you still want to use netrw. + default_file_explorer = true, + -- Id is automatically added at the beginning, and name at the end + -- See :help oil-columns + columns = { + "icon", + "permissions", + "size", + -- "mtime", + }, + -- Buffer-local options to use for oil buffers + buf_options = { + buflisted = false, + bufhidden = "hide", + }, + -- Window-local options to use for oil buffers + win_options = { + wrap = false, + signcolumn = "no", + cursorcolumn = false, + foldcolumn = "0", + spell = false, + list = false, + conceallevel = 3, + concealcursor = "nvic", + }, + -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash) + delete_to_trash = false, + -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits) + skip_confirm_for_simple_edits = false, + -- Selecting a new/moved/renamed file or directory will prompt you to save changes first + -- (:help prompt_save_on_select_new_entry) + prompt_save_on_select_new_entry = true, + -- Oil will automatically delete hidden buffers after this delay + -- You can set the delay to false to disable cleanup entirely + -- Note that the cleanup process only starts when none of the oil buffers are currently displayed + cleanup_delay_ms = 2000, + lsp_file_methods = { + -- Time to wait for LSP file operations to complete before skipping + timeout_ms = 1000, + -- Set to true to autosave buffers that are updated with LSP willRenameFiles + -- Set to "unmodified" to only save unmodified buffers + autosave_changes = false, + }, + -- Constrain the cursor to the editable parts of the oil buffer + -- Set to `false` to disable, or "name" to keep it on the file names + constrain_cursor = "editable", + -- Set to true to watch the filesystem for changes and reload oil + experimental_watch_for_changes = false, + }) + end, + }, +} diff --git a/lua/bee/plugins/treesitter.lua b/lua/bee/plugins/treesitter.lua new file mode 100644 index 0000000..bfce021 --- /dev/null +++ b/lua/bee/plugins/treesitter.lua @@ -0,0 +1,192 @@ +-- Docs say not to lazy load it +return { + { + "nvim-treesitter", + auto_enable = true, + lazy = false, + after = function(plugin) + ---@param buf integer + ---@param language string + local function treesitter_try_attach(buf, language) + -- check if parser exists and load it + if not vim.treesitter.language.add(language) then + return false + end + vim.treesitter.start(buf, language) + + -- enables treesitter based folds + vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" + vim.wo.foldmethod = "expr" + -- ensure folds are open to begin with + vim.o.foldlevel = 99 + + -- enables treesitter based indentation + vim.b.did_indent = 1 -- this right here prevents built-in indent scripts from loading + vim.bo.indentexpr = "v:lua.require'nvim-treesitter.indent'.get_indent(v:lnum)" + + return true + end + + local installable_parsers = nixInfo.isNix or require("nvim-treesitter").get_available() + vim.api.nvim_create_autocmd("FileType", { + callback = function(args) + local buf, filetype = args.buf, args.match + local language = vim.treesitter.language.get_lang(filetype) + if not language then + return + end + + if not treesitter_try_attach(buf, language) and not nixInfo.isNix then + -- we do something more interesting in nix and don't do this there + ---@cast installable_parsers string[] + if vim.tbl_contains(installable_parsers, language) then + -- not already installed, so try to install them via nvim-treesitter if possible + require("nvim-treesitter").install(language):await(function() + treesitter_try_attach(buf, language) + end) + end + end + end, + }) + end, + }, + { + "nvim-treesitter-textobjects", + auto_enable = true, + lazy = false, + before = function(plugin) + vim.g.no_plugin_maps = true + end, + after = function(plugin) + require("nvim-treesitter-textobjects").setup({ + select = { + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + -- You can choose the select mode (default is charwise 'v') + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * method: eg 'v' or 'o' + -- and should return the mode ('v', 'V', or '') or a table + -- mapping query_strings to modes. + selection_modes = { + ["@parameter.outer"] = "v", -- charwise + ["@function.outer"] = "V", -- linewise + -- ['@class.outer'] = '', -- blockwise + }, + -- If you set this to `true` (default is `false`) then any textobject is + -- extended to include preceding or succeeding whitespace. Succeeding + -- whitespace has priority in order to act similarly to eg the built-in + -- `ap`. + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * selection_mode: eg 'v' + -- and should return true of false + include_surrounding_whitespace = false, + }, + move = { + set_jumps = true, + }, + }) + + -- keymaps + -- You can use the capture groups defined in `textobjects.scm` + vim.keymap.set({ "x", "o" }, "am", function() + require("nvim-treesitter-textobjects.select").select_textobject("@function.outer", "textobjects") + end) + vim.keymap.set({ "x", "o" }, "im", function() + require("nvim-treesitter-textobjects.select").select_textobject("@function.inner", "textobjects") + end) + vim.keymap.set({ "x", "o" }, "ac", function() + require("nvim-treesitter-textobjects.select").select_textobject("@class.outer", "textobjects") + end) + vim.keymap.set({ "x", "o" }, "ic", function() + require("nvim-treesitter-textobjects.select").select_textobject("@class.inner", "textobjects") + end) + -- You can also use captures from other query groups like `locals.scm` + vim.keymap.set({ "x", "o" }, "as", function() + require("nvim-treesitter-textobjects.select").select_textobject("@local.scope", "locals") + end) + vim.keymap.set("n", "a", function() + require("nvim-treesitter-textobjects.swap").swap_next("@parameter.inner") + end) + vim.keymap.set("n", "A", function() + require("nvim-treesitter-textobjects.swap").swap_previous("@parameter.outer") + end) + + -- You can use the capture groups defined in `textobjects.scm` + vim.keymap.set({ "n", "x", "o" }, "]m", function() + require("nvim-treesitter-textobjects.move").goto_next_start("@function.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "]]", function() + require("nvim-treesitter-textobjects.move").goto_next_start("@class.outer", "textobjects") + end) + -- You can also pass a list to group multiple queries. + vim.keymap.set({ "n", "x", "o" }, "]o", function() + require("nvim-treesitter-textobjects.move").goto_next_start( + { "@loop.inner", "@loop.outer" }, + "textobjects" + ) + end) + -- You can also use captures from other query groups like `locals.scm` or `folds.scm` + vim.keymap.set({ "n", "x", "o" }, "]s", function() + require("nvim-treesitter-textobjects.move").goto_next_start("@local.scope", "locals") + end) + vim.keymap.set({ "n", "x", "o" }, "]z", function() + require("nvim-treesitter-textobjects.move").goto_next_start("@fold", "folds") + end) + + vim.keymap.set({ "n", "x", "o" }, "]M", function() + require("nvim-treesitter-textobjects.move").goto_next_end("@function.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "][", function() + require("nvim-treesitter-textobjects.move").goto_next_end("@class.outer", "textobjects") + end) + + vim.keymap.set({ "n", "x", "o" }, "[m", function() + require("nvim-treesitter-textobjects.move").goto_previous_start("@function.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "[[", function() + require("nvim-treesitter-textobjects.move").goto_previous_start("@class.outer", "textobjects") + end) + + vim.keymap.set({ "n", "x", "o" }, "[M", function() + require("nvim-treesitter-textobjects.move").goto_previous_end("@function.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "[]", function() + require("nvim-treesitter-textobjects.move").goto_previous_end("@class.outer", "textobjects") + end) + local ts_repeat_move = require("nvim-treesitter-textobjects.repeatable_move") + + -- Repeat movement with ; and , + -- ensure ; goes forward and , goes backward regardless of the last direction + -- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_next) + -- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_previous) + + -- vim way: ; goes to the direction you were moving. + vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move) + vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite) + + -- Optionally, make builtin f, F, t, T also repeatable with ; and , + vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f_expr, { expr = true }) + vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F_expr, { expr = true }) + vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t_expr, { expr = true }) + vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T_expr, { expr = true }) + end, + }, + { + "nvim-ts-autotag", + auto_enable = true, + lazy = false, + after = function(plugin) + require("nvim-ts-autotag").setup({ + opts = { + enable_close = true, + enable_rename = true, + enable_close_on_slash = false, + }, + }) + end, + }, +} diff --git a/lua/bee/plugins/ui.lua b/lua/bee/plugins/ui.lua new file mode 100644 index 0000000..8ce2a3c --- /dev/null +++ b/lua/bee/plugins/ui.lua @@ -0,0 +1,69 @@ +return { + { + "lualine.nvim", + auto_enable = true, + after = function(_) + require("lualine").setup({ + options = { + component_separators = { left = "|", right = "|" }, + section_separators = {}, + }, + sections = { + lualine_a = { + { + "mode", + fmt = function(mode) + return ({ + ["NORMAL"] = "っ( ' ᵕ ' )っ", + ["O-PENDING"] = "っ( º _ º )っ", + ["INSERT"] = "っ(>‿<)っ✎", + ["VISUAL"] = "っ(⊙‿⊙)っ", + ["V-LINE"] = "っ(ò_ó)っ¤=[]::>", + ["V-BLOCK"] = "っ[ •̀ ⌂ •́ ]っ", + ["REPLACE"] = "っ( O )っ", + ["V-REPLACE"] = "っ[ O ]っ", + ["COMMAND"] = "っ(ง •̀_•́)ง", + ["TERMINAL"] = "っ( ͡° ͜ʖ ͡°)っ", + ["EX"] = "っ( ͡ಠ ͜ʖ ͡ಠ)ง", + ["SHELL"] = "っ(©_©)っ", + ["MORE"] = "っ(°-° )っ", + ["CONFIRM"] = "っ( 0_0)?", + + -- ["SELECT"] = "っ(づ。◕‿‿◕。)づ", + -- ["S-LINE"] = "っ(づ。◕‿‿◕。)づ¤", + -- ["S-BLOCK"] = "っ[づ。◕‿‿◕。]づ", + })[mode] or mode + end, + }, + }, + lualine_c = { + { + "filename", + path = 1, + }, + }, + }, + inactive_sections = { + lualine_a = { "filename" }, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = { "location" }, + }, + }) + end, + }, + { + "mini.indentscope", + auto_enable = true, + event = "DeferredUIEnter", + after = function(_) + require("mini.indentscope").setup({ + draw = { + delay = 200, + }, + }) + end, + }, +} diff --git a/lua/bee/utils/init.lua b/lua/bee/utils/init.lua new file mode 100644 index 0000000..4296561 --- /dev/null +++ b/lua/bee/utils/init.lua @@ -0,0 +1,77 @@ +local M = {} + +local nixInfo = _G.nixInfo or function(default, ...) + return default +end + +function M.get_nix_plugin_path(name) + if vim.g.nix_info_plugin_name then + return nixInfo(nil, "plugins", "lazy", name) or nixInfo(nil, "plugins", "start", name) + else + return vim.api.nvim_get_runtime_file("pack/*/*/" .. name, false)[1] + end +end + +function M.lsp_ft_fallback(name) + local nvimlspcfg = M.get_nix_plugin_path("nvim-lspconfig") + if not nvimlspcfg then + local matches = vim.api.nvim_get_runtime_file("pack/*/*/nvim-lspconfig", false) + nvimlspcfg = assert(matches[1], "nvim-lspconfig not found!") + end + vim.api.nvim_create_user_command("LspGetFiletypesToClipboard", function(opts) + local lspname = + assert(opts.fargs[1] or vim.fn.getreg("+") or name, "no name to search for provided or in clipboard") + local ok, lspcfg = pcall(dofile, nvimlspcfg .. "/lsp/" .. lspname .. ".lua") + if not ok or not lspcfg then + error("failed to get config for lsp: " .. lspname) + end + vim.fn.setreg("+", "filetypes = " .. vim.inspect(lspcfg.filetypes or {}) .. ",") + end, { nargs = "?" }) + vim.schedule(function() + vim.notify((name or "lsp") .. " not provided filetype", vim.log.levels.WARN) + end) + return name and dofile(nvimlspcfg .. "/lsp/" .. name .. ".lua").filetypes or {} +end + +M.auto_enable_handler = { + spec_field = "auto_enable", + set_lazy = false, + modify = function(plugin) + if vim.g.nix_info_plugin_name then + if type(plugin.auto_enable) == "table" then + for _, name in pairs(plugin.auto_enable) do + if not M.get_nix_plugin_path(name) then + plugin.enabled = false + break + end + end + elseif type(plugin.auto_enable) == "string" then + if not M.get_nix_plugin_path(plugin.auto_enable) then + plugin.enabled = false + end + elseif type(plugin.auto_enable) == "boolean" and plugin.auto_enable then + if not M.get_nix_plugin_path(plugin.name) then + plugin.enabled = false + end + end + end + return plugin + end, +} + +M.for_cat_handler = { + spec_field = "for_cat", + set_lazy = false, + modify = function(plugin) + if vim.g.nix_info_plugin_name then + if type(plugin.for_cat) == "table" then + plugin.enabled = nixInfo(plugin.for_cat.default, "settings", "cats", plugin.for_cat.cat) + elseif type(plugin.for_cat) == "string" then + plugin.enabled = nixInfo(false, "settings", "cats", plugin.for_cat) + end + end + return plugin + end, +} + +return M diff --git a/lua/colorscheme_persistence.lua b/lua/colorscheme_persistence.lua deleted file mode 100644 index e5f6cda..0000000 --- a/lua/colorscheme_persistence.lua +++ /dev/null @@ -1,50 +0,0 @@ -local M = {} - --- (~/.local/share/nvim/last_theme.txt) -local theme_cache_path = vim.fn.stdpath("data") .. "/last_theme.txt" - -M.is_programmatic_change = false - -function M.load_theme() - local theme = "" - - local f = io.open(theme_cache_path, "r") - if f then - theme = f:read("*all"):gsub("%s+", "") - f:close() - end - - if theme == "" then - theme = nixCats.extra("colorscheme") - end - - M.is_programmatic_change = true - local status, _ = pcall(vim.cmd.colorscheme, theme) - - -- just to be safe - if not status then - vim.cmd.colorscheme("habamax") - end -end - -vim.api.nvim_create_autocmd("ColorScheme", { - callback = function(args) - -- If the change was programmatic (like at startup), don't overwrite the file - if M.is_programmatic_change then - M.is_programmatic_change = false -- Reset for the next manual change - return - end - - -- Save the new theme name to the file - local theme_name = args.match - local f = io.open(theme_cache_path, "w") - if f then - f:write(theme_name) - f:close() - end - end, -}) - -M.load_theme() - -return M diff --git a/lua/config/init.lua b/lua/config/init.lua deleted file mode 100644 index afc9d18..0000000 --- a/lua/config/init.lua +++ /dev/null @@ -1,4 +0,0 @@ -require("config.options") --- require("colors.colorschemes") -require("config.keys") -require("config.lsp") diff --git a/lua/config/keys.lua b/lua/config/keys.lua deleted file mode 100644 index 518b9c1..0000000 --- a/lua/config/keys.lua +++ /dev/null @@ -1,35 +0,0 @@ -vim.keymap.set("v", "J", ":m '>+1gv=gv", { silent = true }) -vim.keymap.set("v", "K", ":m '<-2gv=gv", { silent = true }) - -vim.keymap.set("n", "J", "mzJ`z", { silent = true }) -vim.keymap.set("n", "", "zz", { silent = true }) -vim.keymap.set("n", "", "zz", { silent = true }) -vim.keymap.set("n", "n", "nzzzv", { silent = true }) -vim.keymap.set("n", "N", "Nzzzv", { silent = true }) -vim.keymap.set({ "n", "v" }, "y", [["+y]]) -vim.keymap.set({ "n", "v" }, "d", [["_d"]]) - -vim.keymap.set("n", "q:", "") -- disable that annoying cmd history buffer thingy - -vim.keymap.set("n", "", "cnextzz") -vim.keymap.set("n", "", "cprevzz") -vim.keymap.set("n", "k", "lnextzz") -vim.keymap.set("n", "j", "lprevzz") -vim.keymap.set("n", "bn", "bn") -vim.keymap.set("n", "bp", "bp") - -vim.keymap.set("n", "u", [[:%s/\<\>//gI]]) -vim.keymap.set("n", "px", "!chmod +x %") -vim.keymap.set("n", "", "nohlsearch") - -local function hover_cap(opts) - opts = vim.tbl_deep_extend("force", opts or {}, { - max_width = 100, - max_height = 25, - wrap = true, - }) - return vim.lsp.buf.hover(opts) -end - -vim.keymap.set("n", "K", hover_cap, { silent = true }) --- vim.keymap.set("n", "rn", vim.lsp.buf.rename, { desc = "Rename Symbol" }) diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua deleted file mode 100644 index ab35b80..0000000 --- a/lua/config/lsp.lua +++ /dev/null @@ -1,92 +0,0 @@ -vim.lsp.inlay_hint.enable(true) -vim.lsp.enable({ - "clangd", - "lua_ls", - "nixd", - "nil_ls", - "zls", - "pyrefly", - "marksman", - "harper", - "tinymist", - "gopls", - "tombi", - "qmlls", -}) - -vim.lsp.config("nil_ls", { - settings = { - formatting = { - command = { "nixfmt" }, - }, - }, -}) - -vim.lsp.config("lua_ls", { - settings = { - Lua = { - codeLens = { enable = true }, - hint = { - enable = false, - semicolon = "Disable", - }, - workspace = { - checkThirdParty = false, - -- IMPORTANT: Leave library empty here. - -- lazydev will inject the correct Nix store paths dynamically. - library = {}, - }, - runtime = { - version = "LuaJIT", - -- Setting this to false allows lazydev to find files - -- outside your immediate workspace (like Nix store plugins) - pathStrict = false, - }, - }, - }, -}) - -vim.lsp.config("*", { - capabilities = { textDocument = { semanticTokens = { multilineTokenSupport = true } } }, - root_markers = { ".git", ".editorconfig", "flake.nix", "shell.nix" }, -}) - -vim.diagnostic.config({ - severity_sort = true, - severity_sort_priority = { - Error = 100, - Warn = 90, - Hint = 50, - Info = 10, - }, -}) - -local RustLsp = function(mode, keymap, action, bufnr) - vim.keymap.set(mode, keymap, function() - vim.cmd.RustLsp(action) - end, { silent = true, buffer = bufnr }) -end - -vim.g.rustaceanvim = { - tools = {}, - server = { - on_attach = function(client, bufnr) - RustLsp({ "n", "x" }, "gra", "codeAction", bufnr) - RustLsp("n", "ee", "explainError", bufnr) - RustLsp("n", "K", { "hover", "actions" }, bufnr) - RustLsp("n", "L", { "hover", "range" }, bufnr) - end, - default_settings = { - ["rust-analyzer"] = { - checkOnSave = { - enable = true, - command = "clippy", - }, - procMacro = { - enable = true, - }, - }, - }, - }, - dap = {}, -} diff --git a/lua/config/options.lua b/lua/config/options.lua deleted file mode 100644 index d0e2b40..0000000 --- a/lua/config/options.lua +++ /dev/null @@ -1,52 +0,0 @@ -vim.loader.enable() -vim.g.mapleader = " " -vim.g.maplocalleader = " " -vim.o.updatetime = 1500 - -vim.o.inccommand = "split" - -vim.o.undofile = false -vim.o.undodir = vim.fn.expand("~/.local/share/nvim/undo") - -vim.o.termguicolors = true -vim.o.guicursor = "n-v-c-sm:block,ci-ve:ver25,r-cr-o:hor20" -vim.o.showmode = false -vim.o.showcmd = false -vim.o.signcolumn = "yes" -vim.o.cursorline = true --- vim.o.cursorlineopt = "number" -- Restricts the highlight ONLY to the number column --- vim.o.background = "dark" -vim.o.winborder = "single" -vim.o.conceallevel = 2 -vim.o.autoread = true - -vim.o.nu = true -vim.o.relativenumber = true - -vim.o.mouse = "" -vim.o.scrolloff = 21 -vim.g.loaded_netrwPlugin = 1 -vim.g.loaded_netrw = 1 - -vim.o.expandtab = true -vim.o.tabstop = 4 -vim.o.softtabstop = 4 -vim.o.shiftwidth = 4 -vim.o.smartindent = false -vim.o.smarttab = true -vim.o.breakindent = true -vim.o.autoindent = true - -vim.o.wrap = false -vim.o.linebreak = false - -vim.o.hlsearch = true -vim.o.incsearch = true - -vim.o.title = true -vim.o.swapfile = false - -vim.o.foldlevel = 99 -vim.o.foldlevelstart = 99 -vim.o.foldenable = true -vim.o.foldmethod = "expr" diff --git a/lua/nixCatsUtils/lzUtils.lua b/lua/nixCatsUtils/lzUtils.lua deleted file mode 100644 index 2e2393d..0000000 --- a/lua/nixCatsUtils/lzUtils.lua +++ /dev/null @@ -1,36 +0,0 @@ ---[[ - This directory is the luaUtils template. - You can choose what things from it that you would like to use. - And then delete the rest. - Everything in this directory is optional. ---]] - -local M = {} --- A nixCats specific lze handler that you can use to conditionally enable by category easier. --- at the start of your config, register with --- require('lze').register_handlers(require('nixCatsUtils.lzUtils').for_cat) --- before any calls to require('lze').load using the handler have been made. --- accepts: --- for_cat = { "your" "cat" }; --- for_cat = { cat = { "your" "cat" }, default = bool } --- for_cat = "your.cat"; --- for_cat = { cat = "your.cat", default = bool } --- where default is an alternate value for when nixCats was NOT used to install the config -M.for_cat = { - spec_field = "for_cat", - set_lazy = false, - modify = function(plugin) - if type(plugin.for_cat) == "table" and plugin.for_cat.cat ~= nil then - if vim.g[ [[nixCats-special-rtp-entry-nixCats]] ] ~= nil then - plugin.enabled = nixCats(plugin.for_cat.cat) or false - else - plugin.enabled = plugin.for_cat.default - end - else - plugin.enabled = nixCats(plugin.for_cat) or false - end - return plugin - end, -} - -return M diff --git a/lua/plugins/ai.lua b/lua/plugins/ai.lua deleted file mode 100644 index 0aa51d8..0000000 --- a/lua/plugins/ai.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - { - "opencode-nvim", - for_cat = "ai", - keys = { - -- stylua: ignore start - { 'co', function() require('opencode').toggle() end, desc = 'Toggle opencode' }, - { 'ca', function() require('opencode').ask() end, desc = 'Ask opencode', mode = { 'n', 'v' } }, - { 'cA', function() require('opencode').ask('@buffer ', { submit = true }) end, desc = 'Ask opencode about current file', mode = { 'n', 'v' } }, - { 'cn', function() require('opencode').command('session.new') end, desc = 'New session' }, - { 'ce', function() require('opencode').prompt('Explain @this and its context') end, desc = 'Explain code at cursor', mode = { 'n', 'v' } }, - { 'cr', function() require('opencode').prompt('Review @buffer for correctness and readability') end, desc = 'Review file' }, - { 'cf', function() require('opencode').prompt('Fix @diagnostics') end, desc = 'Fix errors' }, - { 'cp', function() require('opencode').prompt('Optimize @this for performance and readability') end, desc = 'Optimize selection', mode = 'v' }, - { 'cd', function() require('opencode').prompt('Add documentation comments for @this') end, desc = 'Document selection', mode = 'v' }, - { 'ct', function() require('opencode').prompt('Add tests for @this') end, desc = 'Test selection', mode = 'v' }, - { 'cs', function() require('opencode').select() end, desc = 'Select opencode action', mode = { 'n', 'v' } }, - -- stylua: ignore end - }, - before = function() - vim.g.opencode_opts = { - providers = { - enabled = "terminal", - tmux = {}, - }, - } - end, - }, -} diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua deleted file mode 100644 index 79946e1..0000000 --- a/lua/plugins/completion.lua +++ /dev/null @@ -1,65 +0,0 @@ -return { - { - "blink.cmp", - event = { "InsertEnter", "CmdlineEnter" }, - for_cat = "core.completion", - load = function(name) - require("lzextras").loaders.multi({ - name, - -- "blink-ripgrep.nvim", - "friendly-snippets", - }) - end, - after = function(_) - require("blink.cmp").setup({ - keymap = { preset = "default" }, - appearance = { nerd_font_variant = "mono" }, - signature = { enabled = false }, - completion = { - documentation = { - auto_show = false, - }, - menu = { - draw = { - columns = { - { "label", "label_description", gap = 1 }, - { "kind_icon", "kind", gap = 1 }, - }, - treesitter = { "lsp" }, - }, - }, - }, - sources = { - default = { "lsp", "path", "snippets", "buffer", "cmdline", "omni" }, - providers = { - path = { - score_offset = 25, - }, - lsp = { - fallbacks = {}, - score_offset = 20, - }, - snippets = { - score_offset = 20, - }, - buffer = { - score_offset = 5, - }, - -- ripgrep = { - -- module = "blink-ripgrep", - -- name = "Ripgrep", - -- opts = { - -- project_root_marker = { ".git", "flake.nix", "flake.lock" }, - -- backend = { - -- use = "gitgrep-or-ripgrep", - -- customize_icon_highlight = false, - -- }, - -- }, - -- }, - }, - }, - fuzzy = { implementation = "prefer_rust_with_warning" }, - }) - end, - }, -} diff --git a/lua/plugins/debug.lua b/lua/plugins/debug.lua deleted file mode 100644 index 659336b..0000000 --- a/lua/plugins/debug.lua +++ /dev/null @@ -1,90 +0,0 @@ -return { - { - "nvim-dap-go", - for_cat = { cat = "go", default = false }, - on_plugin = { "nvim-dap" }, - after = function(_) - require("dap-go").setup() - end, - }, - { - "nvim-dap", - for_cat = "debug", - on_require = { "dap" }, - keys = { - { "", desc = "Debug: Start/Continue" }, - { "", desc = "Debug: Step Into" }, - { "", desc = "Debug: Step Over" }, - { "", desc = "Debug: Step Out" }, - { "b", desc = "Debug: Toggle Breakpoint" }, - { "B", desc = "Debug: Set Breakpoint" }, - { "", desc = "Debug: See last session result." }, - }, - load = function(name) - require("lzextras").loaders.multi({ - name, - "nvim-dap-ui", - "nvim-dap-virtual-text", - }) - end, - after = function(_) - local dap = require("dap") - local dapui = require("dapui") - - -- Basic debugging keymaps, feel free to change to your liking! - vim.keymap.set("n", "", dap.continue, { desc = "Debug: Start/Continue" }) - vim.keymap.set("n", "", dap.step_into, { desc = "Debug: Step Into" }) - vim.keymap.set("n", "", dap.step_over, { desc = "Debug: Step Over" }) - vim.keymap.set("n", "", dap.step_out, { desc = "Debug: Step Out" }) - vim.keymap.set("n", "b", dap.toggle_breakpoint, { desc = "Debug: Toggle Breakpoint" }) - vim.keymap.set("n", "B", function() - dap.set_breakpoint(vim.fn.input("Breakpoint condition: ")) - end, { desc = "Debug: Set Breakpoint" }) - - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - vim.keymap.set("n", "", dapui.toggle, { desc = "Debug: See last session result." }) - - dap.listeners.after.event_initialized["dapui_config"] = dapui.open - dap.listeners.before.event_terminated["dapui_config"] = dapui.close - dap.listeners.before.event_exited["dapui_config"] = dapui.close - - -- Dap UI setup - -- For more information, see |:help nvim-dap-ui| - dapui.setup() - - require("nvim-dap-virtual-text").setup({ - -- enabled = true, -- enable this plugin (the default) - -- enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination) - -- highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText - -- highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables) - -- show_stop_reason = true, -- show stop reason when stopped for exceptions - -- commented = false, -- prefix virtual text with comment string - -- only_first_definition = true, -- only show virtual text at first definition (if there are multiple) - -- all_references = false, -- show virtual text on all all references of the variable (not only definitions) - -- clear_on_continue = false, -- clear virtual text on "continue" (might cause flickering when stepping) - -- --- A callback that determines how a variable is displayed or whether it should be omitted - -- --- variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable - -- --- buf number - -- --- stackframe dap.StackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame - -- --- node userdata tree-sitter node identified as variable definition of reference (see `:h tsnode`) - -- --- options nvim_dap_virtual_text_options Current options for nvim-dap-virtual-text - -- --- string|nil A text how the virtual text should be displayed or nil, if this variable shouldn't be displayed - -- display_callback = function(variable, buf, stackframe, node, options) - -- if options.virt_text_pos == "inline" then - -- return " = " .. variable.value - -- else - -- return variable.name .. " = " .. variable.value - -- end - -- end, - -- -- position of virtual text, see `:h nvim_buf_set_extmark()`, default tries to inline the virtual text. Use 'eol' to set to end of line - -- virt_text_pos = vim.fn.has("nvim-0.10") == 1 and "inline" or "eol", - -- - -- -- experimental features: - -- all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine. - -- virt_lines = false, -- show virtual lines instead of virtual text (will flicker!) - -- virt_text_win_col = nil, -- position the virtual text at a fixed window column (starting from the first text column) , - -- -- e.g. 80 to position at column 80, see `:h nvim_buf_set_extmark()` - }) - end, - }, -} diff --git a/lua/plugins/formatter.lua b/lua/plugins/formatter.lua deleted file mode 100644 index a18610a..0000000 --- a/lua/plugins/formatter.lua +++ /dev/null @@ -1,47 +0,0 @@ -return { - { - "conform.nvim", - event = { "BufReadPre", "BufNewFile" }, - for_cats = "core.general", - after = function() - local conform = require("conform") - - conform.setup({ - format_after_save = { - lsp_format = "fallback", - quiet = true, - }, - - formatters_by_ft = { - lua = { "stylua" }, - go = { "gofmt" }, - rust = { "rustfmt" }, - toml = { "tombi" }, - java = { "google-java-format" }, - cmake = { "cmake_format" }, - typescript = { "prettierd" }, - javascript = { "prettierd" }, - c = { "clang-format" }, - cpp = { "clang-format" }, - qml = { "qmlformat" }, - python = { "ruff_fix", "ruff_organize_imports", "ruff_format" }, - }, - - formatters = { - ["google-java-format"] = { - prepend_args = { "--aosp" }, - }, - ["clang-format"] = { - prepend_args = { "-style={BasedOnStyle: LLVM, IndentWidth: 4, TabWidth: 4, UseTab: Never}" }, - }, - }, - }) - - vim.keymap.set({ "n", "v" }, "lf", function() - conform.format({ async = true }) - end, { - desc = "Language format", - }) - end, - }, -} diff --git a/lua/plugins/general.lua b/lua/plugins/general.lua deleted file mode 100644 index 6716bbc..0000000 --- a/lua/plugins/general.lua +++ /dev/null @@ -1,134 +0,0 @@ -return { - { - "guess-indent.nvim", - for_cat = "core.general", - event = "DeferredUIEnter", - after = function() - require("guess-indent").setup({ - auto_cmd = true, - override_editorconfig = true, - filetype_exclude = { - "netrw", - "tutor", - "oil", - "gitcommit", - }, - buftype_exclude = { - "help", - "nofile", - "terminal", - "prompt", - }, - on_tab_options = { - ["expandtab"] = false, - }, - on_space_options = { - ["expandtab"] = true, - ["tabstop"] = "detected", - ["softtabstop"] = "detected", - ["shiftwidth"] = "detected", - }, - }) - end, - }, - { - "nvim-surround", - for_cat = "core.general", - event = { "BufReadPre", "BufNewFile" }, - after = function() - require("nvim-surround").setup() - end, - }, - { - "oil.nvim", - keys = { { "o", "Oil", desc = "Open oil" } }, - for_cat = "core.general", - after = function() - require("oil").setup({ - default_file_explorer = true, - columns = { "icon", "permissions", "size" }, - keymaps = { - ["-"] = "actions.parent", - [""] = "actions.select", - [""] = "actions.select_vsplit", - [""] = "actions.select_split", - }, - }) - end, - }, - { - "undotree", - for_cat = "core.general", - cmd = { "UndotreeToggle", "UndotreeHide", "UndotreeShow", "UndotreeFocus", "UndotreePersistUndo" }, - keys = { { "U", "UndotreeToggle", mode = { "n" }, desc = "Undo Tree" } }, - before = function(_) - vim.g.undotree_WindowLayout = 1 - vim.g.undotree_SplitWidth = 40 - vim.g.undotree_WindowLayout = 3 - end, - }, - { - "lazydev.nvim", - ft = "lua", - after = function() - require("lazydev").setup({ - library = { - { path = "${3rd}/luv/library", words = { "vim%.uv" } }, - }, - - integrations = { - -- Fixes lspconfig's workspace management for LuaLS - -- Only create a new workspace if the buffer is not part - -- of an existing workspace or one of its libraries - lspconfig = true, - -- add the cmp source for completion of: - -- `require "modname"` - -- `---@module "modname"` - cmp = true, - -- same, but for Coq - coq = false, - }, - }) - end, - }, - { - "trouble.nvim", - for_cat = "core.general", - cmd = "Trouble", - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - { - "xX", - "Trouble diagnostics toggle filter.buf=0", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "cs", - "Trouble symbols toggle focus=false", - desc = "Symbols (Trouble)", - }, - { - "cl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references / ... (Trouble)", - }, - { - "xL", - "Trouble loclist toggle", - desc = "Location List (Trouble)", - }, - { - "xQ", - "Trouble qflist toggle", - desc = "Quickfix List (Trouble)", - }, - }, - after = function() - require("trouble").setup() - end, - }, -} diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua deleted file mode 100644 index 0e333f8..0000000 --- a/lua/plugins/git.lua +++ /dev/null @@ -1,98 +0,0 @@ -return { - { - "neogit", - for_cat = "core.git", - keys = { { "gg", "Neogit", desc = "Open Neogit Ui" } }, - cmd = { "Neogit" }, - after = function() - require("neogit").setup({ - disable_hint = true, - kind = "split_above", - - commit_editor = { - kind = "tab", - show_staged_diff = true, - staged_diff_split_kind = "auto", - spell_check = true, - }, - }) - end, - }, - { - "gitsigns.nvim", - event = { "DeferredUIEnter" }, - for_cat = "core.git", - after = function(_) - require("gitsigns").setup({ - signs = { - add = { text = "+" }, - change = { text = "~" }, - delete = { text = "_" }, - topdelete = { text = "‾" }, - changedelete = { text = "~" }, - }, - - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map({ "n", "v" }, "]c", function() - if vim.wo.diff then - return "]c" - end - vim.schedule(function() - gs.next_hunk() - end) - return "" - end, { expr = true, desc = "Jump to next hunk" }) - - map({ "n", "v" }, "[c", function() - if vim.wo.diff then - return "[c" - end - vim.schedule(function() - gs.prev_hunk() - end) - return "" - end, { expr = true, desc = "Jump to previous hunk" }) - - -- Actions - -- visual mode - map("v", "hs", function() - gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, { desc = "stage git hunk" }) - map("v", "hr", function() - gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, { desc = "reset git hunk" }) - -- normal mode - map("n", "gs", gs.stage_hunk, { desc = "git stage hunk" }) - map("n", "gr", gs.reset_hunk, { desc = "git reset hunk" }) - map("n", "gS", gs.stage_buffer, { desc = "git Stage buffer" }) - map("n", "gu", gs.undo_stage_hunk, { desc = "undo stage hunk" }) - map("n", "gR", gs.reset_buffer, { desc = "git Reset buffer" }) - map("n", "gp", gs.preview_hunk, { desc = "preview git hunk" }) - map("n", "gb", function() - gs.blame_line({ full = false }) - end, { desc = "git blame line" }) - -- map('n', 'gd', gs.diffthis, { desc = 'git diff against index' }) - map("n", "gD", function() - gs.diffthis("~") - end, { desc = "git diff against last commit" }) - - -- Toggles - map("n", "gtb", gs.toggle_current_line_blame, { desc = "toggle git blame line" }) - map("n", "gtd", gs.toggle_deleted, { desc = "toggle git show deleted" }) - - -- Text object - map({ "o", "x" }, "ih", ":Gitsigns select_hunk", { desc = "select git hunk" }) - end, - }) - end, - }, -} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua deleted file mode 100644 index 33575ee..0000000 --- a/lua/plugins/init.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - { import = "plugins.ai" }, - { import = "plugins.general" }, - { import = "plugins.completion" }, - { import = "plugins.git" }, - { import = "plugins.formatter" }, - { import = "plugins.tsitter" }, - { import = "plugins.misc" }, - { import = "plugins.picker" }, - { import = "plugins.debug" }, - { import = "plugins.linter" }, - { import = "plugins.ui" }, -} diff --git a/lua/plugins/linter.lua b/lua/plugins/linter.lua deleted file mode 100644 index bd798ba..0000000 --- a/lua/plugins/linter.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - { - "nvim-lint", - event = { "BufReadPre", "BufNewFile" }, - for_cats = "core.general", - after = function() - local lint = require("lint") - - lint.linters_by_ft = { - python = { "ruff" }, - go = { "golangcilint" }, - -- rust = { "clippy" }, - c = { "clangtidy" }, - cpp = { "clangtidy" }, - java = { "checkstyle" }, - cmake = { "cmakelint" }, - javascript = { "eslint_d" }, - typescript = { "eslint_d" }, - } - - local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) - - vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost" }, { - group = lint_augroup, - callback = function() - lint.try_lint(nil, { ignore_errors = true }) - end, - }) - - vim.api.nvim_create_autocmd({ "InsertLeave" }, { - group = lint_augroup, - callback = function() - if vim.bo.filetype ~= "rust" then - lint.try_lint(nil, { ignore_errors = true }) - end - end, - }) - end, - }, -} diff --git a/lua/plugins/misc.lua b/lua/plugins/misc.lua deleted file mode 100644 index 37185ae..0000000 --- a/lua/plugins/misc.lua +++ /dev/null @@ -1,50 +0,0 @@ -return { - { - "obsidian.nvim", - for_cats = "misc", - event = { - "BufReadPre " .. vim.fn.expand("~") .. "/Notes/**/*.md", - "BufNewFile " .. vim.fn.expand("~") .. "/Notes/**/*.md", - }, - after = function() - require("obsidian").setup({ - legacy_commands = false, - workspaces = { - { - name = "personal", - path = "~/Notes", - }, - }, - }) - end, - }, - { - "typst-preview.nvim", - ft = "typst", - for_cats = "misc", - after = function() - require("typst-preview").setup({ - debug = false, - open_cmd = nil, - port = nil, - invert_colors = "never", - follow_cursor = true, - dependencies_bin = { - tinymist = "tinymist", - websocat = "websocat", - }, - extra_args = nil, - get_root = function(path_of_main_file) - local root = os.getenv("TYPST_ROOT") - if root then - return root - end - return vim.fn.fnamemodify(path_of_main_file, ":p:h") - end, - get_main_file = function(path_of_buffer) - return path_of_buffer - end, - }) - end, - }, -} diff --git a/lua/plugins/picker.lua b/lua/plugins/picker.lua deleted file mode 100644 index bf60d6a..0000000 --- a/lua/plugins/picker.lua +++ /dev/null @@ -1,97 +0,0 @@ -local telescope_builtin = function(key, action, desc) - return { - key, - "Telescope " .. action .. "", - mode = { "n" }, - desc = desc, - } -end - -return { - { - "telescope.nvim", - event = "DeferredUIEnter", - for_cat = "core.picker", - keys = { - telescope_builtin("ff", "find_files", "Search files in cwd"), - telescope_builtin("fb", "buffers", "Search files in cwd"), - telescope_builtin("fo", "oldfiles", "Recent files"), - telescope_builtin("fr", "registers", "Registers"), - telescope_builtin("fj", "jumplist", "Jump list"), - telescope_builtin("fm", "marks", "Marks"), - - telescope_builtin("fq", "quickfix", "Quickfix list"), - telescope_builtin("fl", "loclist", "Location list"), - - telescope_builtin("st", "treesitter", "Treesitter symbols"), - - telescope_builtin("sc", "commands", "Commands"), - telescope_builtin("sp", "spell_suggest", "Spell suggestions"), - - telescope_builtin("sg", "live_grep", "Search by grep"), - telescope_builtin("ss", "grep_string", "Search string"), - telescope_builtin("sk", "keymaps", "Search keymaps"), - telescope_builtin("sh", "help_tags", "Search help tags"), - telescope_builtin("/", "current_buffer_fuzzy_find", "Search in current buffer"), - - telescope_builtin("gc", "git_commits", "Git commits"), - telescope_builtin("gB", "git_branches", "Git branches"), - telescope_builtin("gs", "git_status", "Git status"), - telescope_builtin("gS", "git_stash", "Git stash"), - - telescope_builtin("ls", "lsp_document_symbols", "Document symbols"), - telescope_builtin("lS", "lsp_workspace_symbols", "Workspace symbols"), - telescope_builtin("lds", "lsp_dynamic_workspace_symbols", "Workspace symbols"), - telescope_builtin("ld", "diagnostics", "Diagnostics"), - telescope_builtin("lD", "lsp_definitions", "LSP definitions"), - telescope_builtin("li", "lsp_incoming_calls", "LSP incoming calls"), - telescope_builtin("lo", "lsp_outgoing_calls", "LSP outgoing calls"), - telescope_builtin("lt", "lsp_type_definitions", "LSP type definitions"), - telescope_builtin("grr", "lsp_references", "LSP references"), - telescope_builtin("gri", "lsp_implementations", "LSP implementations"), - }, - load = function(name) - require("lzextras").loaders.multi({ - name, - "telescope-fzf-native.nvim", - "telescope-ui-select.nvim", - }) - end, - after = function() - require("telescope").setup({ - defaults = { - mappings = { - i = { - [""] = "to_fuzzy_refine", - }, - }, - }, - pickers = { - buffers = { - mappings = { - i = { - -- [""] = "delete_buffer", - }, - n = { - ["d"] = "delete_buffer", - }, - }, - }, - }, - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - }, - ["ui-select"] = { - require("telescope.themes").get_dropdown({}), - }, - }, - }) - require("telescope").load_extension("fzf") - require("telescope").load_extension("ui-select") - end, - }, -} diff --git a/lua/plugins/tsitter.lua b/lua/plugins/tsitter.lua deleted file mode 100644 index 0816c23..0000000 --- a/lua/plugins/tsitter.lua +++ /dev/null @@ -1,187 +0,0 @@ -return { - { - "nvim-treesitter", - lazy = false, - for_cats = "tsitter", - after = function(plugin) - ---@param buf integer - ---@param language string - local function treesitter_try_attach(buf, language) - -- check if parser exists and load it - if not vim.treesitter.language.add(language) then - return false - end - -- enables syntax highlighting and other treesitter features - vim.treesitter.start(buf, language) - - -- enables treesitter based folds - vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" - - -- enables treesitter based indentation - vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" - - return true - end - - local installable_parsers = require("nvim-treesitter").get_available() - vim.api.nvim_create_autocmd("FileType", { - callback = function(args) - local buf, filetype = args.buf, args.match - local language = vim.treesitter.language.get_lang(filetype) - if not language then - return - end - - if not treesitter_try_attach(buf, language) then - if vim.tbl_contains(installable_parsers, language) then - -- not already installed, so try to install them via nvim-treesitter if possible - require("nvim-treesitter").install(language):await(function() - treesitter_try_attach(buf, language) - end) - end - end - end, - }) - end, - }, - - { - "nvim-treesitter-textobjects", - auto_enable = true, - for_cats = "tsitter", - lazy = false, - before = function(plugin) - -- https://github.com/nvim-treesitter/nvim-treesitter-textobjects/tree/main?tab=readme-ov-file#using-a-package-manager - -- Disable entire built-in ftplugin mappings to avoid conflicts. - -- See https://github.com/neovim/neovim/tree/master/runtime/ftplugin for built-in ftplugins. - vim.g.no_plugin_maps = true - - -- Or, disable per filetype (add as you like) - -- vim.g.no_python_maps = true - -- vim.g.no_ruby_maps = true - -- vim.g.no_rust_maps = true - -- vim.g.no_go_maps = true - end, - after = function(plugin) - require("nvim-treesitter-textobjects").setup({ - select = { - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, - -- You can choose the select mode (default is charwise 'v') - -- - -- Can also be a function which gets passed a table with the keys - -- * query_string: eg '@function.inner' - -- * method: eg 'v' or 'o' - -- and should return the mode ('v', 'V', or '') or a table - -- mapping query_strings to modes. - selection_modes = { - ["@parameter.outer"] = "v", -- charwise - ["@function.outer"] = "V", -- linewise - -- ['@class.outer'] = '', -- blockwise - }, - -- If you set this to `true` (default is `false`) then any textobject is - -- extended to include preceding or succeeding whitespace. Succeeding - -- whitespace has priority in order to act similarly to eg the built-in - -- `ap`. - -- - -- Can also be a function which gets passed a table with the keys - -- * query_string: eg '@function.inner' - -- * selection_mode: eg 'v' - -- and should return true of false - include_surrounding_whitespace = false, - }, - move = { - set_jumps = true, - }, - }) - - -- keymaps - -- You can use the capture groups defined in `textobjects.scm` - vim.keymap.set({ "x", "o" }, "am", function() - require("nvim-treesitter-textobjects.select").select_textobject("@function.outer", "textobjects") - end) - vim.keymap.set({ "x", "o" }, "im", function() - require("nvim-treesitter-textobjects.select").select_textobject("@function.inner", "textobjects") - end) - vim.keymap.set({ "x", "o" }, "ac", function() - require("nvim-treesitter-textobjects.select").select_textobject("@class.outer", "textobjects") - end) - vim.keymap.set({ "x", "o" }, "ic", function() - require("nvim-treesitter-textobjects.select").select_textobject("@class.inner", "textobjects") - end) - -- You can also use captures from other query groups like `locals.scm` - vim.keymap.set({ "x", "o" }, "as", function() - require("nvim-treesitter-textobjects.select").select_textobject("@local.scope", "locals") - end) - vim.keymap.set("n", "a", function() - require("nvim-treesitter-textobjects.swap").swap_next("@parameter.inner") - end) - vim.keymap.set("n", "A", function() - require("nvim-treesitter-textobjects.swap").swap_previous("@parameter.outer") - end) - - -- You can use the capture groups defined in `textobjects.scm` - vim.keymap.set({ "n", "x", "o" }, "]m", function() - require("nvim-treesitter-textobjects.move").goto_next_start("@function.outer", "textobjects") - end) - vim.keymap.set({ "n", "x", "o" }, "]]", function() - require("nvim-treesitter-textobjects.move").goto_next_start("@class.outer", "textobjects") - end) - -- You can also pass a list to group multiple queries. - vim.keymap.set({ "n", "x", "o" }, "]o", function() - require("nvim-treesitter-textobjects.move").goto_next_start( - { "@loop.inner", "@loop.outer" }, - "textobjects" - ) - end) - -- You can also use captures from other query groups like `locals.scm` or `folds.scm` - vim.keymap.set({ "n", "x", "o" }, "]s", function() - require("nvim-treesitter-textobjects.move").goto_next_start("@local.scope", "locals") - end) - vim.keymap.set({ "n", "x", "o" }, "]z", function() - require("nvim-treesitter-textobjects.move").goto_next_start("@fold", "folds") - end) - - vim.keymap.set({ "n", "x", "o" }, "]M", function() - require("nvim-treesitter-textobjects.move").goto_next_end("@function.outer", "textobjects") - end) - vim.keymap.set({ "n", "x", "o" }, "][", function() - require("nvim-treesitter-textobjects.move").goto_next_end("@class.outer", "textobjects") - end) - - vim.keymap.set({ "n", "x", "o" }, "[m", function() - require("nvim-treesitter-textobjects.move").goto_previous_start("@function.outer", "textobjects") - end) - vim.keymap.set({ "n", "x", "o" }, "[[", function() - require("nvim-treesitter-textobjects.move").goto_previous_start("@class.outer", "textobjects") - end) - - vim.keymap.set({ "n", "x", "o" }, "[M", function() - require("nvim-treesitter-textobjects.move").goto_previous_end("@function.outer", "textobjects") - end) - vim.keymap.set({ "n", "x", "o" }, "[]", function() - require("nvim-treesitter-textobjects.move").goto_previous_end("@class.outer", "textobjects") - end) - local ts_repeat_move = require("nvim-treesitter-textobjects.repeatable_move") - - -- Repeat movement with ; and , - -- ensure ; goes forward and , goes backward regardless of the last direction - -- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_next) - -- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_previous) - - -- vim way: ; goes to the direction you were moving. - vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move) - vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite) - - -- Optionally, make builtin f, F, t, T also repeatable with ; and , - vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f_expr, { expr = true }) - vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F_expr, { expr = true }) - vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t_expr, { expr = true }) - vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T_expr, { expr = true }) - - -- NOTE: for more textobjects options, see the following link. - -- This template is using the new `main` branch of the repo. - -- https://github.com/nvim-treesitter/nvim-treesitter-textobjects/tree/main - end, - }, -} diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua deleted file mode 100644 index b2094eb..0000000 --- a/lua/plugins/ui.lua +++ /dev/null @@ -1,86 +0,0 @@ -return { - { - "lualine.nvim", - for_cats = "ui", - event = { "DeferredUIEnter" }, - after = function() - require("lualine").setup({ - options = { - component_separators = { left = "|", right = "|" }, - section_separators = {}, - }, - sections = { - lualine_a = { - { - "mode", - fmt = function(mode) - return ({ - NORMAL = "(。•ᴗ•。)", - INSERT = "(づ。◕‿‿◕。)づ", - VISUAL = "(≧◡≦)", - ["V-LINE"] = "(≧▿≦)", - ["V-BLOCK"] = "(☆ω☆)", - COMMAND = "( ̄ω ̄)", - REPLACE = "(;ω;)", - TERMINAL = "(^▽^)", - })[mode] or mode - end, - }, - }, - }, - }) - end, - }, - { - "hlchunk.nvim", - for_cats = "ui", - event = { "BufReadPre", "BufNewFile" }, - after = function() - local ignored_filetypes = { - gitcommit = true, - oil = true, - Neogitstatus = true, - TelescopePrompt = true, - NvimTree = true, - help = true, - nix = true, - } - - require("hlchunk").setup({ - chunk = { - enable = true, - priority = 15, - -- style = { - -- vim.api.nvim_get_hl(0, { name = "IndentBlanklineIndent1" }), - -- vim.api.nvim_get_hl(0, { name = "DiagnosticError" }), - -- }, - use_treesitter = false, - chars = { - horizontal_line = "─", - vertical_line = "│", - left_top = "┌", - left_bottom = "└", - right_arrow = "─", - }, - textobject = "", - exclude_filetypes = ignored_filetypes, - max_file_size = 1024 * 1024, - error_sign = true, - -- animation related - duration = 200, - delay = 300, - }, - indent = { - enable = true, - priority = 10, - style = { vim.api.nvim_get_hl(0, { name = "Whitespace" }) }, - use_treesitter = false, - exclude_filetypes = ignored_filetypes, - chars = { "│" }, - ahead_lines = 5, - delay = 100, - }, - }) - end, - }, -} -- cgit v1.3.1