summaryrefslogtreecommitdiff
path: root/config/nvim/lua/plugins
diff options
context:
space:
mode:
author2025-06-09 13:43:45 +0300
committer2025-06-09 13:55:38 +0300
commit97af93b2a8ebc89364852e3f63e9fd8cfedaeedf (patch)
tree27e2added74ee6c0ff91c9e7927491c661a8bb36 /config/nvim/lua/plugins
parent04.06.2025 (diff)
downloaddotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.gz
dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.bz2
dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.xz
dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.zip
Перевёл dotfiles на stow
Diffstat (limited to 'config/nvim/lua/plugins')
-rw-r--r--config/nvim/lua/plugins/autosave.lua69
-rw-r--r--config/nvim/lua/plugins/blankline.lua7
-rw-r--r--config/nvim/lua/plugins/cmp.lua55
-rw-r--r--config/nvim/lua/plugins/columns.lua10
-rw-r--r--config/nvim/lua/plugins/conform.lua35
-rw-r--r--config/nvim/lua/plugins/dap.lua3
-rw-r--r--config/nvim/lua/plugins/dap_go.lua159
-rw-r--r--config/nvim/lua/plugins/dapui.lua73
-rw-r--r--config/nvim/lua/plugins/go.lua12
-rw-r--r--config/nvim/lua/plugins/goimpl.lua21
-rw-r--r--config/nvim/lua/plugins/headlines.lua5
-rw-r--r--config/nvim/lua/plugins/lsp_saga.lua8
-rw-r--r--config/nvim/lua/plugins/lsp_signature.lua15
-rw-r--r--config/nvim/lua/plugins/lualine.lua44
-rw-r--r--config/nvim/lua/plugins/resize.lua34
-rw-r--r--config/nvim/lua/plugins/telescope.lua50
-rw-r--r--config/nvim/lua/plugins/todo.lua69
-rw-r--r--config/nvim/lua/plugins/tree.lua54
-rw-r--r--config/nvim/lua/plugins/treesitter.lua53
19 files changed, 776 insertions, 0 deletions
diff --git a/config/nvim/lua/plugins/autosave.lua b/config/nvim/lua/plugins/autosave.lua
new file mode 100644
index 0000000..069afbf
--- /dev/null
+++ b/config/nvim/lua/plugins/autosave.lua
@@ -0,0 +1,69 @@
+return {
+ "okuuva/auto-save.nvim",
+ enabled = true,
+ cmd = "ASToggle", -- optional for lazy loading on command
+ event = { "InsertLeave", "TextChanged" }, -- optional for lazy loading on trigger events
+ opts = {
+ enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it)
+ trigger_events = { -- See :h events
+ -- -- vim events that trigger an immediate save
+ -- -- I'm disabling this, as it's autosaving when I leave the buffer and
+ -- -- that's autoformatting stuff if on insert mode and following a tutorial
+ -- -- Re-enabling this to only save if NOT in insert mode in the condition below
+ -- immediate_save = { nil },
+ immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, -- vim events that trigger an immediate save
+ -- vim events that trigger a deferred save (saves after `debounce_delay`)
+ defer_save = {
+ "InsertLeave",
+ "TextChanged",
+ { "User", pattern = "VisualLeave" },
+ { "User", pattern = "FlashJumpEnd" },
+ { "User", pattern = "SnacksInputLeave" },
+ { "User", pattern = "SnacksPickerInputLeave" },
+ },
+ cancel_deferred_save = {
+ "InsertEnter",
+ { "User", pattern = "VisualEnter" },
+ { "User", pattern = "FlashJumpStart" },
+ { "User", pattern = "SnacksInputEnter" },
+ { "User", pattern = "SnacksPickerInputEnter" },
+ },
+ },
+ -- function that takes the buffer handle and determines whether to save the current buffer or not
+ -- return true: if buffer is ok to be saved
+ -- return false: if it's not ok to be saved
+ -- if set to `nil` then no specific condition is applied
+ condition = function(buf)
+ -- Do not save when I'm in insert mode
+ -- Do NOT ADD VISUAL MODE HERE or the cancel_deferred_save wont' work
+ -- If I STAY in insert mode and switch to another app, like YouTube to
+ -- take notes, the BufLeave or FocusLost immediate_save will be ignored
+ -- and the save will not be triggered
+ local mode = vim.fn.mode()
+ if mode == "i" then
+ return false
+ end
+
+ -- Disable auto-save for the harpoon plugin, otherwise it just opens and closes
+ -- https://github.com/ThePrimeagen/harpoon/issues/434
+ --
+ -- don't save for `sql` file types
+ -- I do this so when working with dadbod the file is not saved every time
+ -- I make a change, and a SQL query executed
+ -- Run `:set filetype?` on a dadbod query to make sure of the filetype
+ local filetype = vim.bo[buf].filetype
+ if filetype == "harpoon" or filetype == "mysql" then
+ return false
+ end
+
+ return true
+ end,
+ write_all_buffers = true, -- write all buffers when the current one meets `condition`
+ noautocmd = false,
+ lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details
+ -- delay after which a pending save is executed (default 1000)
+ debounce_delay = 2000,
+ -- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable
+ debug = false,
+ },
+}
diff --git a/config/nvim/lua/plugins/blankline.lua b/config/nvim/lua/plugins/blankline.lua
new file mode 100644
index 0000000..b74d9e6
--- /dev/null
+++ b/config/nvim/lua/plugins/blankline.lua
@@ -0,0 +1,7 @@
+return {
+ "lukas-reineke/indent-blankline.nvim",
+ main = "ibl",
+ --@module "ibl"
+ --@type ibl.config
+ config = true,
+}
diff --git a/config/nvim/lua/plugins/cmp.lua b/config/nvim/lua/plugins/cmp.lua
new file mode 100644
index 0000000..718d8cb
--- /dev/null
+++ b/config/nvim/lua/plugins/cmp.lua
@@ -0,0 +1,55 @@
+local source_mapping = {
+ buffer = "[Buffer]",
+ nvim_lsp = "[LSP]",
+ nvim_lua = "[Lua]",
+ luasnip = "[Snip]",
+ path = "[Path]",
+}
+return {
+ "saghen/blink.cmp",
+ lazy = false,
+ version = "1.*",
+ dependencies = {
+ {
+ "L3MON4D3/LuaSnip",
+ version = "v2.*",
+ build = "make install_jsregexp",
+ dependencies = { "rafamadriz/friendly-snippets" },
+ config = function()
+ require("luasnip.loaders.from_vscode").lazy_load()
+ require("luasnip.loaders.from_vscode").lazy_load("./snippets")
+ end,
+ },
+ },
+ opts = {
+ keymap = {
+ preset = "enter",
+ },
+ completion = {
+ list = {
+ selection = {
+ preselect = false,
+ auto_insert = false,
+ },
+ },
+ ghost_text = {
+ enabled = true,
+ },
+ },
+ cmdline = {
+ keymap = {
+ preset = "inherit",
+ ['<Tab>'] = { 'show', 'accept' },
+ },
+ completion = {
+ menu = { auto_show = false },
+ ghost_text = { enabled = true },
+ },
+ sources = { "cmdline" },
+ },
+ snippets = { preset = "luasnip" },
+ sources = {
+ default = { "lsp", "path", "snippets", "buffer", "codecompanion" },
+ },
+ },
+}
diff --git a/config/nvim/lua/plugins/columns.lua b/config/nvim/lua/plugins/columns.lua
new file mode 100644
index 0000000..40806e2
--- /dev/null
+++ b/config/nvim/lua/plugins/columns.lua
@@ -0,0 +1,10 @@
+return {
+ "m4xshen/smartcolumn.nvim",
+ opts = {
+ colorcolumn = "80",
+ disabled_filetypes = { "help", "text" },
+ custom_colorcolumn = {},
+ scope = "file",
+ editorconfig = true,
+ },
+}
diff --git a/config/nvim/lua/plugins/conform.lua b/config/nvim/lua/plugins/conform.lua
new file mode 100644
index 0000000..3204d2d
--- /dev/null
+++ b/config/nvim/lua/plugins/conform.lua
@@ -0,0 +1,35 @@
+return {
+ "stevearc/conform.nvim",
+ opts = {
+ formatters_by_ft = {
+ javascript = { "prettier" },
+ typescript = { "prettier" },
+ javascriptreact = { "prettier" },
+ typescriptreact = { "prettier" },
+ css = { "prettier" },
+ html = { "prettier" },
+ json = { "prettier" },
+ yaml = { "prettier" },
+ markdown = { "prettier" },
+ graphql = { "prettier" },
+ lua = { "stylua" },
+ python = { "isort", "black" },
+ go = { "gofmt" },
+ templ = { "templ" },
+ },
+ format_on_save = {
+ lsp_fallback = true,
+ async = false,
+ timeout_ms = 500,
+ },
+ },
+ keys = {
+ {
+ "<leader>mp",
+ function()
+ require("conform").format({ lsp_fallback = true, async = false, timeout_ms = 500 })
+ end,
+ desc = "Format file or range (in visual mode)",
+ },
+ },
+}
diff --git a/config/nvim/lua/plugins/dap.lua b/config/nvim/lua/plugins/dap.lua
new file mode 100644
index 0000000..ab44a1e
--- /dev/null
+++ b/config/nvim/lua/plugins/dap.lua
@@ -0,0 +1,3 @@
+return {
+ "mfussenegger/nvim-dap",
+}
diff --git a/config/nvim/lua/plugins/dap_go.lua b/config/nvim/lua/plugins/dap_go.lua
new file mode 100644
index 0000000..705fab7
--- /dev/null
+++ b/config/nvim/lua/plugins/dap_go.lua
@@ -0,0 +1,159 @@
+local default_config = {
+ delve = {
+ path = "dlv",
+ initialize_timeout_sec = 20,
+ port = "${port}",
+ args = {},
+ build_flags = "",
+ -- Automatically handle the issue on delve Windows versions < 1.24.0
+ -- where delve needs to be run in attched mode or it will fail (actually crashes).
+ detached = vim.fn.has("win32") == 0,
+ output_mode = "remote",
+ cwd = nil,
+ },
+ tests = {
+ verbose = false,
+ },
+}
+
+local function setup_go_configuration(dap, configs)
+ local common_debug_configs = {
+ {
+ type = "go",
+ name = "Debug",
+ request = "launch",
+ program = "${workspaceFolder}",
+ args = {},
+ buildFlags = configs.delve.build_flags,
+ outputMode = configs.delve.output_mode,
+ },
+ }
+
+ if dap.configurations.go == nil then
+ dap.configurations.go = {}
+ end
+
+ for _, config in ipairs(common_debug_configs) do
+ table.insert(dap.configurations.go, config)
+ end
+
+ if configs == nil or configs.dap_configurations == nil then
+ return
+ end
+
+ for _, config in ipairs(configs.dap_configurations) do
+ if config.type == "go" then
+ table.insert(dap.configurations.go, config)
+ end
+ end
+end
+
+return {
+ "leoluz/nvim-dap-go",
+ dependencies = { "mfussenegger/nvim-dap" },
+ opts = true,
+ config = function()
+ local dap, dapui = require("dap"), require("dapui")
+
+ dap.adapters.go = {
+ type = "server",
+ port = "${port}",
+ executable = {
+ command = "dlv",
+ args = { "dap", "-l", "127.0.0.1:${port}" },
+ },
+ }
+
+ setup_go_configuration(dap, default_config)
+
+ dap.defaults.fallback.terminal_win_cmd = "enew | set filetype=dap-terminal"
+ 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
+
+ vim.api.nvim_set_hl(0, "DapBreakpoint", { ctermbg = 0, fg = "#993939", bg = "#31353f" })
+ vim.api.nvim_set_hl(0, "DapLogPoint", { ctermbg = 0, fg = "#61afef", bg = "#31353f" })
+ vim.api.nvim_set_hl(0, "DapStopped", { ctermbg = 0, fg = "#98c379", bg = "#31353f" })
+
+ vim.fn.sign_define(
+ "DapBreakpoint",
+ { text = "!", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
+ )
+ vim.fn.sign_define(
+ "DapBreakpointCondition",
+ { text = "?", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
+ )
+ vim.fn.sign_define(
+ "DapBreakpointRejected",
+ { text = "RJ", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
+ )
+ vim.fn.sign_define(
+ "DapLogPoint",
+ { text = "i", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" }
+ )
+ vim.fn.sign_define(
+ "DapStopped",
+ { text = "→", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
+ )
+ end,
+ keys = {
+ {
+ "<F5>",
+ function()
+ require("dap").continue()
+ end,
+ silent = true,
+ },
+ {
+ "<F17>", -- S-F5
+ function()
+ require("dap").restart()
+ end,
+ silent = true,
+ },
+ {
+ "<F29>", -- C-F5
+ function()
+ require("dap").terminate()
+ end,
+ silent = true,
+ },
+ {
+ "<F8>",
+ function()
+ require("dap").step_over()
+ end,
+ silent = true,
+ },
+ {
+ "<F7>",
+ function()
+ require("dap").step_into()
+ end,
+ silent = true,
+ },
+ {
+ "<F19>", -- S-F7
+ function()
+ require("dap").step_out()
+ end,
+ silent = true,
+ },
+ {
+ "<A-b>",
+ function()
+ require("dap").toggle_breakpoint()
+ end,
+ silent = true,
+ },
+ },
+}
diff --git a/config/nvim/lua/plugins/dapui.lua b/config/nvim/lua/plugins/dapui.lua
new file mode 100644
index 0000000..5d35e1e
--- /dev/null
+++ b/config/nvim/lua/plugins/dapui.lua
@@ -0,0 +1,73 @@
+return {
+ "rcarriga/nvim-dap-ui",
+ dependencies = {
+ "mfussenegger/nvim-dap",
+ "nvim-neotest/nvim-nio",
+ },
+ keys = {
+ {
+ "<F6>",
+ function()
+ require("dapui").toggle()
+ end,
+ silent = true,
+ },
+ {
+ "<Leader>dh",
+ function()
+ require("dap.ui.widgets").hover()
+ end,
+ silent = true,
+ },
+ {
+ "<Leader>dp",
+ function()
+ require("dap.ui.widgets").preview()
+ end,
+ silent = true,
+ },
+ {
+ "<F9>",
+ function()
+ local widgets = require("dap.ui.widgets")
+ widgets.centered_float(widgets.scopes)
+ end,
+ silent = true,
+ },
+ },
+ opts = {
+ icons = {
+ expanded = "[-]",
+ collapsed = "[+]",
+ },
+ mappings = {
+ open = "o",
+ remove = "d",
+ edit = "e",
+ repl = "r",
+ toggle = "t",
+ },
+ expand_lines = vim.fn.has("nvim-0.7"),
+ layouts = {
+ {
+ elements = {
+ "repl",
+ },
+ size = 0.3,
+ position = "bottom",
+ },
+ },
+ floating = {
+ max_height = nil,
+ max_width = nil,
+ border = "single",
+ mappings = {
+ close = { "q", "<Esc>" },
+ },
+ },
+ windows = { indent = 1 },
+ render = {
+ max_type_length = nil,
+ },
+ },
+}
diff --git a/config/nvim/lua/plugins/go.lua b/config/nvim/lua/plugins/go.lua
new file mode 100644
index 0000000..1078297
--- /dev/null
+++ b/config/nvim/lua/plugins/go.lua
@@ -0,0 +1,12 @@
+return {
+ "ray-x/go.nvim",
+ dependencies = {
+ "ray-x/guihua.lua",
+ "neovim/nvim-lspconfig",
+ "nvim-treesitter/nvim-treesitter",
+ },
+ config = true,
+ event = { "CmdlineEnter" },
+ ft = { "go", "gomod" },
+ build = ':lua require("go.install").update_all_sync()',
+}
diff --git a/config/nvim/lua/plugins/goimpl.lua b/config/nvim/lua/plugins/goimpl.lua
new file mode 100644
index 0000000..0b906fa
--- /dev/null
+++ b/config/nvim/lua/plugins/goimpl.lua
@@ -0,0 +1,21 @@
+return {
+ "edolphin-ydf/goimpl.nvim",
+ dependencies = {
+ "nvim-lua/plenary.nvim",
+ "nvim-lua/popup.nvim",
+ "nvim-telescope/telescope.nvim",
+ "nvim-treesitter/nvim-treesitter",
+ },
+ config = function()
+ require("telescope").load_extension("goimpl")
+ end,
+ keys = {
+ {
+ "<leader>im",
+ function()
+ require("telescope").extensions.goimpl.goimpl({})
+ end,
+ desc = "Generate stub for interface on a type for golang",
+ },
+ },
+}
diff --git a/config/nvim/lua/plugins/headlines.lua b/config/nvim/lua/plugins/headlines.lua
new file mode 100644
index 0000000..5d92245
--- /dev/null
+++ b/config/nvim/lua/plugins/headlines.lua
@@ -0,0 +1,5 @@
+return {
+ "lukas-reineke/headlines.nvim",
+ dependencies = "nvim-treesitter/nvim-treesitter",
+ config = true,
+ }
diff --git a/config/nvim/lua/plugins/lsp_saga.lua b/config/nvim/lua/plugins/lsp_saga.lua
new file mode 100644
index 0000000..ab8177f
--- /dev/null
+++ b/config/nvim/lua/plugins/lsp_saga.lua
@@ -0,0 +1,8 @@
+return {
+ "nvimdev/lspsaga.nvim",
+ opts = {
+ lightbulb = {
+ enable = false,
+ },
+ },
+}
diff --git a/config/nvim/lua/plugins/lsp_signature.lua b/config/nvim/lua/plugins/lsp_signature.lua
new file mode 100644
index 0000000..b9add0b
--- /dev/null
+++ b/config/nvim/lua/plugins/lsp_signature.lua
@@ -0,0 +1,15 @@
+return {
+ "ray-x/lsp_signature.nvim",
+ event = "VeryLazy",
+ opts = {
+ doc_lines = 1,
+ max_height = 3,
+ hint_prefix = "",
+ hint_prefix = {
+ above = "↙ ",
+ current = "← ",
+ below = "↖ ",
+ },
+ floating_window = true,
+ },
+}
diff --git a/config/nvim/lua/plugins/lualine.lua b/config/nvim/lua/plugins/lualine.lua
new file mode 100644
index 0000000..920e729
--- /dev/null
+++ b/config/nvim/lua/plugins/lualine.lua
@@ -0,0 +1,44 @@
+local colors = require("theme.colors")
+return {
+ "nvim-lualine/lualine.nvim",
+ opts = {
+ options = {
+ icons_enabled = true,
+ theme = "nightfly",
+ component_separators = { left = "", right = "" },
+ section_separators = { left = "", right = "" },
+ disabled_filetypes = {
+ statusline = {},
+ winbar = {},
+ },
+ ignore_focus = {},
+ always_divide_middle = true,
+ globalstatus = false,
+ refresh = {
+ statusline = 1000,
+ tabline = 1000,
+ winbar = 1000,
+ },
+ },
+ sections = {
+ lualine_a = { "mode" },
+ lualine_b = { "branch", "diff", "diagnostics" },
+ lualine_c = { "filename" },
+ lualine_x = { "filetype" },
+ lualine_y = { "progress", "location" },
+ lualine_z = { "lsp_status", "os.date('%H:%M')" },
+ },
+ inactive_sections = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_c = { "filename" },
+ lualine_x = { "location" },
+ lualine_y = {},
+ lualine_z = {},
+ },
+ tabline = {},
+ winbar = {},
+ inactive_winbar = {},
+ extensions = {},
+ },
+}
diff --git a/config/nvim/lua/plugins/resize.lua b/config/nvim/lua/plugins/resize.lua
new file mode 100644
index 0000000..7e22517
--- /dev/null
+++ b/config/nvim/lua/plugins/resize.lua
@@ -0,0 +1,34 @@
+return {
+ name = "resize",
+ dir = "~/.config/nvim/lua/myplugins",
+ keys = {
+ {
+ "<C-A-Left>",
+ function()
+ require("myplugins.resize").ResizeLeft()
+ end,
+ silent = true,
+ },
+ {
+ "<C-A-Right>",
+ function()
+ require("myplugins.resize").ResizeRight()
+ end,
+ silent = true,
+ },
+ {
+ "<C-A-Up>",
+ function()
+ require("myplugins.resize").ResizeUp()
+ end,
+ silent = true,
+ },
+ {
+ "<C-A-Down>",
+ function()
+ require("myplugins.resize").ResizeDown()
+ end,
+ silent = true,
+ },
+ },
+}
diff --git a/config/nvim/lua/plugins/telescope.lua b/config/nvim/lua/plugins/telescope.lua
new file mode 100644
index 0000000..aabcd9c
--- /dev/null
+++ b/config/nvim/lua/plugins/telescope.lua
@@ -0,0 +1,50 @@
+return {
+ "nvim-telescope/telescope.nvim",
+ dependencies = {
+ "nvim-lua/plenary.nvim",
+ },
+ config = function()
+ local actions = require("telescope.actions")
+ require("telescope").setup({
+ extensions = {
+ project = {
+ sync_with_nvim_tree = true,
+ },
+ },
+ pickers = {
+ buffers = {
+ initial_mode = "normal",
+ },
+ },
+ defaults = {
+ file_ignore_patterns = { "vendor", "node_modules" },
+ mappings = {
+ i = {
+ ["<F4>"] = actions.close,
+ },
+ n = {
+ ["<F4>"] = actions.close,
+ },
+ },
+ },
+ })
+ end,
+ keys = {
+ { "<leader>ff", "<cmd>Telescope find_files<CR>", noremap = true, silent = true, desc = "Find files" },
+ { "<leader>fg", "<cmd>Telescope live_grep<CR>", noremap = true, silent = true, desc = "Live grep" },
+ {
+ "<leader>fb",
+ "<cmd>Telescope current_buffer_fuzzy_fund<CR>",
+ noremap = true,
+ silent = true,
+ desc = "Find current file",
+ },
+ { "<F4>", "<cmd>Telescope buffers<CR>", noremap = true, silent = true, desc = "Find buffers" },
+ { "<leader>gc", "<cmd>Telescope git_commits<CR>", noremap = true, silent = true },
+ { "<leader>gs", "<cmd>Telescope git_status<CR>", noremap = true, silent = true },
+ { "<leader>ch", "<cmd>Telescope commands_history<CR>", noremap = true, silent = true },
+ { "<leader>e", "<cmd>Telescope diagnostics<CR>", noremap = true, silent = true },
+ { "gi", "<cmd>Telescope lsp_implementations<CR>", noremap = true, silent = true },
+ { "gr", "<cmd>Telescope lsp_references<CR>", noremap = true, silent = true },
+ },
+}
diff --git a/config/nvim/lua/plugins/todo.lua b/config/nvim/lua/plugins/todo.lua
new file mode 100644
index 0000000..ee672ab
--- /dev/null
+++ b/config/nvim/lua/plugins/todo.lua
@@ -0,0 +1,69 @@
+return {
+ "phrmendes/todotxt.nvim",
+ cmd = { "TodoTxt", "DoneTxt" },
+ opts = {
+ todotxt = "/home/neonxp/Документы/todo.txt",
+ donetxt = "/home/neonxp/Документы/done.txt",
+ },
+ -- suggested keybindings
+ keys = {
+ {
+ "<leader>tp",
+ function() require("todotxt").cycle_priority() end,
+ desc = "todo.txt: cycle priority",
+ ft = "todotxt",
+ },
+ {
+ "<cr>",
+ function() require("todotxt").toggle_todo_state() end,
+ desc = "todo.txt: toggle task state",
+ ft = "todotxt",
+ },
+ {
+ "<leader>tn",
+ function() require("todotxt").capture_todo() end,
+ desc = "New entry",
+ },
+ {
+ "<leader>tt",
+ function() require("todotxt").toggle_todotxt() end,
+ desc = "Open",
+ },
+ {
+ "<leader>tr",
+ function() require("todotxt").move_done_tasks() end,
+ desc = "Move to done.txt",
+ ft = "todotxt",
+ },
+ {
+ "<leader>tss",
+ function() require("todotxt").sort_tasks() end,
+ desc = "Sort",
+ ft = "todotxt",
+ },
+ {
+ "<leader>tsd",
+ function() require("todotxt").sort_tasks_by_due_date() end,
+ desc = "Sort by due:date",
+ ft = "todotxt",
+ },
+ {
+ "<leader>tsP",
+ function() require("todotxt").sort_tasks_by_priority() end,
+ desc = "Sort by (priority)",
+ ft = "todotxt",
+ },
+ {
+ "<leader>tsc",
+ function() require("todotxt").sort_tasks_by_context() end,
+ desc = "Sort by @context",
+ ft = "todotxt",
+ },
+ {
+ "<leader>tsp",
+ function() require("todotxt").sort_tasks_by_project() end,
+ desc = "Sort by +project",
+ ft = "todotxt",
+ },
+ },
+}
diff --git a/config/nvim/lua/plugins/tree.lua b/config/nvim/lua/plugins/tree.lua
new file mode 100644
index 0000000..3bf9eed
--- /dev/null
+++ b/config/nvim/lua/plugins/tree.lua
@@ -0,0 +1,54 @@
+local WIDTH_RATIO = 0.25
+
+return {
+ "nvim-tree/nvim-tree.lua",
+ dependencies = {
+ "nvim-tree/nvim-web-devicons",
+ },
+ opts = {
+ disable_netrw = true,
+ hijack_netrw = true,
+ sort = {
+ sorter = "case_sensitive",
+ },
+ view = {
+ width = function()
+ return math.floor(vim.opt.columns:get() * WIDTH_RATIO)
+ end,
+ adaptive_size = true,
+ centralize_selection = true,
+ },
+ git = {
+ enable = true,
+ },
+ renderer = {
+ group_empty = true,
+ highlight_git = true,
+ icons = {
+ show = {
+ git = true,
+ },
+ },
+ },
+ filters = {
+ dotfiles = false,
+ },
+ update_focused_file = {
+ enable = true,
+ },
+ },
+ keys = {
+ {
+ "<C-c>",
+ function()
+ local api = require("nvim-tree.api")
+ local global_cwd = vim.fn.getcwd(-1, -1)
+ api.tree.change_root(global_cwd)
+ end,
+ noremap = true,
+ silent = true,
+ desc = "Change tree root to CWD",
+ },
+ { "<F3>", ":NvimTreeToggle<CR>", noremap = true, silent = true, desc = "Toggle file tree" },
+ },
+}
diff --git a/config/nvim/lua/plugins/treesitter.lua b/config/nvim/lua/plugins/treesitter.lua
new file mode 100644
index 0000000..59e9294
--- /dev/null
+++ b/config/nvim/lua/plugins/treesitter.lua
@@ -0,0 +1,53 @@
+return {
+ "nvim-treesitter/nvim-treesitter",
+ build = ":TSUpdate",
+ opts = {
+ highlight = {
+ enable = true,
+ additional_vim_regex_highlighting = false,
+ },
+ ensure_installed = "all",
+ ignore_install = { "gdhsader", "phpdoc", "org" },
+ indent = { enable = true },
+ auto_install = true,
+ sync_install = true,
+ incremental_selection = {
+ enable = true,
+ keymaps = {
+ init_selection = "<C-space>",
+ node_incremental = "<C-space>",
+ scope_incremental = false,
+ node_decremental = "<bs>",
+ },
+ },
+ textobjects = {
+ select = { enable = true, lookahead = true },
+ move = {
+ enable = true,
+ goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer", ["]a"] = "@parameter.inner" },
+ goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" },
+ goto_previous_start = {
+ ["[f"] = "@function.outer",
+ ["[c"] = "@class.outer",
+ ["[a"] = "@parameter.inner",
+ },
+ goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer", ["[A"] = "@parameter.inner" },
+ },
+ },
+ },
+ build = function()
+ require("nvim-treesitter.install").update({ with_sync = true })()
+ end,
+ dependencies = {
+ { "nvim-treesitter/nvim-treesitter-textobjects" },
+ {
+ "nvim-treesitter/nvim-treesitter-context",
+ opts = {
+ enable = true,
+ mode = "topline",
+ line_numbers = true,
+ },
+ },
+ { "windwp/nvim-ts-autotag" },
+ },
+}