diff --git a/nvim/dot-config/nvim/lua/plugins/autopairs.lua b/nvim/dot-config/nvim/lua/plugins/autopairs.lua index 6205e6e..0c5b32a 100644 --- a/nvim/dot-config/nvim/lua/plugins/autopairs.lua +++ b/nvim/dot-config/nvim/lua/plugins/autopairs.lua @@ -1,8 +1,12 @@ -- https://github.com/altermo/ultimate-autopair.nvim +--- @module "lazy" +--- @type LazySpec return { "altermo/ultimate-autopair.nvim", event = { "InsertEnter", "CmdlineEnter" }, branch = "v0.6", + --- @module "ultimate-autopair" + --- @type prof.def.conf opts = { fastwarp = { faster = true, diff --git a/nvim/dot-config/nvim/lua/plugins/blink.lua b/nvim/dot-config/nvim/lua/plugins/blink.lua index 0dd19ad..353faf8 100644 --- a/nvim/dot-config/nvim/lua/plugins/blink.lua +++ b/nvim/dot-config/nvim/lua/plugins/blink.lua @@ -1,3 +1,6 @@ +-- https://github.com/saghen/blink.cmp +--- @module "lazy" +--- @type LazySpec return { "saghen/blink.cmp", -- optional: provides snippets for the snippet source @@ -6,8 +9,8 @@ return { -- use a release tag to download pre-built binaries version = "1.*", - ---@module 'blink.cmp' - ---@type blink.cmp.Config + --- @module "blink-cmp" + --- @type blink.cmp.Config opts = { -- See :h blink-cmp-config-keymap for defining your own keymap -- keymap = { preset = "default" }, diff --git a/nvim/dot-config/nvim/lua/plugins/bufdel.lua b/nvim/dot-config/nvim/lua/plugins/bufdel.lua index 456076f..ec7f2e0 100644 --- a/nvim/dot-config/nvim/lua/plugins/bufdel.lua +++ b/nvim/dot-config/nvim/lua/plugins/bufdel.lua @@ -1,4 +1,6 @@ -- https://github.com/ojroques/nvim-bufdel +--- @module "lazy" +--- @type LazySpec return { "ojroques/nvim-bufdel", cmd = { "BufDel", "BuffDelOthers" }, diff --git a/nvim/dot-config/nvim/lua/plugins/bufferline.lua b/nvim/dot-config/nvim/lua/plugins/bufferline.lua index dc3fdd3..36a4cdc 100644 --- a/nvim/dot-config/nvim/lua/plugins/bufferline.lua +++ b/nvim/dot-config/nvim/lua/plugins/bufferline.lua @@ -2,55 +2,53 @@ local diagnostic = require("symbols.diagnostic") local file = require("symbols.file") +--- @module "lazy" +--- @type LazySpec return { "akinsho/bufferline.nvim", - config = function() - -- Enable mousemoveevent if possible - vim.o.mousemoveevent = true - - local bufferline = require("bufferline") - + --- @module "bufferline" + --- @type bufferline.UserConfig + opts = { + options = { + show_buffer_icons = false, + show_buffer_close_icons = false, + diagnostics = "nvim_lsp", + separator_style = "thick", + left_trunc_marker = "", + right_trunc_marker = "", + sort_by = "insert_at_end", + indicator = { + style = "none", + }, + modified_icon = file.modified, + ---@diagnostic disable-next-line: unused-local + diagnostics_indicator = function(count, level, diagnostics_dict, context) + local s = " " + for e, n in pairs(diagnostics_dict) do + local sym = e == "error" and diagnostic.error .. " " + or (e == "warning" and diagnostic.warn .. " ") + or (e == "info" and diagnostic.info .. " " or diagnostic.hint .. " ") + s = s .. n .. sym + end + return s + end, + }, + }, + init = function() -- Setup keybinds to move between buffers vim.keymap.set("n", "", function() - bufferline.cycle(1) + require("bufferline").cycle(1) end, { silent = true, desc = "Goto next buffer" }) vim.keymap.set("n", "", function() - bufferline.cycle(-1) + require("bufferline").cycle(-1) end, { silent = true, desc = "Goto previous buffer" }) -- Setup keybinds to move buffers around vim.keymap.set("n", "b[", function() - bufferline.move(-1) + require("bufferline").move(-1) end, { silent = true, desc = "Move buffer to left" }) vim.keymap.set("n", "b]", function() - bufferline.move(1) + require("bufferline").move(1) end, { silent = true, desc = "Move buffer to right" }) - - bufferline.setup({ - options = { - show_buffer_icons = false, - show_buffer_close_icons = false, - diagnostics = "nvim_lsp", - separator_style = "thick", - left_trunc_marker = "", - right_trunc_marker = "", - sort_by = "insert_at_end", - indicator = { - style = "none", - }, - modified_icon = file.modified, - ---@diagnostic disable-next-line: unused-local - diagnostics_indicator = function(count, level, diagnostics_dict, context) - local s = " " - for e, n in pairs(diagnostics_dict) do - local sym = e == "error" and diagnostic.error .. " " - or (e == "warning" and diagnostic.warn .. " ") - or (e == "info" and diagnostic.info .. " " or diagnostic.hint .. " ") - s = s .. n .. sym - end - return s - end, - }, - }) end, } diff --git a/nvim/dot-config/nvim/lua/plugins/colorizer.lua b/nvim/dot-config/nvim/lua/plugins/colorizer.lua index 761a9a3..3f68ff9 100644 --- a/nvim/dot-config/nvim/lua/plugins/colorizer.lua +++ b/nvim/dot-config/nvim/lua/plugins/colorizer.lua @@ -1,4 +1,6 @@ -- https://github.com/NvChad/nvim-colorizer.lua +--- @module "lazy" +--- @type LazySpec return { "NvChad/nvim-colorizer.lua", event = "VeryLazy", diff --git a/nvim/dot-config/nvim/lua/plugins/comment.lua b/nvim/dot-config/nvim/lua/plugins/comment.lua index 868b780..0eaf91d 100644 --- a/nvim/dot-config/nvim/lua/plugins/comment.lua +++ b/nvim/dot-config/nvim/lua/plugins/comment.lua @@ -1,7 +1,11 @@ -- https://github.com/numToStr/Comment.nvim +--- @module "lazy" +--- @type LazySpec return { "numToStr/Comment.nvim", event = "VeryLazy", + --- @module "Comment" + --- @type CommentConfig opts = { toggler = { block = "gBc", diff --git a/nvim/dot-config/nvim/lua/plugins/conform.lua b/nvim/dot-config/nvim/lua/plugins/conform.lua index 5d159ea..0348ccc 100644 --- a/nvim/dot-config/nvim/lua/plugins/conform.lua +++ b/nvim/dot-config/nvim/lua/plugins/conform.lua @@ -1,5 +1,7 @@ -- https://github.com/stevearc/conform.nvim local slow_format_filetypes = {} +--- @module "lazy" +--- @type LazySpec return { "stevearc/conform.nvim", event = { "BufWritePre" }, @@ -15,6 +17,8 @@ return { desc = "Format buffer", }, }, + --- @module "conform" + --- @type conform.setupOpts opts = { formatters_by_ft = (function() local formatters = require("tools.format") @@ -58,7 +62,6 @@ return { end return { lsp_fallback = true } end, - -- log_level = vim.log.levels.DEBUG, }, init = function() vim.api.nvim_create_user_command("FormatDisable", function(args) @@ -72,6 +75,7 @@ return { desc = "Disable autoformat-on-save", bang = true, }) + vim.api.nvim_create_user_command("FormatEnable", function() vim.b.disable_autoformat = false vim.g.disable_autoformat = false diff --git a/nvim/dot-config/nvim/lua/plugins/dap.lua b/nvim/dot-config/nvim/lua/plugins/dap.lua index 5df9d20..f8505eb 100644 --- a/nvim/dot-config/nvim/lua/plugins/dap.lua +++ b/nvim/dot-config/nvim/lua/plugins/dap.lua @@ -1,4 +1,6 @@ -- https://github.com/mfussenegger/nvim-dap +--- @module "lazy" +--- @type LazySpec return { { "mfussenegger/nvim-dap", diff --git a/nvim/dot-config/nvim/lua/plugins/fidget.lua b/nvim/dot-config/nvim/lua/plugins/fidget.lua index 6edadd6..703b1d9 100644 --- a/nvim/dot-config/nvim/lua/plugins/fidget.lua +++ b/nvim/dot-config/nvim/lua/plugins/fidget.lua @@ -1,4 +1,6 @@ -- https://github.com/j-hui/fidget.nvim +--- @module "lazy" +--- @type LazySpec return { "j-hui/fidget.nvim", opts = { diff --git a/nvim/dot-config/nvim/lua/plugins/gitsigns.lua b/nvim/dot-config/nvim/lua/plugins/gitsigns.lua index 8006c9e..ca7b509 100644 --- a/nvim/dot-config/nvim/lua/plugins/gitsigns.lua +++ b/nvim/dot-config/nvim/lua/plugins/gitsigns.lua @@ -1,7 +1,12 @@ -- https://github.com/lewis6991/gitsigns.nvim +--- @module "lazy" +--- @type LazySpec return { -- Adds git related signs to the gutter, as well as utilities for managing changes "lewis6991/gitsigns.nvim", + event = "VeryLazy", + --- @module "gitsigns" + --- @type Gitsigns.Config opts = { signs = { add = { text = "+" }, @@ -28,6 +33,7 @@ return { }, init = function() local ga = require("gitsigns.actions") + vim.keymap.set("n", "gs", ga.stage_hunk, { desc = "(Un)stage hunk" }) vim.keymap.set("n", "gS", ga.stage_buffer, { desc = "Stage buffer" }) vim.keymap.set("v", "gs", function() diff --git a/nvim/dot-config/nvim/lua/plugins/guess-indent.lua b/nvim/dot-config/nvim/lua/plugins/guess-indent.lua index 411123f..1fc467b 100644 --- a/nvim/dot-config/nvim/lua/plugins/guess-indent.lua +++ b/nvim/dot-config/nvim/lua/plugins/guess-indent.lua @@ -1,7 +1,9 @@ -- https://github.com/NMAC427/guess-indent.nvim +--- @module "lazy" +--- @type LazySpec return { - -- Adds a command to automatically detect the indentation settings - -- Prefer to use .editorconfig for projects and modeline for files "NMAC427/guess-indent.nvim", + --- @module "guess-indent" + --- @type GuessIndentConfig opts = {}, } diff --git a/nvim/dot-config/nvim/lua/plugins/inc-rename.lua b/nvim/dot-config/nvim/lua/plugins/inc-rename.lua index 2444aed..6c77cfe 100644 --- a/nvim/dot-config/nvim/lua/plugins/inc-rename.lua +++ b/nvim/dot-config/nvim/lua/plugins/inc-rename.lua @@ -1,6 +1,10 @@ -- https://github.com/smjonas/inc-rename.nvim +--- @module "lazy" +--- @type LazySpec return { "smjonas/inc-rename.nvim", + --- @module "inc_rename" + --- @type inc_rename.UserConfig opts = { preview_empty_name = true, }, diff --git a/nvim/dot-config/nvim/lua/plugins/indent-blankline.lua b/nvim/dot-config/nvim/lua/plugins/indent-blankline.lua index 0b808dd..195fd27 100644 --- a/nvim/dot-config/nvim/lua/plugins/indent-blankline.lua +++ b/nvim/dot-config/nvim/lua/plugins/indent-blankline.lua @@ -1,10 +1,14 @@ -- https://github.com/lukas-reineke/indent-blankline.nvim +--- @module "lazy" +--- @type LazySpec return { -- Add indentation guides even on blank lines "lukas-reineke/indent-blankline.nvim", -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help indent_blankline.txt` main = "ibl", + ---@module "ibl" + ---@type ibl.config opts = { indent = { char = "¦", diff --git a/nvim/dot-config/nvim/lua/plugins/kubernetes.lua b/nvim/dot-config/nvim/lua/plugins/kubernetes.lua index 100c28a..f21973f 100644 --- a/nvim/dot-config/nvim/lua/plugins/kubernetes.lua +++ b/nvim/dot-config/nvim/lua/plugins/kubernetes.lua @@ -1,3 +1,6 @@ +-- https://github.com/diogo464/kubernetes.nvim +--- @module "lazy" +--- @type LazySpec return { "diogo464/kubernetes.nvim", opts = { diff --git a/nvim/dot-config/nvim/lua/plugins/lazydev.lua b/nvim/dot-config/nvim/lua/plugins/lazydev.lua index ac15c15..4468c57 100644 --- a/nvim/dot-config/nvim/lua/plugins/lazydev.lua +++ b/nvim/dot-config/nvim/lua/plugins/lazydev.lua @@ -1,14 +1,16 @@ -- https://github.com/folke/lazydev.nvim +--- @module "lazy" +--- @type LazySpec return { - { - "folke/lazydev.nvim", - ft = "lua", - opts = { - library = { - -- See the configuration section for more details - -- Load luvit types when the `vim.uv` word is found - { path = "${3rd}/luv/library", words = { "vim%.uv" } }, - }, + "folke/lazydev.nvim", + ft = "lua", + --- @module "lazydev" + --- @type lazydev.Config + opts = { + library = { + -- See the configuration section for more details + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, }, }, } diff --git a/nvim/dot-config/nvim/lua/plugins/lspconfig.lua b/nvim/dot-config/nvim/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..507fc07 --- /dev/null +++ b/nvim/dot-config/nvim/lua/plugins/lspconfig.lua @@ -0,0 +1,6 @@ +-- https://github.com/neovim/nvim-lspconfig +--- @module "lazy" +--- @type LazySpec +return { + "neovim/nvim-lspconfig", +} diff --git a/nvim/dot-config/nvim/lua/plugins/lualine.lua b/nvim/dot-config/nvim/lua/plugins/lualine.lua index 6741b62..109b739 100644 --- a/nvim/dot-config/nvim/lua/plugins/lualine.lua +++ b/nvim/dot-config/nvim/lua/plugins/lualine.lua @@ -8,6 +8,8 @@ local function get_schema() return schema.name end +--- @module "lazy" +--- @type LazySpec return { "nvim-lualine/lualine.nvim", opts = { diff --git a/nvim/dot-config/nvim/lua/plugins/mason-lspconfig.lua b/nvim/dot-config/nvim/lua/plugins/mason-lspconfig.lua index 17f5c32..1bae420 100644 --- a/nvim/dot-config/nvim/lua/plugins/mason-lspconfig.lua +++ b/nvim/dot-config/nvim/lua/plugins/mason-lspconfig.lua @@ -1,5 +1,11 @@ +-- https://github.com/mason-org/mason-lspconfig.nvim +--- @module "lazy" +--- @type LazySpec return { "mason-org/mason-lspconfig.nvim", + event = "VeryLazy", + --- @module "mason-lspconfig" + --- @type MasonLspconfigSettings opts = {}, dependencies = { "mason-org/mason.nvim", diff --git a/nvim/dot-config/nvim/lua/plugins/mason-tool-installer.lua b/nvim/dot-config/nvim/lua/plugins/mason-tool-installer.lua index 8ee49f7..af0ecc4 100644 --- a/nvim/dot-config/nvim/lua/plugins/mason-tool-installer.lua +++ b/nvim/dot-config/nvim/lua/plugins/mason-tool-installer.lua @@ -1,9 +1,11 @@ +--- https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim +--- @module "lazy" +--- @type LazySpec return { "WhoIsSethDaniel/mason-tool-installer.nvim", + event = "VeryLazy", dependencies = { "mason-org/mason.nvim", - "mason-org/mason-lspconfig.nvim", - "zapling/mason-conform.nvim", }, config = function() local lsp = require("tools.lsp") diff --git a/nvim/dot-config/nvim/lua/plugins/mason.lua b/nvim/dot-config/nvim/lua/plugins/mason.lua index 7c74184..4066867 100644 --- a/nvim/dot-config/nvim/lua/plugins/mason.lua +++ b/nvim/dot-config/nvim/lua/plugins/mason.lua @@ -1,4 +1,9 @@ +-- https://github.com/mason-org/mason.nvim +--- @module "lazy" +--- @type LazySpec return { "mason-org/mason.nvim", + --- @module "mason" + --- @type MasonSettings opts = {}, } diff --git a/nvim/dot-config/nvim/lua/plugins/neotree.lua b/nvim/dot-config/nvim/lua/plugins/neotree.lua index 1ea67a5..c76fc0b 100644 --- a/nvim/dot-config/nvim/lua/plugins/neotree.lua +++ b/nvim/dot-config/nvim/lua/plugins/neotree.lua @@ -2,6 +2,8 @@ local fold = require("symbols.fold") local file = require("symbols.file") +--- @module "lazy" +--- @type LazySpec return { "nvim-neo-tree/neo-tree.nvim", version = "v3.x", @@ -15,85 +17,86 @@ return { }, -- netrw hijack does not work when lazy loading lazy = false, - config = function() - require("neo-tree").setup({ - close_if_last_window = true, - popup_border_style = require("symbols.window").border, - source_selector = { - winbar = true, - show_scrolled_off_parent_node = true, - sources = { - { - source = "filesystem", - display_name = " Files ", - }, - { - source = "buffers", - display_name = " Buffers ", - }, - { - source = "git_status", - display_name = " Git ", - }, + --- @module "neo-tree" + --- @type neotree.Config + opts = { + close_if_last_window = true, + popup_border_style = require("symbols.window").border, + source_selector = { + winbar = true, + show_scrolled_off_parent_node = true, + sources = { + { + source = "filesystem", + display_name = " Files ", }, - show_separator_on_edge = true, - }, - default_component_configs = { - diagnostics = { - highlights = { - hint = "DiagnosticHint", - info = "DiagnosticInfo", - warn = "DiagnosticWarn", - error = "DiagnosticError", - }, + { + source = "buffers", + display_name = " Buffers ", }, - icon = { - folder_closed = fold.closed, - folder_open = fold.open, - folder_empty = fold.empty, - default = file.icon, - }, - modified = { - symbol = file.modified, - }, - name = { - use_git_status_colors = false, - }, - git_status = { - symbols = require("symbols.git"), - }, - type = { - enabled = false, - }, - last_modified = { - enabled = false, - }, - symlink_target = { - enabled = true, + { + source = "git_status", + display_name = " Git ", }, }, - filesystem = { - follow_current_file = { - enabled = true, - }, - hijack_netrw_behavior = "open_current", - use_libuv_file_watcher = true, - scan_mode = "deep", - }, - window = { - popup = { - title = function(state) - return "" - end, - }, - position = "float", - mappings = { - [""] = "close_window", - [""] = "close_window", - [""] = "next_source", - [""] = "prev_source", + show_separator_on_edge = true, + }, + default_component_configs = { + diagnostics = { + highlights = { + hint = "DiagnosticHint", + info = "DiagnosticInfo", + warn = "DiagnosticWarn", + error = "DiagnosticError", }, }, - }) - end, + icon = { + folder_closed = fold.closed, + folder_open = fold.open, + folder_empty = fold.empty, + folder_empty_open = fold.open, + default = file.icon, + }, + modified = { + symbol = file.modified, + }, + name = { + use_git_status_colors = false, + }, + git_status = { + symbols = require("symbols.git"), + }, + type = { + enabled = false, + }, + last_modified = { + enabled = false, + }, + symlink_target = { + enabled = true, + }, + }, + filesystem = { + follow_current_file = { + enabled = true, + }, + hijack_netrw_behavior = "open_current", + use_libuv_file_watcher = true, + scan_mode = "deep", + }, + window = { + popup = { + title = function() + return "" + end, + }, + position = "float", + mappings = { + [""] = "close_window", + [""] = "close_window", + [""] = "next_source", + [""] = "prev_source", + }, + }, + }, } diff --git a/nvim/dot-config/nvim/lua/plugins/peek.lua b/nvim/dot-config/nvim/lua/plugins/peek.lua index ee2209a..1966f2a 100644 --- a/nvim/dot-config/nvim/lua/plugins/peek.lua +++ b/nvim/dot-config/nvim/lua/plugins/peek.lua @@ -1,4 +1,6 @@ -- https://github.com/toppair/peek.nvim +--- @module "lazy" +--- @type LazySpec return { "toppair/peek.nvim", build = "deno task --quiet build:fast", diff --git a/nvim/dot-config/nvim/lua/plugins/ros.lua b/nvim/dot-config/nvim/lua/plugins/ros.lua index 54ab0c5..684e244 100644 --- a/nvim/dot-config/nvim/lua/plugins/ros.lua +++ b/nvim/dot-config/nvim/lua/plugins/ros.lua @@ -1,3 +1,6 @@ +-- https://github.com/tadachs/ros-nvim +--- @module "lazy" +--- @type LazySpec return { "tadachs/ros-nvim", opts = { diff --git a/nvim/dot-config/nvim/lua/plugins/schema-companion.lua b/nvim/dot-config/nvim/lua/plugins/schema-companion.lua index 7364cae..6e0030d 100644 --- a/nvim/dot-config/nvim/lua/plugins/schema-companion.lua +++ b/nvim/dot-config/nvim/lua/plugins/schema-companion.lua @@ -1,32 +1,36 @@ -local kubernetes = {} -kubernetes.name = "Kubernetes" +-- https://github.com/cenk1cenk2/schema-companion.nvim +--- @module "schema-companion" +--- @type schema_companion.Matcher +local kubernetes = { + name = "Kubernetes", + match = function(bufnr) + local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) + local kind = false + local api_version = false ----@type schema_companion.MatcherMatchFn -kubernetes.match = function(bufnr) - local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) - local kind = false - local api_version = false + for _, line in ipairs(lines) do + if kind or vim.regex("^kind: .*$"):match_str(line) then + kind = true + end - for _, line in ipairs(lines) do - if kind or vim.regex("^kind: .*$"):match_str(line) then - kind = true + if api_version or vim.regex("^apiVersion: .*$"):match_str(line) then + api_version = true + end + + if kind and api_version then + return { + name = "Kubernetes", + uri = require("kubernetes").yamlls_schema(), + } + end end - if api_version or vim.regex("^apiVersion: .*$"):match_str(line) then - api_version = true - end - - if kind and api_version then - return { - name = "Kubernetes", - uri = require("kubernetes").yamlls_schema(), - } - end - end - - return nil -end + return nil + end, +} +--- @module "lazy" +--- @type LazySpec return { "cenk1cenk2/schema-companion.nvim", dependencies = { @@ -34,16 +38,7 @@ return { "nvim-telescope/telescope.nvim", "diogo464/kubernetes.nvim", }, - config = function() - require("schema-companion").setup({ - enable_telescope = true, - matchers = { - kubernetes, - }, - schemas = {}, - }) - - -- TODO: Set on lsp attach with filetype yaml? + init = function() vim.keymap.set( "n", "ss", @@ -61,4 +56,13 @@ return { }) ) end, + --- @module "schema-companion" + --- @type schema_companion.Config + opts = { + enable_telescope = true, + matchers = { + kubernetes, + }, + schemas = {}, + }, } diff --git a/nvim/dot-config/nvim/lua/plugins/schemastore.lua b/nvim/dot-config/nvim/lua/plugins/schemastore.lua index ba4d13f..6a153bd 100644 --- a/nvim/dot-config/nvim/lua/plugins/schemastore.lua +++ b/nvim/dot-config/nvim/lua/plugins/schemastore.lua @@ -1,3 +1,6 @@ +-- https://github.com/b0o/schemastore.nvim +--- @module "lazy" +--- @type LazySpec return { "b0o/schemastore.nvim", config = function() diff --git a/nvim/dot-config/nvim/lua/plugins/smart-splits.lua b/nvim/dot-config/nvim/lua/plugins/smart-splits.lua index ceae5f3..2d23bae 100644 --- a/nvim/dot-config/nvim/lua/plugins/smart-splits.lua +++ b/nvim/dot-config/nvim/lua/plugins/smart-splits.lua @@ -1,7 +1,13 @@ -- https://github.com/mrjones2014/smart-splits.nvim +--- @module "lazy" +--- @type LazySpec return { "mrjones2014/smart-splits.nvim", - config = function() + opts = { + at_edge = "stop", + cursor_follows_swapped_bufs = true, + }, + init = function() vim.keymap.set("n", "", require("smart-splits").move_cursor_left) vim.keymap.set("n", "", require("smart-splits").move_cursor_down) vim.keymap.set("n", "", require("smart-splits").move_cursor_up) @@ -16,10 +22,5 @@ return { vim.keymap.set("n", "", require("smart-splits").resize_down, { desc = "Resize buffer to the bottom" }) vim.keymap.set("n", "", require("smart-splits").resize_up, { desc = "Resize buffer to the top" }) vim.keymap.set("n", "", require("smart-splits").resize_right, { desc = "Resize buffer to the right" }) - - require("smart-splits").setup({ - at_edge = "stop", - cursor_follows_swapped_bufs = true, - }) end, } diff --git a/nvim/dot-config/nvim/lua/plugins/surround.lua b/nvim/dot-config/nvim/lua/plugins/surround.lua index 8c73358..17cef72 100644 --- a/nvim/dot-config/nvim/lua/plugins/surround.lua +++ b/nvim/dot-config/nvim/lua/plugins/surround.lua @@ -1,6 +1,10 @@ -- https://github.com/kylechui/nvim-surround +--- @module "lazy" +--- @type LazySpec return { "kylechui/nvim-surround", event = "VeryLazy", - config = true, + --- @module "nvim-surround" + --- @type user_options + opts = {}, } diff --git a/nvim/dot-config/nvim/lua/plugins/symbols-outline.lua b/nvim/dot-config/nvim/lua/plugins/symbols-outline.lua index 4fd2660..00dfc07 100644 --- a/nvim/dot-config/nvim/lua/plugins/symbols-outline.lua +++ b/nvim/dot-config/nvim/lua/plugins/symbols-outline.lua @@ -1,4 +1,6 @@ -- https://github.com/simrat39/symbols-outline.nvim +--- @module "lazy" +--- @type LazySpec return { enabled = false, "simrat39/symbols-outline.nvim", diff --git a/nvim/dot-config/nvim/lua/plugins/telescope.lua b/nvim/dot-config/nvim/lua/plugins/telescope.lua index 48c555f..0aed161 100644 --- a/nvim/dot-config/nvim/lua/plugins/telescope.lua +++ b/nvim/dot-config/nvim/lua/plugins/telescope.lua @@ -1,6 +1,7 @@ -- https://github.com/nvim-telescope/telescope.nvim local window = require("symbols.window") --- TODO: Ensure installed ripgrep +--- @module "lazy" +--- @type LazySpec return { "nvim-telescope/telescope.nvim", dependencies = { @@ -14,51 +15,35 @@ return { end, }, }, - config = function() - require("telescope").setup({ - - pickers = { - find_files = { - hidden = true, + opts = { + pickers = { + find_files = { + hidden = true, + }, + }, + defaults = { + file_ignore_patterns = { + ".git/", + }, + mappings = { + n = { + [""] = "move_selection_worse", + [""] = "move_selection_better", + }, + i = { + [""] = "move_selection_worse", + [""] = "move_selection_better", }, }, - defaults = { - file_ignore_patterns = { - ".git/", - }, - mappings = { - n = { - [""] = "move_selection_worse", - [""] = "move_selection_better", - }, - i = { - [""] = "move_selection_worse", - [""] = "move_selection_better", - }, - }, - borderchars = window.borderchars, + borderchars = window.borderchars, + }, + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown(), }, - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown(), - }, - }, - }) - - -- HACK: Workaround until new borders are fixed in telescope - vim.api.nvim_create_autocmd("User", { - pattern = "TelescopeFindPre", - callback = function() - vim.opt_local.winborder = "none" - vim.api.nvim_create_autocmd("WinLeave", { - once = true, - callback = function() - vim.opt_local.winborder = window.border - end, - }) - end, - }) - + }, + }, + init = function() require("telescope").load_extension("fzf") require("telescope").load_extension("ui-select") @@ -93,5 +78,19 @@ return { vim.keymap.set("n", "sn", function() require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") }) end, { desc = "Neovim files" }) + + -- HACK: Workaround until new borders are fixed in telescope + vim.api.nvim_create_autocmd("User", { + pattern = "TelescopeFindPre", + callback = function() + vim.opt_local.winborder = "none" + vim.api.nvim_create_autocmd("WinLeave", { + once = true, + callback = function() + vim.opt_local.winborder = window.border + end, + }) + end, + }) end, } diff --git a/nvim/dot-config/nvim/lua/plugins/todo-comments.lua b/nvim/dot-config/nvim/lua/plugins/todo-comments.lua index 6e02cbd..7e0caa2 100644 --- a/nvim/dot-config/nvim/lua/plugins/todo-comments.lua +++ b/nvim/dot-config/nvim/lua/plugins/todo-comments.lua @@ -1,6 +1,8 @@ -- https://github.com/folke/todo-comments.nvim local diagnostic = require("symbols.diagnostic") +--- @module "lazy" +--- @type LazySpec return { -- 'folke/todo-comments.nvim', -- NOTE: This fork highlights the entire matched word, not just the keyword. @@ -8,7 +10,42 @@ return { dependencies = { "nvim-lua/plenary.nvim", }, - config = function() + opts = { + keywords = { + -- FIX: Fix + FIX = { icon = diagnostic.bug }, + -- TODO: Todo + TODO = { icon = diagnostic.todo }, + -- HACK: Hack + HACK = { icon = diagnostic.hack }, + -- WARN: Warn + WARN = { icon = diagnostic.warn }, + -- PERF: Perf + PERF = { icon = diagnostic.performance }, + -- NOTE: Note + NOTE = { icon = diagnostic.note }, + -- TEST: Test + TEST = { icon = diagnostic.test }, + }, + highlight = { + -- TODO: Have multiline, but end when %p (punctuation) is at the end of a line + multiline = false, + before = "fg", + pattern = [[(KEYWORDS)\s*(\([^\)]*\))?:]], + }, + search = { + pattern = [[\b(KEYWORDS)(\(.*\))?:]], + }, + colors = { + error = { "TodoCommentError" }, + warning = { "TodoCommentWarning" }, + info = { "TodoCommentInfo" }, + hint = { "TodoCommentHint" }, + test = { "TodoCommentTest" }, + default = { "TodoCommentDefault" }, + }, + }, + init = function() vim.keymap.set("n", "]t", function() require("todo-comments").jump_next() end, { desc = "Next todo comment" }) @@ -25,41 +62,5 @@ return { if pcall(require, "telescope") then vim.keymap.set("n", "st", "TodoTelescope", { desc = "Search todo" }) end - - require("todo-comments").setup({ - keywords = { - -- FIX: Fix - FIX = { icon = diagnostic.bug }, - -- TODO: Todo - TODO = { icon = diagnostic.todo }, - -- HACK: Hack - HACK = { icon = diagnostic.hack }, - -- WARN: Warn - WARN = { icon = diagnostic.warn }, - -- PERF: Perf - PERF = { icon = diagnostic.performance }, - -- NOTE: Note - NOTE = { icon = diagnostic.note }, - -- TEST: Test - TEST = { icon = diagnostic.test }, - }, - highlight = { - -- TODO: Have multiline, but end when %p (punctuation) is at the end of a line - multiline = false, - before = "fg", - pattern = [[(KEYWORDS)\s*(\([^\)]*\))?:]], - }, - search = { - pattern = [[\b(KEYWORDS)(\(.*\))?:]], - }, - colors = { - error = { "TodoCommentError" }, - warning = { "TodoCommentWarning" }, - info = { "TodoCommentInfo" }, - hint = { "TodoCommentHint" }, - test = { "TodoCommentTest" }, - default = { "TodoCommentDefault" }, - }, - }) end, } diff --git a/nvim/dot-config/nvim/lua/plugins/treesitter.lua b/nvim/dot-config/nvim/lua/plugins/treesitter.lua index d596f5e..19d3bce 100644 --- a/nvim/dot-config/nvim/lua/plugins/treesitter.lua +++ b/nvim/dot-config/nvim/lua/plugins/treesitter.lua @@ -1,6 +1,8 @@ +-- https://github.com/nvim-treesitter/nvim-treesitter +--- @module "lazy" +--- @type LazySpec return { { - -- Highlight, edit, and navigate code "nvim-treesitter/nvim-treesitter", dependencies = { { "nvim-treesitter/nvim-treesitter-textobjects", branch = "master" }, @@ -10,6 +12,8 @@ return { branch = "master", build = ":TSUpdate", main = "nvim-treesitter.configs", + --- @module "nvim-treesitter" + --- @type TSConfig opts = { ensure_installed = require("tools.highlight"), diff --git a/nvim/dot-config/nvim/lua/plugins/trouble.lua b/nvim/dot-config/nvim/lua/plugins/trouble.lua index 00a7983..d812aa6 100644 --- a/nvim/dot-config/nvim/lua/plugins/trouble.lua +++ b/nvim/dot-config/nvim/lua/plugins/trouble.lua @@ -1,19 +1,21 @@ -- https://github.com/folke/trouble.nvim local fold = require("symbols.fold") +--- @module "lazy" +--- @type LazySpec return { "folke/trouble.nvim", cmd = { "Trouble", "TroubleToggle" }, keys = { { "", "TroubleToggle workspace_diagnostics", desc = "Goto previous buffer" }, }, - config = function() - require("trouble").setup({ - icons = false, - auto_close = true, - fold_open = fold.open, -- icon used for open folds - fold_closed = fold.close, -- icon used for closed folds - use_diagnostic_signs = true, - }) - end, + --- @module "trouble" + --- @type trouble.Config + opts = { + icons = false, + auto_close = true, + fold_open = fold.open, -- icon used for open folds + fold_closed = fold.close, -- icon used for closed folds + use_diagnostic_signs = true, + }, } diff --git a/nvim/dot-config/nvim/lua/plugins/undotree.lua b/nvim/dot-config/nvim/lua/plugins/undotree.lua index 9ea925b..4b70af5 100644 --- a/nvim/dot-config/nvim/lua/plugins/undotree.lua +++ b/nvim/dot-config/nvim/lua/plugins/undotree.lua @@ -1,7 +1,9 @@ -- https://github.com/mbbill/undotree +--- @module "lazy" +--- @type LazySpec return { - 'mbbill/undotree', + "mbbill/undotree", keys = { - { '', vim.cmd.UndotreeToggle, desc = 'Toggle undotree' }, + { "", vim.cmd.UndotreeToggle, desc = "Toggle undotree" }, }, } diff --git a/nvim/dot-config/nvim/lua/plugins/which-key.lua b/nvim/dot-config/nvim/lua/plugins/which-key.lua index a659cac..0f2ca99 100644 --- a/nvim/dot-config/nvim/lua/plugins/which-key.lua +++ b/nvim/dot-config/nvim/lua/plugins/which-key.lua @@ -1,13 +1,18 @@ -- https://github.com/folke/which-key.nvim +local window = require("symbols.window") +--- @module "lazy" +--- @type LazySpec return { "folke/which-key.nvim", + --- @module "which-key" + --- @type wk.Opts opts = { preset = "modern", delay = function(ctx) return ctx.plugin and 0 or 500 end, win = { - border = "single", + border = window.border, padding = { 1, 1 }, title = false, }, @@ -45,7 +50,6 @@ return { sort = { "alphanum" }, }, init = function() - -- TODO: Only make a category show up if there actually are any keybinds under it require("which-key").add({ { "b", group = "Buffer" }, { "d", group = "Doument" }, diff --git a/nvim/dot-config/nvim/lua/themes/gruvbox.lua b/nvim/dot-config/nvim/lua/themes/gruvbox.lua index 50eef03..fa3b27f 100644 --- a/nvim/dot-config/nvim/lua/themes/gruvbox.lua +++ b/nvim/dot-config/nvim/lua/themes/gruvbox.lua @@ -1,4 +1,6 @@ -- https://github.com/ellisonleao/gruvbox.nvim +--- @module "lazy" +--- @type LazySpec return { "ellisonleao/gruvbox.nvim", priority = 1000,