diff options
| author | Sakamoto <me@sakamoto.network> | 2026-05-12 18:31:15 -0500 |
|---|---|---|
| committer | Sakamoto <me@sakamoto.network> | 2026-05-12 18:31:15 -0500 |
| commit | a623fed63460d6d810605ce1ce858a58a5b222f7 (patch) | |
| tree | 2129e72acc82deaf624630ec271942000eae0aeb /dot_config/nvim/lua | |
| download | dotfiles-a623fed63460d6d810605ce1ce858a58a5b222f7.tar.xz dotfiles-a623fed63460d6d810605ce1ce858a58a5b222f7.zip | |
init
Diffstat (limited to 'dot_config/nvim/lua')
29 files changed, 738 insertions, 0 deletions
diff --git a/dot_config/nvim/lua/plugins/blink.lua b/dot_config/nvim/lua/plugins/blink.lua new file mode 100644 index 0000000..3a03cde --- /dev/null +++ b/dot_config/nvim/lua/plugins/blink.lua @@ -0,0 +1,63 @@ +return { + "saghen/blink.cmp", + -- optional: provides snippets for the snippet source + dependencies = { "rafamadriz/friendly-snippets" }, + + -- use a release tag to download pre-built binaries + version = "*", + -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + -- build = 'cargo build --release', + -- If you use nix, you can build from source using latest nightly rust with: + -- build = 'nix run .#build-plugin', + + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) + -- 'super-tab' for mappings similar to vscode (tab to accept) + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- All presets have the following mappings: + -- C-space: Open menu or open docs if already open + -- C-n/C-p or Up/Down: Select next/previous item + -- C-e: Hide menu + -- C-k: Toggle signature help (if signature.enabled = true) + -- + -- See :h blink-cmp-config-keymap for defining your own keymap + keymap = { + preset = "super-tab", + }, + signature = { + enabled = true, + }, + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = "mono", + }, + completion = { + documentation = { + auto_show = true, + auto_show_delay_ms = 200, + }, + accept = { + auto_brackets = {enabled = true} + }, + }, + + -- Default list of enabled providers defined so that you can extend it + -- elsewhere in your config, without redefining it, due to `opts_extend` + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + }, + + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance + -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, + -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` + -- + -- See the fuzzy documentation for more information + fuzzy = { implementation = "prefer_rust_with_warning" }, + }, + opts_extend = { "sources.default" }, +} diff --git a/dot_config/nvim/lua/plugins/dap.lua b/dot_config/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..0299847 --- /dev/null +++ b/dot_config/nvim/lua/plugins/dap.lua @@ -0,0 +1,150 @@ +return { + -- "rcarriga/nvim-dap-ui", + "igorlfs/nvim-dap-view", + dependencies = { + "mfussenegger/nvim-dap", + "nvim-neotest/nvim-nio", + { "theHamsta/nvim-dap-virtual-text", opts = {} }, + }, + keys = { + { + "<leader>dB", + function() + require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) + end, + desc = "Breakpoint Condition", + }, + { + "<leader>db", + function() + require("dap").toggle_breakpoint() + end, + desc = "Toggle Breakpoint", + }, + { + "<leader>dc", + function() + require("dap").continue() + end, + desc = "Run/Continue", + }, + { + "<leader>da", + function() + require("dap").continue({ before = get_args }) + end, + desc = "Run with Args", + }, + { + "<leader>dC", + function() + require("dap").run_to_cursor() + end, + desc = "Run to Cursor", + }, + { + "<leader>dg", + function() + require("dap").goto_() + end, + desc = "Go to Line (No Execute)", + }, + { + "<leader>di", + function() + require("dap").step_into() + end, + desc = "Step Into", + }, + { + "<leader>dj", + function() + require("dap").down() + end, + desc = "Down", + }, + { + "<leader>dk", + function() + require("dap").up() + end, + desc = "Up", + }, + { + "<leader>dl", + function() + require("dap").run_last() + end, + desc = "Run Last", + }, + { + "<leader>do", + function() + require("dap").step_out() + end, + desc = "Step Out", + }, + { + "<leader>dO", + function() + require("dap").step_over() + end, + desc = "Step Over", + }, + { + "<leader>dP", + function() + require("dap").pause() + end, + desc = "Pause", + }, + { + "<leader>dr", + function() + require("dap").repl.toggle() + end, + desc = "Toggle REPL", + }, + { + "<leader>ds", + function() + require("dap").session() + end, + desc = "Session", + }, + { + "<leader>dt", + function() + require("dap").terminate() + end, + desc = "Terminate", + }, + { + "<leader>dw", + function() + require("dap.ui.widgets").hover() + end, + desc = "Widgets", + }, + }, + config = function() + local dap = require("dap") + -- local dapui = require("dapui") + local dapui = require("dap-view") + + dapui.setup() + + dap.listeners.before.attach.dapui_config = function() + dapui.open() + end + dap.listeners.before.launch.dapui_config = function() + dapui.open() + end + dap.listeners.before.event_terminated.dapui_config = function() + dapui.close() + end + dap.listeners.before.event_exited.dapui_config = function() + dapui.close() + end + end, +} diff --git a/dot_config/nvim/lua/plugins/diffview.lua b/dot_config/nvim/lua/plugins/diffview.lua new file mode 100644 index 0000000..aab3fd3 --- /dev/null +++ b/dot_config/nvim/lua/plugins/diffview.lua @@ -0,0 +1,3 @@ +return { + "sindrets/diffview.nvim" +} diff --git a/dot_config/nvim/lua/plugins/fidget.lua b/dot_config/nvim/lua/plugins/fidget.lua new file mode 100644 index 0000000..2d70394 --- /dev/null +++ b/dot_config/nvim/lua/plugins/fidget.lua @@ -0,0 +1,6 @@ +return { + "j-hui/fidget.nvim", + opts = { + -- options + }, +} diff --git a/dot_config/nvim/lua/plugins/flash.lua b/dot_config/nvim/lua/plugins/flash.lua new file mode 100644 index 0000000..c3d267a --- /dev/null +++ b/dot_config/nvim/lua/plugins/flash.lua @@ -0,0 +1,14 @@ +return { + "folke/flash.nvim", + event = "VeryLazy", + ---@type Flash.Config + config = {}, + -- stylua: ignore + keys = { + { "<Enter>", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "<S-Enter>", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} diff --git a/dot_config/nvim/lua/plugins/fzf.lua b/dot_config/nvim/lua/plugins/fzf.lua new file mode 100644 index 0000000..78039d8 --- /dev/null +++ b/dot_config/nvim/lua/plugins/fzf.lua @@ -0,0 +1,13 @@ +return { + "ibhagwan/fzf-lua", + lazy = false, + dependencies = { "nvim-tree/nvim-web-devicons" }, + keys = { + { "<leader><leader>", "<cmd>FzfLua files<cr>" }, + { "<tab>", "<cmd>FzfLua buffers<cr>" }, + { "<leader>f", "<cmd>FzfLua live_grep<cr>" }, + }, + config = function() + require("fzf-lua").register_ui_select() + end, +} diff --git a/dot_config/nvim/lua/plugins/lsp.lua b/dot_config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..cd9ff77 --- /dev/null +++ b/dot_config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,61 @@ +return { + "neovim/nvim-lspconfig", + config = function() + -- auto format + vim.cmd([[autocmd BufWritePre * lua vim.lsp.buf.format()]]) + + -- Global mappings. + -- See `:help vim.diagnostic.*` for documentation on any of the below functions + vim.keymap.set("n", "<leader>gm", vim.diagnostic.open_float) + vim.keymap.set("n", "[d", vim.diagnostic.goto_prev) + vim.keymap.set("n", "]d", vim.diagnostic.goto_next) + vim.keymap.set("n", "<leader>q", vim.diagnostic.setqflist) + vim.lsp.enable('clangd') + + -- Use LspAttach autocommand to only map the following keys + -- after the language server attaches to the current buffer + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + -- Enable completion triggered by <c-x><c-o> + -- vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf } + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) + vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts) + vim.keymap.set("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts) + vim.keymap.set("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts) + vim.keymap.set("n", "<leader>wl", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, opts) + vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, opts) + vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "<A-CR>", vim.lsp.buf.code_action, opts) + vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) + vim.keymap.set("n", "<leader>f", function() + vim.lsp.buf.format({ async = true }) + end, opts) + end, + vim.keymap.set("n", "<leader>i", function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ 0 }), { 0 }) + end, opts), + }) + + vim.diagnostic.config({ + -- Use the default configuration + virtual_lines = true, + + -- Alternatively, customize specific options + virtual_lines = { + -- Only show virtual line diagnostics for the current cursor line + current_line = true, + }, + }) + end, + + vim.lsp.enable('tinymist'), +} diff --git a/dot_config/nvim/lua/plugins/markdown.lua b/dot_config/nvim/lua/plugins/markdown.lua new file mode 100644 index 0000000..0dadc46 --- /dev/null +++ b/dot_config/nvim/lua/plugins/markdown.lua @@ -0,0 +1,7 @@ +return { + "MeanderingProgrammer/render-markdown.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons + ---@module 'render-markdown' + ---@type render.md.UserConfig + opts = {}, +} diff --git a/dot_config/nvim/lua/plugins/oil.lua b/dot_config/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..cd3a83d --- /dev/null +++ b/dot_config/nvim/lua/plugins/oil.lua @@ -0,0 +1,20 @@ +return { + "stevearc/oil.nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, +keys = { + { "<leader>e", "<cmd>Oil<CR>"}, + { "<leader>df", "<cmd>Oil ~/.config/nvim/<CR>"}, +}, + opts = { + win_options = { + signcolumn = "yes:2", + }, + view_options = { + -- Show files and directories that start with "." + show_hidden = true, + }, + delete_to_trash = true, + } +} diff --git a/dot_config/nvim/lua/plugins/rustaceanvim.lua b/dot_config/nvim/lua/plugins/rustaceanvim.lua new file mode 100644 index 0000000..72f1de5 --- /dev/null +++ b/dot_config/nvim/lua/plugins/rustaceanvim.lua @@ -0,0 +1,30 @@ +return { + "mrcjkb/rustaceanvim", + version = "^5", -- Recommended + lazy = false, -- This plugin is already lazy + config = function() + vim.g.rustaceanvim = function() + -- Update this path + local extension_path = "/usr/lib/codelldb/" + local codelldb_path = extension_path .. "adapter/codelldb" + local liblldb_path = extension_path .. "lldb/lib/liblldb" + local this_os = vim.uv.os_uname().sysname + + -- The path is different on Windows + if this_os:find("Windows") then + codelldb_path = extension_path .. "adapter\\codelldb.exe" + liblldb_path = extension_path .. "lldb\\bin\\liblldb.dll" + else + -- The liblldb extension is .so for Linux and .dylib for MacOS + liblldb_path = liblldb_path .. (this_os == "Linux" and ".so" or ".dylib") + end + + local cfg = require("rustaceanvim.config") + return { + dap = { + adapter = cfg.get_codelldb_adapter(codelldb_path, liblldb_path), + }, + } + end + end, +} diff --git a/dot_config/nvim/lua/plugins/theme.lua b/dot_config/nvim/lua/plugins/theme.lua new file mode 100644 index 0000000..d682e12 --- /dev/null +++ b/dot_config/nvim/lua/plugins/theme.lua @@ -0,0 +1,12 @@ +return { + "sainnhe/gruvbox-material", + lazy = false, + priority = 1000, + config = function() + -- Optionally configure and load the colorscheme + -- directly inside the plugin declaration. + vim.g.gruvbox_material_enable_italic = true + vim.g.gruvbox_material_transparent_background = 2 + vim.cmd.colorscheme("gruvbox-material") + end, +} diff --git a/dot_config/nvim/lua/plugins/trash/autopairs.luaa b/dot_config/nvim/lua/plugins/trash/autopairs.luaa new file mode 100644 index 0000000..2db00d8 --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/autopairs.luaa @@ -0,0 +1,7 @@ +return { + 'windwp/nvim-autopairs', + event = "InsertEnter", + config = true + -- use opts = {} for passing setup options + -- this is equivalent to setup({}) function +} diff --git a/dot_config/nvim/lua/plugins/trash/crates.luaa b/dot_config/nvim/lua/plugins/trash/crates.luaa new file mode 100644 index 0000000..f72a23f --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/crates.luaa @@ -0,0 +1,17 @@ +return { + "saecki/crates.nvim", + tag = "stable", + config = function() + require("crates").setup({ + lsp = { + enabled = true, + on_attach = function(client, bufnr) + -- the same on_attach function as for your other lsp's + end, + actions = true, + completion = true, + hover = true, + }, + }) + end, +} diff --git a/dot_config/nvim/lua/plugins/trash/grapple.luaa b/dot_config/nvim/lua/plugins/trash/grapple.luaa new file mode 100644 index 0000000..2d80958 --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/grapple.luaa @@ -0,0 +1,14 @@ +return { + "cbochs/grapple.nvim", + opts = { + scope = "git", -- also try out "git_branch" + }, + event = { "BufReadPost", "BufNewFile" }, + cmd = "Grapple", + keys = { + { "<leader>m", "<cmd>Grapple toggle<cr>", desc = "Grapple tag" }, + { "<leader>M", "<cmd>Grapple toggle_tags<cr>", desc = "Grapple open tags window" }, + { "<leader>n", "<cmd>Grapple cycle_tags next<cr>", desc = "Grapple cycle next tag" }, + { "<leader>p", "<cmd>Grapple cycle_tags prev<cr>", desc = "Grapple cycle previous tag" }, + }, +} diff --git a/dot_config/nvim/lua/plugins/trash/leetcode.luaa b/dot_config/nvim/lua/plugins/trash/leetcode.luaa new file mode 100644 index 0000000..a057b2d --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/leetcode.luaa @@ -0,0 +1,12 @@ +return { + "kawre/leetcode.nvim", + build = ":TSUpdate html", -- if you have `nvim-treesitter` installed + dependencies = { + -- include a picker of your choice, see picker section for more details + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + }, + opts = { + -- configuration goes here + }, +} diff --git a/dot_config/nvim/lua/plugins/trash/mini-pairs.luaa b/dot_config/nvim/lua/plugins/trash/mini-pairs.luaa new file mode 100644 index 0000000..ed48bfc --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/mini-pairs.luaa @@ -0,0 +1 @@ +return { 'echasnovski/mini.pairs', version = '*' , opts = {}} diff --git a/dot_config/nvim/lua/plugins/trash/neck.luaa b/dot_config/nvim/lua/plugins/trash/neck.luaa new file mode 100644 index 0000000..4b1eaf7 --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/neck.luaa @@ -0,0 +1 @@ +return {"shortcuts/no-neck-pain.nvim", version = "*"} diff --git a/dot_config/nvim/lua/plugins/trash/neogit.luaa b/dot_config/nvim/lua/plugins/trash/neogit.luaa new file mode 100644 index 0000000..b44d866 --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/neogit.luaa @@ -0,0 +1,9 @@ +return { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", -- required + "sindrets/diffview.nvim", -- optional - Diff integration + "ibhagwan/fzf-lua", + }, + config = true, +} diff --git a/dot_config/nvim/lua/plugins/trash/neorg.luaa b/dot_config/nvim/lua/plugins/trash/neorg.luaa new file mode 100644 index 0000000..abe7685 --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/neorg.luaa @@ -0,0 +1,24 @@ +return { + "nvim-neorg/neorg", + lazy = false, + version = "*", + config = function() + require("neorg").setup { + load = { + ["core.defaults"] = {}, + ["core.concealer"] = {}, + ["core.dirman"] = { + config = { + workspaces = { + notes = "~/notes", + }, + default_workspace = "notes", + }, + }, + }, + } + + vim.wo.foldlevel = 99 + vim.wo.conceallevel = 2 + end, + } diff --git a/dot_config/nvim/lua/plugins/trash/neorg.luaaa b/dot_config/nvim/lua/plugins/trash/neorg.luaaa new file mode 100644 index 0000000..abe7685 --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/neorg.luaaa @@ -0,0 +1,24 @@ +return { + "nvim-neorg/neorg", + lazy = false, + version = "*", + config = function() + require("neorg").setup { + load = { + ["core.defaults"] = {}, + ["core.concealer"] = {}, + ["core.dirman"] = { + config = { + workspaces = { + notes = "~/notes", + }, + default_workspace = "notes", + }, + }, + }, + } + + vim.wo.foldlevel = 99 + vim.wo.conceallevel = 2 + end, + } diff --git a/dot_config/nvim/lua/plugins/trash/neotest.luaa b/dot_config/nvim/lua/plugins/trash/neotest.luaa new file mode 100644 index 0000000..4b75efb --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/neotest.luaa @@ -0,0 +1,82 @@ +return { + "nvim-neotest/neotest", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + }, + keys = { + { "<leader>t", "", desc = "+test" }, + { + "<leader>tt", + function() + require("neotest").run.run(vim.fn.expand("%")) + end, + desc = "Run File (Neotest)", + }, + { + "<leader>tT", + function() + require("neotest").run.run(vim.uv.cwd()) + end, + desc = "Run All Test Files (Neotest)", + }, + { + "<leader>tr", + function() + require("neotest").run.run() + end, + desc = "Run Nearest (Neotest)", + }, + { + "<leader>tl", + function() + require("neotest").run.run_last() + end, + desc = "Run Last (Neotest)", + }, + { + "<leader>ts", + function() + require("neotest").summary.toggle() + end, + desc = "Toggle Summary (Neotest)", + }, + { + "<leader>to", + function() + require("neotest").output.open({ enter = true, auto_close = true }) + end, + desc = "Show Output (Neotest)", + }, + { + "<leader>tO", + function() + require("neotest").output_panel.toggle() + end, + desc = "Toggle Output Panel (Neotest)", + }, + { + "<leader>tS", + function() + require("neotest").run.stop() + end, + desc = "Stop (Neotest)", + }, + { + "<leader>tw", + function() + require("neotest").watch.toggle(vim.fn.expand("%")) + end, + desc = "Toggle Watch (Neotest)", + }, + }, + config = function() + require("neotest").setup({ + adapters = { + require("rustaceanvim.neotest"), + }, + }) + end, +} diff --git a/dot_config/nvim/lua/plugins/trash/noice.luaa b/dot_config/nvim/lua/plugins/trash/noice.luaa new file mode 100644 index 0000000..99ad716 --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/noice.luaa @@ -0,0 +1,23 @@ +return { + 'folke/noice.nvim', + dependencies = {'MunifTanjim/nui.nvim'}, + event = "BufReadPost", + opts = { + lsp = { + progress = { + enabled = false, + }, + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = false, + inc_rename = true, + }, + }, +} diff --git a/dot_config/nvim/lua/plugins/trash/nvim-surround.luaa b/dot_config/nvim/lua/plugins/trash/nvim-surround.luaa new file mode 100644 index 0000000..c9bd7a2 --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/nvim-surround.luaa @@ -0,0 +1,10 @@ +return { + 'kylechui/nvim-surround', + version = '*', + opts = { + keymaps = { + visual = "gS", + visual_line = "gS", + }, + } +} diff --git a/dot_config/nvim/lua/plugins/trash/orgmode.luaa b/dot_config/nvim/lua/plugins/trash/orgmode.luaa new file mode 100644 index 0000000..ff383ff --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/orgmode.luaa @@ -0,0 +1,19 @@ +return { + 'nvim-orgmode/orgmode', + event = 'VeryLazy', + ft = { 'org' }, + config = function() + -- Setup orgmode + require('orgmode').setup({ + org_agenda_files = '~/orgfiles/**/*', + org_default_notes_file = '~/orgfiles/refile.org', + }) + + -- NOTE: If you are using nvim-treesitter with ~ensure_installed = "all"~ option + -- add ~org~ to ignore_install + -- require('nvim-treesitter.configs').setup({ + -- ensure_installed = 'all', + -- ignore_install = { 'org' }, + -- }) + end, +} diff --git a/dot_config/nvim/lua/plugins/trash/persistence.luaa b/dot_config/nvim/lua/plugins/trash/persistence.luaa new file mode 100644 index 0000000..e3b73fd --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/persistence.luaa @@ -0,0 +1,8 @@ +-- Lua +return { + "folke/persistence.nvim", + event = "BufReadPre", -- this will only start session saving when an actual file was opened + opts = { + -- add any custom options here + } +} diff --git a/dot_config/nvim/lua/plugins/trash/scroll.luaa b/dot_config/nvim/lua/plugins/trash/scroll.luaa new file mode 100644 index 0000000..120d141 --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/scroll.luaa @@ -0,0 +1,38 @@ +return { + "declancm/cinnamon.nvim", + version = "*", -- use latest release + config = function() + local cinnamon = require("cinnamon") + + cinnamon.setup() + + -- Centered scrolling: + vim.keymap.set("n", "<C-U>", function() + cinnamon.scroll("<C-U>zz") + end) + vim.keymap.set("n", "<C-D>", function() + cinnamon.scroll("<C-D>zz") + end) + + -- LSP: + vim.keymap.set("n", "gd", function() + cinnamon.scroll(vim.lsp.buf.definition) + end) + vim.keymap.set("n", "gD", function() + cinnamon.scroll(vim.lsp.buf.declaration) + end) + + -- Flash.nvim integration: + local flash = require("flash") + local jump = require("flash.jump") + + flash.setup({ + action = function(match, state) + cinnamon.scroll(function() + jump.jump(match, state) + jump.on_jump(state) + end) + end, + }) + end, +} diff --git a/dot_config/nvim/lua/plugins/trash/tabout.luaa b/dot_config/nvim/lua/plugins/trash/tabout.luaa new file mode 100644 index 0000000..cbc469a --- /dev/null +++ b/dot_config/nvim/lua/plugins/trash/tabout.luaa @@ -0,0 +1,31 @@ +return { + { + 'abecodes/tabout.nvim', + lazy = false, + config = function() + require('tabout').setup { + tabkey = '<Tab>', -- key to trigger tabout, set to an empty string to disable + backwards_tabkey = '<S-Tab>', -- key to trigger backwards tabout, set to an empty string to disable + act_as_tab = true, -- shift content if tab out is not possible + act_as_shift_tab = false, -- reverse shift content if tab out is not possible (if your keyboard/terminal supports <S-Tab>) + default_tab = '<C-t>', -- shift default action (only at the beginning of a line, otherwise <TAB> is used) + default_shift_tab = '<C-d>', -- reverse shift default action, + enable_backwards = true, -- well ... + completion = false, -- if the tabkey is used in a completion pum + tabouts = { + { open = "'", close = "'" }, + { open = '"', close = '"' }, + { open = '`', close = '`' }, + { open = '(', close = ')' }, + { open = '[', close = ']' }, + { open = '{', close = '}' } + }, + ignore_beginning = true, --[[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]] + exclude = {} -- tabout will ignore these filetypes + } + end, + opt = true, -- Set this to true if the plugin is optional + event = 'InsertCharPre', -- Set the event to 'InsertCharPre' for better compatibility + priority = 1000, + }, +} diff --git a/dot_config/nvim/lua/plugins/treesitter.lua b/dot_config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..c8f8919 --- /dev/null +++ b/dot_config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,22 @@ +return { -- Highlight, edit, and navigate code + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + branch = "main", + dependencies = { + "nvim-treesitter/nvim-treesitter-context" + }, + opts = { + ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc', 'markdown_inline', 'rust' }, + auto_install = true, + highlight = { + enable = true, + -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. |
