aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-08-07 15:23:52 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-08-07 15:23:52 -0500
commita7d7f8587109afae1baf624723cf0d759b31229a (patch)
tree13cb8c5bef3d1e9da3ae3ae59347d72b1463a0e2
parent0e58b7fcfe7ba0fbeb6dc7b8fe8d5087a2c1d2eb (diff)
refactor(nvim): improve plugin versioning and loading
-rw-r--r--nvim/.config/nvim/lazy-lock.json18
-rw-r--r--nvim/.config/nvim/lua/plugins/cmp.lua130
-rw-r--r--nvim/.config/nvim/lua/plugins/colorize.lua1
-rw-r--r--nvim/.config/nvim/lua/plugins/conform.lua18
-rw-r--r--nvim/.config/nvim/lua/plugins/ferris.lua3
-rw-r--r--nvim/.config/nvim/lua/plugins/fidget.lua2
-rw-r--r--nvim/.config/nvim/lua/plugins/gitsigns.lua141
-rw-r--r--nvim/.config/nvim/lua/plugins/gruvbox.lua1
-rw-r--r--nvim/.config/nvim/lua/plugins/init.lua (renamed from nvim/.config/nvim/lua/plugins/misc.lua)8
-rw-r--r--nvim/.config/nvim/lua/plugins/jdtls.lua1
-rw-r--r--nvim/.config/nvim/lua/plugins/lazydev.lua16
-rw-r--r--nvim/.config/nvim/lua/plugins/lint.lua2
-rw-r--r--nvim/.config/nvim/lua/plugins/lspconfig.lua18
-rw-r--r--nvim/.config/nvim/lua/plugins/mason.lua3
-rw-r--r--nvim/.config/nvim/lua/plugins/neotest.lua30
-rw-r--r--nvim/.config/nvim/lua/plugins/notify.lua13
-rw-r--r--nvim/.config/nvim/lua/plugins/oil.lua3
-rw-r--r--nvim/.config/nvim/lua/plugins/ollama.lua21
-rw-r--r--nvim/.config/nvim/lua/plugins/peek.lua2
-rw-r--r--nvim/.config/nvim/lua/plugins/presence.lua2
-rw-r--r--nvim/.config/nvim/lua/plugins/schemastore.lua3
-rw-r--r--nvim/.config/nvim/lua/plugins/sg.lua34
-rw-r--r--nvim/.config/nvim/lua/plugins/telescope.lua105
-rw-r--r--nvim/.config/nvim/lua/plugins/tokyonight.lua2
-rw-r--r--nvim/.config/nvim/lua/plugins/treesitter.lua3
-rw-r--r--nvim/.config/nvim/lua/plugins/typst_preview.lua2
-rw-r--r--nvim/.config/nvim/lua/tobyvin/lazy.lua1
-rw-r--r--nvim/.config/nvim/lua/tobyvin/lsp/configs.lua6
28 files changed, 269 insertions, 320 deletions
diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json
index 1101c1d..5bd4d52 100644
--- a/nvim/.config/nvim/lazy-lock.json
+++ b/nvim/.config/nvim/lazy-lock.json
@@ -1,10 +1,9 @@
{
"SchemaStore.nvim": { "branch": "main", "commit": "218a9887085b81b3eb0ee8f1e2d20c4a7fd7b1c9" },
"cellular-automaton.nvim": { "branch": "main", "commit": "11aea08aa084f9d523b0142c2cd9441b8ede09ed" },
- "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
- "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
+ "conform.nvim": { "branch": "master", "commit": "acc7337cfd24ddfa3109bfc8c258c09c88c5c450" },
"ferris.nvim": { "branch": "main", "commit": "b9cd307a4bb3de6d87fc5da26f0f2775f4e2873a" },
"fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },
"gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" },
@@ -22,26 +21,23 @@
"nvim-colorizer.lua": { "branch": "master", "commit": "194ec600488f7c7229668d0e80bd197f3a2b84ff" },
"nvim-jdtls": { "branch": "master", "commit": "99e4b2081de1d9162666cc7b563cbeb01c26b66b" },
"nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" },
- "nvim-lspconfig": { "branch": "master", "commit": "6c505d4220b521f3b0e7b645f6ce45fa914d0eed" },
+ "nvim-lspconfig": { "branch": "master", "commit": "652386deae739e38fa1bcf2f06e3e7de9b3436ba" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
"nvim-texlabconfig": { "branch": "master", "commit": "b817297fd07bd6c127df56d01f439f2f838c49ed" },
- "nvim-treesitter": { "branch": "master", "commit": "c79b068f395817c39ed147d4ee76855c36b846e6" },
- "nvim-treesitter-textobjects": { "branch": "master", "commit": "33a17515b79ddb10d750320fa994098bdc3e93ef" },
+ "nvim-treesitter": { "branch": "master", "commit": "3e0feeb062b29bb7d6d6df1e32ba28111c2bb734" },
+ "nvim-treesitter-textobjects": { "branch": "master", "commit": "ca93cb2c34b67ab22d01976fc90bc95627a3317f" },
"oil.nvim": { "branch": "master", "commit": "ace46a41a1ea56d544a3775adf30490f2abd9235" },
"ollama.nvim": { "branch": "main", "commit": "45e58779fecde7ac5b8f62800bbe7180d4b48507" },
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
"playtime.nvim": { "branch": "main", "commit": "894fe6ff5d8a4f28050019857c4a2f5d680178ca" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
- "sg.nvim": { "branch": "master", "commit": "2fb48ea69df2e1067540f305e75f63216abec38a" },
- "telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
- "telescope-live-grep-args.nvim": { "branch": "master", "commit": "649b662a8f476fd2c0289570764459e95ebaa3f3" },
- "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" },
+ "telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" },
"telescope-undo.nvim": { "branch": "main", "commit": "51be9ae7c42fc27c0b05505e3a0162e0f05fbb6a" },
- "telescope.nvim": { "branch": "master", "commit": "3b1600d0fd5172ad9fae00987362ca0ef3d8895d" },
- "tokyonight.nvim": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" },
+ "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
+ "tokyonight.nvim": { "branch": "main", "commit": "2cd12582c98a3552032824ffa67fd44b4d81184a" },
"typst-preview.nvim": { "branch": "master", "commit": "15eaaffc0a2d8cd871f485f399d1d67ed3322a0b" },
"vim-hjson": { "branch": "master", "commit": "adc104d4a4041a482e1af1914895a119e343c7e1" },
"vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" },
diff --git a/nvim/.config/nvim/lua/plugins/cmp.lua b/nvim/.config/nvim/lua/plugins/cmp.lua
index d430660..30a1a88 100644
--- a/nvim/.config/nvim/lua/plugins/cmp.lua
+++ b/nvim/.config/nvim/lua/plugins/cmp.lua
@@ -1,24 +1,23 @@
-local function in_comment()
- return vim.api.nvim_get_mode()["mode"] ~= "c"
- and require("cmp.config.context").in_treesitter_capture("comment")
- and require("cmp.config.context").in_syntax_group("Comment")
-end
-
----@type LazyPluginSpec
-local M = {
+---@type LazySpec
+local cmp = {
"hrsh7th/nvim-cmp",
- event = { "InsertEnter", "CmdlineEnter" },
+ event = { "InsertEnter" },
+ version = false,
dependencies = {
- "hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
- "hrsh7th/cmp-nvim-lsp",
- "hrsh7th/cmp-cmdline",
},
- opts = {
+}
+
+function cmp:opts(opts)
+ local mapping = require("cmp.config.mapping")
+ local context = require("cmp.config.context")
+ local default = require("cmp.config.default")()
+
+ return vim.tbl_extend("keep", opts, {
enabled = function()
- return require("cmp.config.default")().enabled() and vim.api.nvim_get_mode()["mode"] == "c"
- or not require("cmp.config.context").in_treesitter_capture("comment")
- or not require("cmp.config.context").in_syntax_group("Comment")
+ return default.enabled() and vim.api.nvim_get_mode()["mode"] == "c"
+ or not context.in_treesitter_capture("comment")
+ or not context.in_syntax_group("Comment")
end,
window = {
completion = {
@@ -37,73 +36,46 @@ local M = {
return vim_item
end,
},
- mapping = {
- ["<C-p>"] = {
- i = function(fallback)
- if not require("cmp").select_prev_item() then
- local release = require("cmp").core:suspend()
- fallback()
- vim.schedule(release)
- end
- end,
- },
- ["<C-n>"] = {
- i = function(fallback)
- if not require("cmp").select_next_item() then
- local release = require("cmp").core:suspend()
- fallback()
- vim.schedule(release)
- end
- end,
- },
- ["<C-d>"] = {
- i = function(fallback)
- if not require("cmp").scroll_docs(4) then
- fallback()
- end
- end,
- },
- ["<C-u>"] = {
- i = function(fallback)
- if not require("cmp").scroll_docs(-4) then
- fallback()
- end
- end,
- },
- ["<C-Space>"] = {
- i = function(fallback)
- if not require("cmp").complete({}) then
- fallback()
- end
- end,
- },
- ["<CR>"] = {
- i = function(fallback)
- if not require("cmp").confirm() then
- fallback()
- end
- end,
- },
- ["<C-y>"] = {
- i = function(fallback)
- if not require("cmp").confirm({ select = false }) then
- fallback()
- end
- end,
- },
- ["<C-e>"] = {
- i = function(fallback)
- if not require("cmp").abort() then
- fallback()
- end
- end,
- },
- },
+ mapping = mapping.preset.insert({
+ ["<C-d>"] = mapping.scroll_docs(4),
+ ["<C-u>"] = mapping.scroll_docs(-4),
+ ["<C-Space>"] = mapping.complete(),
+ ["<CR>"] = mapping.confirm({ select = false }),
+ }),
sources = {
- { name = "nvim_lsp" },
{ name = "path" },
},
+ })
+end
+
+---@type LazySpec
+local cmp_nvim_lsp = {
+ "hrsh7th/cmp-nvim-lsp",
+ opts = {},
+ specs = {
+ {
+ "hrsh7th/nvim-cmp",
+ opts = function(_, opts)
+ opts.sources = opts.sources or {}
+ table.insert(opts.sources, {
+ name = "nvim_lsp",
+ })
+ end,
+ },
},
}
+function cmp_nvim_lsp:init()
+ local defaults = vim.lsp.protocol.make_client_capabilities()
+ ---@diagnostic disable-next-line: duplicate-set-field
+ vim.lsp.protocol.make_client_capabilities = function()
+ return require("cmp_nvim_lsp").default_capabilities(defaults)
+ end
+end
+
+local M = {
+ cmp,
+ cmp_nvim_lsp,
+}
+
return M
diff --git a/nvim/.config/nvim/lua/plugins/colorize.lua b/nvim/.config/nvim/lua/plugins/colorize.lua
index aa37522..8aae136 100644
--- a/nvim/.config/nvim/lua/plugins/colorize.lua
+++ b/nvim/.config/nvim/lua/plugins/colorize.lua
@@ -1,3 +1,4 @@
+---@type LazySpec
local M = {
"NvChad/nvim-colorizer.lua",
ft = {
diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua
index b358988..99c90e0 100644
--- a/nvim/.config/nvim/lua/plugins/conform.lua
+++ b/nvim/.config/nvim/lua/plugins/conform.lua
@@ -1,28 +1,26 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"stevearc/conform.nvim",
- dev = true,
- version = "*",
cmd = { "ConformInfo" },
opts = {
format_on_save = false,
format_after_save = false,
formatters_by_ft = {
css = { "prettier" },
- html = { "prettier" },
- htmldjango = { "djlint" },
+ html = { "prettier", "injected" },
+ htmldjango = { "djlint", "injected" },
json = { "deno_fmt" },
jsonc = { "deno_fmt" },
lua = { "stylua" },
- markdown = { "mdformat", "markdownlint" },
+ markdown = { "mdformat", "markdownlint", "injected" },
nginx = { "nginxfmt" },
- plaintex = { "latexindent" },
+ plaintex = { "latexindent", "injected" },
sass = { "prettier" },
scss = { "prettier" },
sh = { "shfmt" },
- tex = { "latexindent" },
- typst = { "typstyle" },
- ["*"] = { "injected", "trim_whitespace", "trim_newlines" },
+ tex = { "latexindent", "injected" },
+ typst = { "typstyle", "injected" },
+ ["*"] = { "trim_whitespace", "trim_newlines" },
},
formatters = {
latexindent = {
diff --git a/nvim/.config/nvim/lua/plugins/ferris.lua b/nvim/.config/nvim/lua/plugins/ferris.lua
index 5010234..5f50d05 100644
--- a/nvim/.config/nvim/lua/plugins/ferris.lua
+++ b/nvim/.config/nvim/lua/plugins/ferris.lua
@@ -1,6 +1,7 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"vxpm/ferris.nvim",
+ version = false,
ft = { "rust" },
opts = {
url_handler = vim.ui.open,
diff --git a/nvim/.config/nvim/lua/plugins/fidget.lua b/nvim/.config/nvim/lua/plugins/fidget.lua
index 190388a..c72b1e5 100644
--- a/nvim/.config/nvim/lua/plugins/fidget.lua
+++ b/nvim/.config/nvim/lua/plugins/fidget.lua
@@ -1,6 +1,6 @@
+---@type LazySpec
local M = {
"j-hui/fidget.nvim",
- version = "*",
event = { "LspAttach" },
cmd = "Fidget",
opts = {
diff --git a/nvim/.config/nvim/lua/plugins/gitsigns.lua b/nvim/.config/nvim/lua/plugins/gitsigns.lua
index 0a46824..06e3437 100644
--- a/nvim/.config/nvim/lua/plugins/gitsigns.lua
+++ b/nvim/.config/nvim/lua/plugins/gitsigns.lua
@@ -1,83 +1,84 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
- "lewis6991/gitsigns.nvim",
- version = "*",
- event = "BufReadPre",
- dependencies = { "nvim-lua/plenary.nvim" },
- opts = {
- signs = {
- add = { text = "▎" },
- change = { text = "▎" },
- delete = { text = "󰐊" },
- topdelete = { text = "󰐊" },
- changedelete = { text = "▎" },
- },
- preview_config = { border = "single" },
- on_attach = function(bufnr)
- vim.keymap.set("n", "]c", function()
- if vim.wo.diff then
- return "]c"
- else
- return [[<Cmd>lua require("gitsigns").nav_hunk("next")<CR>]]
- end
- end, { expr = true, desc = "next hunk", buffer = bufnr })
+ "nvim-lua/plenary.nvim",
+ {
+ "lewis6991/gitsigns.nvim",
+ event = "BufReadPre",
+ opts = {
+ signs = {
+ add = { text = "▎" },
+ change = { text = "▎" },
+ delete = { text = "󰐊" },
+ topdelete = { text = "󰐊" },
+ changedelete = { text = "▎" },
+ },
+ preview_config = { border = "single" },
+ on_attach = function(bufnr)
+ vim.keymap.set("n", "]c", function()
+ if vim.wo.diff then
+ return "]c"
+ else
+ return [[<Cmd>lua require("gitsigns").nav_hunk("next")<CR>]]
+ end
+ end, { expr = true, desc = "next hunk", buffer = bufnr })
- vim.keymap.set("n", "[c", function()
- if vim.wo.diff then
- return "[c"
- else
- return [[<Cmd>lua require("gitsigns").nav_hunk("prev")<CR>]]
- end
- end, {
- expr = true,
- desc = "previous hunk",
- buffer = bufnr,
- })
+ vim.keymap.set("n", "[c", function()
+ if vim.wo.diff then
+ return "[c"
+ else
+ return [[<Cmd>lua require("gitsigns").nav_hunk("prev")<CR>]]
+ end
+ end, {
+ expr = true,
+ desc = "previous hunk",
+ buffer = bufnr,
+ })
- vim.keymap.set("n", "<leader>gr", require("gitsigns").reset_hunk, {
- desc = "reset hunk",
- buffer = bufnr,
- })
+ vim.keymap.set("n", "<leader>gr", require("gitsigns").reset_hunk, {
+ desc = "reset hunk",
+ buffer = bufnr,
+ })
- vim.keymap.set("v", "<leader>gr", function()
- require("gitsigns").reset_hunk({ vim.fn.getpos(".")[2], vim.fn.getpos("v")[2] })
- end, {
- desc = "reset hunk",
- buffer = bufnr,
- })
+ vim.keymap.set("v", "<leader>gr", function()
+ require("gitsigns").reset_hunk({ vim.fn.getpos(".")[2], vim.fn.getpos("v")[2] })
+ end, {
+ desc = "reset hunk",
+ buffer = bufnr,
+ })
- vim.keymap.set("n", "<leader>gs", require("gitsigns").stage_hunk, {
- desc = "stage hunk",
- buffer = bufnr,
- })
+ vim.keymap.set("n", "<leader>gs", require("gitsigns").stage_hunk, {
+ desc = "stage hunk",
+ buffer = bufnr,
+ })
- vim.keymap.set("v", "<leader>gs", function()
- require("gitsigns").stage_hunk({ vim.fn.getpos(".")[2], vim.fn.getpos("v")[2] })
- end, {
- desc = "stage hunk",
- buffer = bufnr,
- })
+ vim.keymap.set("v", "<leader>gs", function()
+ require("gitsigns").stage_hunk({ vim.fn.getpos(".")[2], vim.fn.getpos("v")[2] })
+ end, {
+ desc = "stage hunk",
+ buffer = bufnr,
+ })
- vim.keymap.set("n", "<leader>gu", require("gitsigns").undo_stage_hunk, {
- desc = "undo stage hunk",
- buffer = bufnr,
- })
+ vim.keymap.set("n", "<leader>gu", require("gitsigns").undo_stage_hunk, {
+ desc = "undo stage hunk",
+ buffer = bufnr,
+ })
- vim.keymap.set("n", "<leader>gR", require("gitsigns").reset_buffer, {
- desc = "reset buffer",
- buffer = bufnr,
- })
+ vim.keymap.set("n", "<leader>gR", require("gitsigns").reset_buffer, {
+ desc = "reset buffer",
+ buffer = bufnr,
+ })
- vim.keymap.set("n", "<leader>gS", require("gitsigns").stage_buffer, {
- desc = "stage buffer",
- buffer = bufnr,
- })
+ vim.keymap.set("n", "<leader>gS", require("gitsigns").stage_buffer, {
+ desc = "stage buffer",
+ buffer = bufnr,
+ })
- vim.keymap.set("n", "<leader>gU", require("gitsigns").reset_buffer_index, {
- desc = "undo stage buffer",
- buffer = bufnr,
- })
- end,
+ vim.keymap.set("n", "<leader>gU", require("gitsigns").reset_buffer_index, {
+ desc = "undo stage buffer",
+ buffer = bufnr,
+ })
+ end,
+ },
},
}
diff --git a/nvim/.config/nvim/lua/plugins/gruvbox.lua b/nvim/.config/nvim/lua/plugins/gruvbox.lua
index 87811ae..458e12c 100644
--- a/nvim/.config/nvim/lua/plugins/gruvbox.lua
+++ b/nvim/.config/nvim/lua/plugins/gruvbox.lua
@@ -1,6 +1,7 @@
---@type LazyPluginSpec
local M = {
"ellisonleao/gruvbox.nvim",
+ version = false,
priority = 1000,
opts = {
contrast = "hard",
diff --git a/nvim/.config/nvim/lua/plugins/misc.lua b/nvim/.config/nvim/lua/plugins/init.lua
index 1d58f11..6d0b709 100644
--- a/nvim/.config/nvim/lua/plugins/misc.lua
+++ b/nvim/.config/nvim/lua/plugins/init.lua
@@ -1,6 +1,11 @@
----@type LazySpec[]
+---@type LazySpec
local M = {
{
+ "nvim-lua/plenary.nvim",
+ version = false,
+ optional = true,
+ },
+ {
"eandrju/cellular-automaton.nvim",
cmd = "CellularAutomaton",
},
@@ -22,6 +27,7 @@ local M = {
},
{
"f3fora/nvim-texlabconfig",
+ version = false,
build = "go build -o ~/.local/bin",
ft = { "tex", "bib" },
opts = {},
diff --git a/nvim/.config/nvim/lua/plugins/jdtls.lua b/nvim/.config/nvim/lua/plugins/jdtls.lua
index 47e5db5..6e4e0a4 100644
--- a/nvim/.config/nvim/lua/plugins/jdtls.lua
+++ b/nvim/.config/nvim/lua/plugins/jdtls.lua
@@ -1,6 +1,7 @@
local M = {
"mfussenegger/nvim-jdtls",
ft = "java",
+ version = false,
opts = {
cmd = { "jdtls" },
},
diff --git a/nvim/.config/nvim/lua/plugins/lazydev.lua b/nvim/.config/nvim/lua/plugins/lazydev.lua
index 5cb1185..9832c62 100644
--- a/nvim/.config/nvim/lua/plugins/lazydev.lua
+++ b/nvim/.config/nvim/lua/plugins/lazydev.lua
@@ -1,10 +1,18 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"folke/lazydev.nvim",
ft = "lua",
cmd = "LazyDev",
dependencies = {
"Bilal2453/luvit-meta",
+ },
+ opts = {
+ library = {
+ { path = "luvit-meta/library", words = { "vim%.uv" } },
+ "lazy.nvim",
+ },
+ },
+ specs = {
{
"hrsh7th/nvim-cmp",
opts = function(_, opts)
@@ -16,12 +24,6 @@ local M = {
end,
},
},
- opts = {
- library = {
- { path = "luvit-meta/library", words = { "vim%.uv" } },
- "lazy.nvim",
- },
- },
}
return M
diff --git a/nvim/.config/nvim/lua/plugins/lint.lua b/nvim/.config/nvim/lua/plugins/lint.lua
index 443971e..b4ade5b 100644
--- a/nvim/.config/nvim/lua/plugins/lint.lua
+++ b/nvim/.config/nvim/lua/plugins/lint.lua
@@ -1,4 +1,4 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"mfussenegger/nvim-lint",
opts = {
diff --git a/nvim/.config/nvim/lua/plugins/lspconfig.lua b/nvim/.config/nvim/lua/plugins/lspconfig.lua
index a559894..3a8d3ec 100644
--- a/nvim/.config/nvim/lua/plugins/lspconfig.lua
+++ b/nvim/.config/nvim/lua/plugins/lspconfig.lua
@@ -1,27 +1,17 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"neovim/nvim-lspconfig",
+ version = false,
event = "BufReadPre",
- dependencies = {
- { "hrsh7th/cmp-nvim-lsp", opts = {} },
- },
}
function M:config()
- local capabilities = require("lspconfig").util.default_config.capabilities
- capabilities = vim.tbl_deep_extend(
- "force",
- capabilities,
- require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
- )
- require("lspconfig").util.default_config.capabilities = capabilities
-
require("lspconfig.ui.windows").default_options.border = "single"
- local avail = require("lspconfig").util.available_servers()
+ local available_servers = require("lspconfig").util.available_servers()
vim.iter(require("tobyvin.lsp.configs")):each(function(name, config)
- if not vim.tbl_contains(avail, name) then
+ if not vim.tbl_contains(available_servers, name) then
require("lspconfig")[name].setup(config)
end
end)
diff --git a/nvim/.config/nvim/lua/plugins/mason.lua b/nvim/.config/nvim/lua/plugins/mason.lua
index 5eefd5d..28833de 100644
--- a/nvim/.config/nvim/lua/plugins/mason.lua
+++ b/nvim/.config/nvim/lua/plugins/mason.lua
@@ -1,7 +1,6 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"williamboman/mason.nvim",
- version = "*",
build = ":MasonUpdate",
lazy = false,
opts = {
diff --git a/nvim/.config/nvim/lua/plugins/neotest.lua b/nvim/.config/nvim/lua/plugins/neotest.lua
index 1c952f7..d610ed1 100644
--- a/nvim/.config/nvim/lua/plugins/neotest.lua
+++ b/nvim/.config/nvim/lua/plugins/neotest.lua
@@ -1,18 +1,10 @@
----@type LazyPluginSpec
-local M = {
+---@type LazySpec
+local neotest = {
"nvim-neotest/neotest",
- dependencies = {
- "nvim-neotest/nvim-nio",
- "nvim-lua/plenary.nvim",
- "nvim-neotest/neotest-go",
- "nvim-neotest/neotest-plenary",
- "nvim-neotest/neotest-python",
- "rouge8/neotest-rust",
- "nvim-treesitter/nvim-treesitter",
- },
+ dependencies = {},
}
-function M:opts(opts)
+function neotest:opts(opts)
return vim.tbl_extend("keep", opts, {
adapters = {
require("neotest-go"),
@@ -23,7 +15,7 @@ function M:opts(opts)
})
end
-function M:init()
+function neotest:init()
vim.keymap.set("n", "<leader>tt", function()
require("neotest").run.run({ suite = false, strategy = "integrated" })
end, { desc = "run nearest test" })
@@ -32,4 +24,16 @@ function M:init()
end, { desc = "debug nearest test" })
end
+---@type LazySpec
+local M = {
+ "nvim-neotest/nvim-nio",
+ "nvim-lua/plenary.nvim",
+ "nvim-neotest/neotest-go",
+ "nvim-neotest/neotest-plenary",
+ "nvim-neotest/neotest-python",
+ "rouge8/neotest-rust",
+ "nvim-treesitter/nvim-treesitter",
+ neotest,
+}
+
return M
diff --git a/nvim/.config/nvim/lua/plugins/notify.lua b/nvim/.config/nvim/lua/plugins/notify.lua
index d1669fc..7a25fec 100644
--- a/nvim/.config/nvim/lua/plugins/notify.lua
+++ b/nvim/.config/nvim/lua/plugins/notify.lua
@@ -1,17 +1,10 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"rcarriga/nvim-notify",
- version = "*",
opts = {
- timeout = 3000,
- background_colour = "Pmenu",
- max_height = function()
- return math.floor(vim.o.lines * 0.75)
- end,
- max_width = function()
- return math.floor(vim.o.columns * 0.75)
- end,
+ max_width = math.min(vim.o.columns, 80),
render = "wrapped-compact",
+ stages = "no_animation",
},
}
diff --git a/nvim/.config/nvim/lua/plugins/oil.lua b/nvim/.config/nvim/lua/plugins/oil.lua
index ab33ef5..4bdaadd 100644
--- a/nvim/.config/nvim/lua/plugins/oil.lua
+++ b/nvim/.config/nvim/lua/plugins/oil.lua
@@ -1,7 +1,6 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"stevearc/oil.nvim",
- version = "*",
cmd = { "Oil" },
opts = {
default_file_explorer = true,
diff --git a/nvim/.config/nvim/lua/plugins/ollama.lua b/nvim/.config/nvim/lua/plugins/ollama.lua
index 3ea3429..8499684 100644
--- a/nvim/.config/nvim/lua/plugins/ollama.lua
+++ b/nvim/.config/nvim/lua/plugins/ollama.lua
@@ -1,14 +1,15 @@
+---@type LazySpec
local M = {
- "nomnivore/ollama.nvim",
- dependencies = {
- "nvim-lua/plenary.nvim",
- },
- cmd = {
- "Ollama",
- "OllamaModel",
- },
- opts = {
- model = "deepseek-coder:6.7b",
+ "nvim-lua/plenary.nvim",
+ {
+ "nomnivore/ollama.nvim",
+ cmd = {
+ "Ollama",
+ "OllamaModel",
+ },
+ opts = {
+ model = "deepseek-coder:6.7b",
+ },
},
}
diff --git a/nvim/.config/nvim/lua/plugins/peek.lua b/nvim/.config/nvim/lua/plugins/peek.lua
index be8f503..7772d62 100644
--- a/nvim/.config/nvim/lua/plugins/peek.lua
+++ b/nvim/.config/nvim/lua/plugins/peek.lua
@@ -1,4 +1,4 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"toppair/peek.nvim",
cond = vim.fn.executable("deno") == 1,
diff --git a/nvim/.config/nvim/lua/plugins/presence.lua b/nvim/.config/nvim/lua/plugins/presence.lua
index 3599f65..0e02cba 100644
--- a/nvim/.config/nvim/lua/plugins/presence.lua
+++ b/nvim/.config/nvim/lua/plugins/presence.lua
@@ -1,4 +1,4 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"andweeb/presence.nvim",
event = "UIEnter",
diff --git a/nvim/.config/nvim/lua/plugins/schemastore.lua b/nvim/.config/nvim/lua/plugins/schemastore.lua
index 4be26bd..b424b5a 100644
--- a/nvim/.config/nvim/lua/plugins/schemastore.lua
+++ b/nvim/.config/nvim/lua/plugins/schemastore.lua
@@ -1,6 +1,7 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"b0o/SchemaStore.nvim",
+ version = false,
}
function M.init()
diff --git a/nvim/.config/nvim/lua/plugins/sg.lua b/nvim/.config/nvim/lua/plugins/sg.lua
deleted file mode 100644
index 3de7718..0000000
--- a/nvim/.config/nvim/lua/plugins/sg.lua
+++ /dev/null
@@ -1,34 +0,0 @@
-local M = {
- "sourcegraph/sg.nvim",
- version = "*",
- cmd = {
- "CodyDo",
- "CodyAsk",
- "CodyChat",
- "CodyTask",
- "CodyToggle",
- "CodyRestart",
- "CodyTaskNext",
- "CodyTaskPrev",
- "CodyTaskView",
- "CodyTaskAccept",
- "SourcegraphInfo",
- "SourcegraphLink",
- "SourcegraphBuild",
- "SourcegraphLogin",
- "SourcegraphSearch",
- "SourcegraphDownloadBinaries",
- },
- dependencies = {
- "nvim-lua/plenary.nvim",
- "nvim-telescope/telescope.nvim",
- },
- opts = {
- accept_tos = true,
- download_binaries = false,
- skip_node_check = true,
- on_attach = function() end,
- },
-}
-
-return M
diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua
index 0daaebd..ff4fd5e 100644
--- a/nvim/.config/nvim/lua/plugins/telescope.lua
+++ b/nvim/.config/nvim/lua/plugins/telescope.lua
@@ -1,18 +1,7 @@
----@type LazyPluginSpec
-local M = {
+---@type LazySpec
+local telescope = {
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
- dependencies = {
- "nvim-lua/plenary.nvim",
- {
- "nvim-telescope/telescope-fzf-native.nvim",
- build = "make",
- },
- "nvim-telescope/telescope-live-grep-args.nvim",
- "nvim-telescope/telescope-dap.nvim",
- "nvim-telescope/telescope-symbols.nvim",
- "debugloop/telescope-undo.nvim",
- },
opts = {
defaults = {
borderchars = { "─", "│", "─", "│", "┌", "┐", "┘", "└" },
@@ -78,42 +67,72 @@ local M = {
},
}
-function M:config(opts)
- opts.extensions.undo = {
- mappings = {
- i = {
- ["<cr>"] = require("telescope-undo.actions").restore,
- ["<C-cr>"] = require("telescope-undo.actions").yank_additions,
- ["<S-cr>"] = require("telescope-undo.actions").yank_deletions,
- },
- },
- }
+function telescope:init()
+ local builtin = function(name)
+ return function()
+ require("telescope.builtin")[name]()
+ end
+ end
- require("telescope").setup(opts)
- require("telescope").load_extension("fzf")
- require("telescope").load_extension("undo")
+ vim.keymap.set("n", "<leader>fa", builtin("autocommands"), { desc = "autocommands" })
+ vim.keymap.set("n", "<leader>fb", builtin("buffers"), { desc = "buffers" })
+ vim.keymap.set("n", "<leader>fc", builtin("commands"), { desc = "commands" })
+ vim.keymap.set("n", "<leader>fd", builtin("lsp_dynamic_workspace_symbols"), { desc = "lsp symbols" })
+ vim.keymap.set("n", "<leader>ff", builtin("find_files"), { desc = "find files" })
+ vim.keymap.set("n", "<leader>fF", builtin("filetypes"), { desc = "filetypes" })
+ vim.keymap.set("n", "<leader>fh", builtin("help_tags"), { desc = "help" })
+ vim.keymap.set("n", "<leader>fH", builtin("highlights"), { desc = "highlights" })
+ vim.keymap.set("n", "<leader>fk", builtin("keymaps"), { desc = "keymaps" })
+ vim.keymap.set("n", "<leader>fm", builtin("marks"), { desc = "marks" })
+ vim.keymap.set("n", "<leader>fo", builtin("oldfiles"), { desc = "old files" })
+ vim.keymap.set("n", "<leader>fr", builtin("resume"), { desc = "resume" })
+ vim.keymap.set("n", "<leader>gt", builtin("git_status"), { desc = "status" })
+end
+
+---@type LazySpec
+local telescope_live_grep_args = {
+ "nvim-telescope/telescope-live-grep-args.nvim",
+}
- local builtin = require("telescope.builtin")
- local extensions = require("telescope").extensions
+function telescope_live_grep_args:init()
+ vim.keymap.set("n", "<leader>fg", function()
+ require("telescope").extensions.live_grep_args.live_grep_args()
+ end, { desc = "live grep" })
- vim.keymap.set("n", "<leader>fa", builtin.autocommands, { desc = "autocommands" })
- vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "buffers" })
- vim.keymap.set("n", "<leader>fc", builtin.commands, { desc = "commands" })
- vim.keymap.set("n", "<leader>fd", builtin.lsp_dynamic_workspace_symbols, { desc = "lsp symbols" })
- vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "find files" })
- vim.keymap.set("n", "<leader>fF", builtin.filetypes, { desc = "filetypes" })
- vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "help" })
- vim.keymap.set("n", "<leader>fH", builtin.highlights, { desc = "highlights" })
- vim.keymap.set("n", "<leader>fk", builtin.keymaps, { desc = "keymaps" })
- vim.keymap.set("n", "<leader>fm", builtin.marks, { desc = "marks" })
- vim.keymap.set("n", "<leader>fo", builtin.oldfiles, { desc = "old files" })
- vim.keymap.set("n", "<leader>fr", builtin.resume, { desc = "resume" })
- vim.keymap.set("n", "<leader>gt", builtin.git_status, { desc = "status" })
- vim.keymap.set("n", "<leader>fg", extensions.live_grep_args.live_grep_args, { desc = "live grep" })
vim.keymap.set("v", "<leader>fg", function()
require("telescope-live-grep-args.shortcuts").grep_visual_selection()
end, { desc = "live grep selection" })
- vim.keymap.set("n", "<leader>fu", extensions.undo.undo, { desc = "undo" })
end
+---@type LazySpec
+local telescope_undo = {
+ "debugloop/telescope-undo.nvim",
+ specs = {
+ "nvim-telescope/telescope.nvim",
+ opts = {
+ extensions = {
+ undo = {},
+ },
+ },
+ },
+}
+
+function telescope_undo:init()
+ vim.keymap.set("n", "<leader>fu", function()
+ require("telescope").extensions.undo.undo()
+ end, { desc = "undo" })
+end
+
+---@type LazySpec
+local M = {
+ "nvim-lua/plenary.nvim",
+ {
+ "nvim-telescope/telescope-fzf-native.nvim",
+ build = "make",
+ },
+ telescope_undo,
+ telescope_live_grep_args,
+ telescope,
+}
+
return M
diff --git a/nvim/.config/nvim/lua/plugins/tokyonight.lua b/nvim/.config/nvim/lua/plugins/tokyonight.lua
index a4439bd..2ed658e 100644
--- a/nvim/.config/nvim/lua/plugins/tokyonight.lua
+++ b/nvim/.config/nvim/lua/plugins/tokyonight.lua
@@ -1,4 +1,4 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"folke/tokyonight.nvim",
opts = {
diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua
index 56acf57..c445a6b 100644
--- a/nvim/.config/nvim/lua/plugins/treesitter.lua
+++ b/nvim/.config/nvim/lua/plugins/treesitter.lua
@@ -1,6 +1,7 @@
----@type LazyPluginSpec
+---@type LazySpec
local M = {
"nvim-treesitter/nvim-treesitter",
+ version = false,
build = ":TSUpdate",
event = "BufReadPre",
cmd = {
diff --git a/nvim/.config/nvim/lua/plugins/typst_preview.lua b/nvim/.config/nvim/lua/plugins/typst_preview.lua
index 64afe35..c3ec229 100644
--- a/nvim/.config/nvim/lua/plugins/typst_preview.lua
+++ b/nvim/.config/nvim/lua/plugins/typst_preview.lua
@@ -1,7 +1,7 @@
+---@type LazySpec
local M = {
"chomosuke/typst-preview.nvim",
ft = "typst",
- version = "*",
opts = {
invert_colors = "auto",
},
diff --git a/nvim/.config/nvim/lua/tobyvin/lazy.lua b/nvim/.config/nvim/lua/tobyvin/lazy.lua
index 5191d68..1317c8a 100644
--- a/nvim/.config/nvim/lua/tobyvin/lazy.lua
+++ b/nvim/.config/nvim/lua/tobyvin/lazy.lua
@@ -14,6 +14,7 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", {
defaults = {
lazy = true,
+ version = "*",
},
dev = {
path = "~/.local/src",
diff --git a/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua b/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua
index dea2b21..4db6608 100644
--- a/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua
+++ b/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua
@@ -181,11 +181,7 @@ local M = {
})
end,
},
- ruff_lsp = {
- on_attach = function(client)
- client.server_capabilities.hoverProvider = false
- end,
- },
+ ruff = {},
taplo = {},
texlab = {
settings = {