summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.lock109
-rw-r--r--flake.nix50
-rw-r--r--lsp/angular-language-server.lua11
-rw-r--r--lsp/biome.lua14
-rw-r--r--lsp/clangd.lua21
-rw-r--r--lsp/lua-language-server.lua8
-rw-r--r--lsp/qmlls.lua5
-rw-r--r--lsp/rust-analyzer.lua25
-rw-r--r--lsp/typescript-language-server.lua39
-rw-r--r--lua/config/lsp.lua60
-rw-r--r--lua/config/options.lua15
-rw-r--r--lua/config/plugins/completion.lua53
-rw-r--r--lua/config/plugins/debug.lua23
-rw-r--r--lua/config/plugins/extra.lua138
-rw-r--r--lua/config/plugins/formatting.lua11
-rw-r--r--lua/config/plugins/fuzzy.lua94
-rw-r--r--lua/config/plugins/init.lua2
-rw-r--r--lua/config/plugins/snippets.lua13
-rw-r--r--lua/config/plugins/treesitter.lua8
-rw-r--r--lua/config/plugins/ui.lua40
20 files changed, 603 insertions, 136 deletions
diff --git a/flake.lock b/flake.lock
index 26fc91d..8243df5 100644
--- a/flake.lock
+++ b/flake.lock
@@ -3,11 +3,11 @@
"flake-compat": {
"flake": false,
"locked": {
- "lastModified": 1733328505,
- "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
+ "lastModified": 1747046372,
+ "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
- "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
+ "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
@@ -19,11 +19,11 @@
"flake-compat_2": {
"flake": false,
"locked": {
- "lastModified": 1696426674,
- "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
+ "lastModified": 1747046372,
+ "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
- "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
+ "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
@@ -40,11 +40,11 @@
]
},
"locked": {
- "lastModified": 1741352980,
- "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=",
+ "lastModified": 1759362264,
+ "narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=",
"owner": "hercules-ci",
"repo": "flake-parts",
- "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9",
+ "rev": "758cf7296bee11f1706a574c77d072b8a7baa881",
"type": "github"
},
"original": {
@@ -53,27 +53,6 @@
"type": "github"
}
},
- "flake-parts_2": {
- "inputs": {
- "nixpkgs-lib": [
- "neovim-nightly-overlay",
- "hercules-ci-effects",
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1741352980,
- "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=",
- "owner": "hercules-ci",
- "repo": "flake-parts",
- "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9",
- "type": "github"
- },
- "original": {
- "id": "flake-parts",
- "type": "indirect"
- }
- },
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
@@ -84,11 +63,11 @@
]
},
"locked": {
- "lastModified": 1742649964,
- "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
+ "lastModified": 1759523803,
+ "narHash": "sha256-PTod9NG+i3XbbnBKMl/e5uHDBYpwIWivQ3gOWSEuIEM=",
"owner": "cachix",
"repo": "git-hooks.nix",
- "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
+ "rev": "cfc9f7bb163ad8542029d303e599c0f7eee09835",
"type": "github"
},
"original": {
@@ -121,18 +100,21 @@
},
"hercules-ci-effects": {
"inputs": {
- "flake-parts": "flake-parts_2",
+ "flake-parts": [
+ "neovim-nightly-overlay",
+ "flake-parts"
+ ],
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
- "lastModified": 1742014779,
- "narHash": "sha256-I6fG1zrfdLFcp/imGZElig0BJO3YU0QEXLgvwWoOpJ8=",
+ "lastModified": 1758022363,
+ "narHash": "sha256-ENUhCRWgSX4ni751HieNuQoq06dJvApV/Nm89kh+/A0=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
- "rev": "524637ef84c177661690b924bf64a1ce18072a2c",
+ "rev": "1a3667d33e247ad35ca250698d63f49a5453d824",
"type": "github"
},
"original": {
@@ -152,11 +134,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
- "lastModified": 1743207056,
- "narHash": "sha256-Ds/eKU6M8WuP7U+y13041tdqz24/frq2yP9CohyVlDQ=",
+ "lastModified": 1759795531,
+ "narHash": "sha256-iY43k/GpJJqv5WmHsJpDsOZsOqb2qydM7wWnpJygiUk=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
- "rev": "d9eee4fbfd7fe14b9a2019079ecde37e59fc109e",
+ "rev": "df3d6d30529e6f4d2c1709914cb3e6e3896dd64e",
"type": "github"
},
"original": {
@@ -168,11 +150,11 @@
"neovim-src": {
"flake": false,
"locked": {
- "lastModified": 1743202909,
- "narHash": "sha256-cNSjnWG1vtkWLT5hvmiesuGmOppb1R6Z9V11hv2mMew=",
+ "lastModified": 1759794827,
+ "narHash": "sha256-eN26ZJbzwuv0fvc33v4vR5hESWr/+TzJUXaKfdUQx+I=",
"owner": "neovim",
"repo": "neovim",
- "rev": "cb31663663b9be92dd9c2fbe06ccea88625b2fca",
+ "rev": "1c4e0e50449d95465e7f256d39fea54b307e0e33",
"type": "github"
},
"original": {
@@ -183,11 +165,11 @@
},
"nixCats": {
"locked": {
- "lastModified": 1743207292,
- "narHash": "sha256-Hf23aM/FRGCvT/oNyPUZ2kw9j2ptpkBo3UzdO2kORXs=",
+ "lastModified": 1759730664,
+ "narHash": "sha256-boRlBQ/c4CaHsK/z04QL6+t81mcar37Io94HBX2GflY=",
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
- "rev": "7cf13e3215570450a432cf32a5ae7dd82a4f63e1",
+ "rev": "77dffad8235eb77684fcb7599487c8e9f23d5b8f",
"type": "github"
},
"original": {
@@ -198,11 +180,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1743076231,
- "narHash": "sha256-yQugdVfi316qUfqzN8JMaA2vixl+45GxNm4oUfXlbgw=",
+ "lastModified": 1759632233,
+ "narHash": "sha256-krgZxGAIIIKFJS+UB0l8do3sYUDWJc75M72tepmVMzE=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "6c5963357f3c1c840201eda129a99d455074db04",
+ "rev": "d7f52a7a640bc54c7bb414cca603835bf8dd4b10",
"type": "github"
},
"original": {
@@ -214,11 +196,11 @@
},
"nixpkgs_2": {
"locked": {
- "lastModified": 1743076231,
- "narHash": "sha256-yQugdVfi316qUfqzN8JMaA2vixl+45GxNm4oUfXlbgw=",
+ "lastModified": 1759632233,
+ "narHash": "sha256-krgZxGAIIIKFJS+UB0l8do3sYUDWJc75M72tepmVMzE=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "6c5963357f3c1c840201eda129a99d455074db04",
+ "rev": "d7f52a7a640bc54c7bb414cca603835bf8dd4b10",
"type": "github"
},
"original": {
@@ -244,6 +226,22 @@
"type": "github"
}
},
+ "plugins-multicursor-nvim": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1758976684,
+ "narHash": "sha256-QhYUwFGYXoeXr2dRraHvpYx4z/7R9TyL9OC2sGmIAMY=",
+ "owner": "jake-stewart",
+ "repo": "multicursor.nvim",
+ "rev": "0c6ceae228bf209e8b8717df9de500770c4e7022",
+ "type": "github"
+ },
+ "original": {
+ "owner": "jake-stewart",
+ "repo": "multicursor.nvim",
+ "type": "github"
+ }
+ },
"plugins-telepath-nvim": {
"flake": false,
"locked": {
@@ -266,6 +264,7 @@
"nixCats": "nixCats",
"nixpkgs": "nixpkgs_2",
"plugins-leap-spooky-nvim": "plugins-leap-spooky-nvim",
+ "plugins-multicursor-nvim": "plugins-multicursor-nvim",
"plugins-telepath-nvim": "plugins-telepath-nvim"
}
},
@@ -277,11 +276,11 @@
]
},
"locked": {
- "lastModified": 1743081648,
- "narHash": "sha256-WRAylyYptt6OX5eCEBWyTwOEqEtD6zt33rlUkr6u3cE=",
+ "lastModified": 1758728421,
+ "narHash": "sha256-ySNJ008muQAds2JemiyrWYbwbG+V7S5wg3ZVKGHSFu8=",
"owner": "numtide",
"repo": "treefmt-nix",
- "rev": "29a3d7b768c70addce17af0869f6e2bd8f5be4b7",
+ "rev": "5eda4ee8121f97b218f7cc73f5172098d458f1d1",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index 3ec4206..a978d4c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -47,6 +47,11 @@
url = "github:rasulomaroff/telepath.nvim";
flake = false;
};
+
+ plugins-multicursor-nvim = {
+ url = "github:jake-stewart/multicursor.nvim";
+ flake = false;
+ };
};
# see :help nixCats.flake.outputs
@@ -133,6 +138,10 @@
nodejs-slim
];
+ c = [
+ clang-tools
+ ];
+
lua = [
lua-language-server
stylua
@@ -144,12 +153,25 @@
nixfmt-rfc-style
];
+ qml = [ kdePackages.qtdeclarative ];
+
rust = [
# NOTE: required to find project root
# NOTE: for now unused, so commented out
# cargo
rust-analyzer
];
+
+ typescript = [
+ angular-language-server
+ biome
+ prettierd
+ typescript-language-server
+ ];
+
+ debug = [
+ lldb
+ ];
};
};
@@ -191,6 +213,10 @@
leap-spooky-nvim
telepath-nvim
];
+
+ extra = [
+ multicursor-nvim
+ ];
};
general = with pkgs.vimPlugins; {
@@ -207,11 +233,17 @@
treesitter = [
nvim-treesitter.withAllGrammars
nvim-treesitter-textobjects
+ nvim-ts-autotag
];
completion = [ blink-cmp ];
+ snippets = [
+ luasnip
+ friendly-snippets
+ ];
+
# NOTE: On NeoVim 0.11+ nvim-lspconfig is not required due to native API
- lsp = [ ];
+ lsp = [ lazydev-nvim ];
mini = [
mini-ai
@@ -227,13 +259,27 @@
git = [ gitsigns-nvim ];
+ debug = [
+ nvim-dap
+ nvim-dap-ui
+ nvim-dap-virtual-text
+ ];
+
ui = [
bufferline-nvim
+ lualine-nvim
noice-nvim
todo-comments-nvim
];
- extra = [ which-key-nvim ];
+ extra = [
+ oil-nvim
+ yanky-nvim
+ which-key-nvim
+
+ # SuperCollider
+ scnvim
+ ];
};
};
diff --git a/lsp/angular-language-server.lua b/lsp/angular-language-server.lua
new file mode 100644
index 0000000..63a61c6
--- /dev/null
+++ b/lsp/angular-language-server.lua
@@ -0,0 +1,11 @@
+return {
+ cmd = { "ngserver", "--stdio" },
+ root_markers = { "angular.json" },
+ filetypes = {
+ "html",
+ "htmlangular",
+ "typescript",
+ "typescriptreact",
+ "typescript.tsx",
+ },
+}
diff --git a/lsp/biome.lua b/lsp/biome.lua
new file mode 100644
index 0000000..b55de9d
--- /dev/null
+++ b/lsp/biome.lua
@@ -0,0 +1,14 @@
+return {
+ cmd = { "biome", "lsp-proxy" },
+ root_markers = { "package.json", "biome.json", "biome.jsonc" },
+ filetypes = {
+ "json",
+ "jsonc",
+ "javascript",
+ "javascriptreact",
+ "javascript.jsx",
+ "typescript",
+ "typescriptreact",
+ "typescript.tsx",
+ },
+}
diff --git a/lsp/clangd.lua b/lsp/clangd.lua
new file mode 100644
index 0000000..9aced07
--- /dev/null
+++ b/lsp/clangd.lua
@@ -0,0 +1,21 @@
+return {
+ cmd = { "clangd" },
+ filetypes = { "c", "cpp", "objc", "objcpp", "cuda" },
+ root_markers = {
+ ".clangd",
+ ".clang-tidy",
+ ".clang-format",
+ "compile_commands.json",
+ "compile_flags.txt",
+ "configure.ac", -- AutoTools
+ ".git",
+ },
+ capabilities = {
+ textDocument = {
+ completion = {
+ editsNearCursor = true,
+ },
+ },
+ offsetEncoding = { "utf-8", "utf-16" },
+ },
+}
diff --git a/lsp/lua-language-server.lua b/lsp/lua-language-server.lua
index 72a0847..ce0d902 100644
--- a/lsp/lua-language-server.lua
+++ b/lsp/lua-language-server.lua
@@ -1,6 +1,6 @@
return {
cmd = { "lua-language-server" },
- root_markers = { ".luarc.json" },
+ root_markers = { ".luarc.json", ".git" },
filetypes = { "lua" },
settings = {
@@ -13,6 +13,12 @@ return {
disable = { "missing-fields" },
},
telemetry = { enabled = false },
+
+ workspace = {
+ library = {
+ vim.env.VIMRUNTIME,
+ },
+ },
},
},
}
diff --git a/lsp/qmlls.lua b/lsp/qmlls.lua
new file mode 100644
index 0000000..92dc83b
--- /dev/null
+++ b/lsp/qmlls.lua
@@ -0,0 +1,5 @@
+return {
+ cmd = { "qmlls", "-E" },
+ root_markers = { ".qmlls.ini", ".git" },
+ filetypes = { "qml", "qmljs" },
+}
diff --git a/lsp/rust-analyzer.lua b/lsp/rust-analyzer.lua
index 51f5037..78ed2c5 100644
--- a/lsp/rust-analyzer.lua
+++ b/lsp/rust-analyzer.lua
@@ -1,8 +1,33 @@
+local serverReady = {}
+
return {
cmd = { "rust-analyzer" },
root_markers = { "Cargo.toml" },
filetypes = { "rust" },
+ capabilities = {
+ experimental = {
+ serverStatusNotification = true,
+ },
+ },
+
+ handlers = {
+ ["experimental/serverStatus"] = function(_, result, ctx)
+ -- Try to fix inlay hints not being shown on start of
+ if result.quiescent and not serverReady[ctx.client_id] then
+ for _, bufnr in ipairs(vim.lsp.get_buffers_by_client_id(ctx.client_id)) do
+ -- Re-enable inlay hints so they are refreshed
+ if vim.lsp.inlay_hint.is_enabled() then
+ vim.lsp.inlay_hint.enable(false, { bufnr = bufnr })
+ vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
+ end
+
+ serverReady[ctx.client_id] = true
+ end
+ end
+ end,
+ },
+
settings = {
["rust-analyzer"] = {
checkOnSave = { command = "clippy" },
diff --git a/lsp/typescript-language-server.lua b/lsp/typescript-language-server.lua
new file mode 100644
index 0000000..41a3110
--- /dev/null
+++ b/lsp/typescript-language-server.lua
@@ -0,0 +1,39 @@
+return {
+ cmd = { "typescript-language-server", "--stdio" },
+ root_markers = { "package.json", "jsconfig.json", "tsconfig.json" },
+ filetypes = {
+ "javascript",
+ "javascriptreact",
+ "javascript.jsx",
+ "typescript",
+ "typescriptreact",
+ "typescript.tsx",
+ },
+ settings = {
+ typescript = {
+ inlayHints = {
+ includeInlayParameterNameHints = "all",
+ includeInlayParameterNameHintsWhenArgumentMatchesName = true,
+ includeInlayVariableTypeHints = true,
+ includeInlayFunctionParameterTypeHints = true,
+ includeInlayVariableTypeHintsWhenTypeMatchesName = true,
+ includeInlayPropertyDeclarationTypeHints = true,
+ includeInlayFunctionLikeReturnTypeHints = true,
+ includeInlayEnumMemberValueHints = true,
+ },
+ },
+ javascript = {
+ inlayHints = {
+ includeInlayParameterNameHints = "all",
+ includeInlayParameterNameHintsWhenArgumentMatchesName = true,
+ includeInlayVariableTypeHints = true,
+
+ includeInlayFunctionParameterTypeHints = true,
+ includeInlayVariableTypeHintsWhenTypeMatchesName = true,
+ includeInlayPropertyDeclarationTypeHints = true,
+ includeInlayFunctionLikeReturnTypeHints = true,
+ includeInlayEnumMemberValueHints = true,
+ },
+ },
+ },
+}
diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua
index a5bf027..059b754 100644
--- a/lua/config/lsp.lua
+++ b/lua/config/lsp.lua
@@ -5,6 +5,60 @@ vim.diagnostic.config({
virtual_text = true,
})
-vim.lsp.enable("lua-language-server")
-vim.lsp.enable("nixd")
-vim.lsp.enable("rust-analyzer")
+vim.lsp.enable({
+ "clangd",
+
+ "lua-language-server",
+
+ "nixd",
+
+ "qmlls",
+
+ "rust-analyzer",
+
+ "angular-language-server",
+ "biome",
+ "typescript-language-server",
+})
+
+vim.lsp.inlay_hint.enable(true)
+
+-- Enable Angular HTML Treesitter grammar when needed
+vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
+ pattern = { "*.component.html", "*.container.html" },
+ callback = function()
+ vim.bo.filetype = "htmlangular"
+ vim.treesitter.start(nil, "angular")
+ end,
+})
+
+vim.api.nvim_create_autocmd("LspAttach", {
+ callback = function(args)
+ local buffer = args.buf
+ local client = vim.lsp.get_client_by_id(args.data.client_id)
+ if client then
+ -- Keybindings
+ local map = vim.keymap.set
+ local opts = { buffer = buffer }
+
+ map("n", "<leader>cr", vim.lsp.buf.rename, opts)
+ map("n", "gd", vim.lsp.buf.definition, opts)
+ map("n", "gD", vim.lsp.buf.declaration, opts)
+ map("n", "gI", vim.lsp.buf.implementation, opts)
+ map("n", "gy", vim.lsp.buf.type_definition, opts)
+ map("n", "gr", vim.lsp.buf.references, opts)
+
+ map("n", "K", function()
+ return vim.lsp.buf.hover()
+ end, opts)
+
+ map("n", "gK", function()
+ return vim.lsp.buf.signature_help()
+ end, opts)
+
+ map({ "n", "i" }, "<C-;>", function()
+ return vim.lsp.buf.signature_help()
+ end, opts)
+ end
+ end,
+})
diff --git a/lua/config/options.lua b/lua/config/options.lua
index 1cacdeb..6208be7 100644
--- a/lua/config/options.lua
+++ b/lua/config/options.lua
@@ -18,6 +18,9 @@ if os.getenv("WAYLAND_DISPLAY") and vim.fn.exepath("wl-copy") ~= "" then
}
end
+-- Disable deprecation warnings
+vim.deprecate = function(_) end
+
-- Terminal colors
vim.opt.termguicolors = true
@@ -56,3 +59,15 @@ map("n", "N", "Nzzzv", { desc = "Previous Search Result" })
-- Reset search highlight on ESC
map("n", "<Esc>", "<cmd>nohlsearch<CR>", { desc = "Reset search highlight" })
+
+-- Window related binds
+map("n", "<C-w>d", "<C-w>c", { desc = "[D]elete [W]indow" })
+
+-- Buffer related binds
+map("n", "<leader>bd", "<cmd>bdelete<CR>", { desc = "[D]elete [B]uffer" })
+
+-- Tab related binds
+map("n", "[T", "<cmd>tabprev<CR>", { desc = "Previous Tab" })
+map("n", "]T", "<cmd>tabnext<CR>", { desc = "Previous Tab" })
+map("n", "<leader><tab>d", "<cmd>tabclose<CR>", { desc = "[D]elete [T]ab" })
+map("n", "<leader><tab>n", "<cmd>tabnew<CR>", { desc = "[N]ew [T]ab" })
diff --git a/lua/config/plugins/completion.lua b/lua/config/plugins/completion.lua
index 7a02809..7acef49 100644
--- a/lua/config/plugins/completion.lua
+++ b/lua/config/plugins/completion.lua
@@ -1,5 +1,32 @@
return {
{
+ "lazydev.nvim",
+ -- NOTE: if lazyloaded, blink will break as `lze` doesn't packadd this package...
+ -- ft = "lua",
+ after = function(_)
+ -- NOTE: this is required to fix strange filtering in `lazydev.nvim`
+ --- @diagnostic disable-next-line: duplicate-set-field
+ require("lazydev.lsp").supports = function(client)
+ local client_names = {
+ -- Default client names from `lazydev.nvim`
+ "lua_ls",
+ "emmylua-analyzer-rust",
+ -- NOTE: I have `lua-language-server` name which was not in list
+ "lua-language-server",
+ }
+
+ return client and vim.tbl_contains(client_names, client.name)
+ end
+
+ require("lazydev").setup({
+ library = {
+ { path = "${3rd}/luv/library", words = { "vim%.uv" } },
+ { path = "snacks.nvim", words = { "Snacks" } },
+ },
+ })
+ end,
+ },
+ {
"blink.cmp",
event = "DeferredUIEnter",
after = function(_)
@@ -10,6 +37,13 @@ return {
},
completion = {
+ list = {
+ selection = {
+ auto_insert = false,
+ preselect = false,
+ },
+ },
+
documentation = {
auto_show = true,
auto_show_delay_ms = 500,
@@ -18,7 +52,24 @@ return {
ghost_text = { enabled = true },
},
- sources = { default = { "lsp", "path", "snippets", "buffer" } },
+ snippets = { preset = "luasnip" },
+
+ cmdline = {
+ completion = {
+ ghost_text = { enabled = false },
+ },
+ },
+
+ sources = {
+ default = { "lazydev", "lsp", "path", "snippets", "buffer" },
+ providers = {
+ lazydev = {
+ name = "LazyDev",
+ module = "lazydev.integrations.blink",
+ score_offset = 100,
+ },
+ },
+ },
fuzzy = {
sorts = { "exact", "score", "sort_text" },
diff --git a/lua/config/plugins/debug.lua b/lua/config/plugins/debug.lua
new file mode 100644
index 0000000..0f6378b
--- /dev/null
+++ b/lua/config/plugins/debug.lua
@@ -0,0 +1,23 @@
+return {
+ {
+ "nvim-dap",
+ event = "DeferredUIEnter",
+ load = function(name)
+ vim.cmd.packadd(name)
+ vim.cmd.packadd("nvim-dap-ui")
+ vim.cmd.packadd("nvim-dap-virtual-text")
+ end,
+ after = function(_)
+ -- require("dap").setup()
+ require("dapui").setup()
+ require("nvim-dap-virtual-text").setup({})
+
+ local dap = require("dap")
+ dap.adapters.lldb = {
+ type = "executable",
+ command = "lldb-dap",
+ name = "lldb",
+ }
+ end,
+ },
+}
diff --git a/lua/config/plugins/extra.lua b/lua/config/plugins/extra.lua
index aba060b..19a7042 100644
--- a/lua/config/plugins/extra.lua
+++ b/lua/config/plugins/extra.lua
@@ -1,11 +1,95 @@
return {
{
+ "multicursor-nvim",
+ event = "DeferredUIEnter",
+ after = function(_)
+ local mc = require("multicursor-nvim")
+ mc.setup({
+ signs = false,
+ })
+
+ -- Keybindings would be a lot better as <localleader>
+ local map = vim.keymap.set
+
+ -- stylua: ignore start
+ map({ "n", "x" }, "<localleader><localleader>", function() mc.clearCursors() end)
+ map({ "n", "x" }, "<localleader>R", function() mc.restoreCursors() end)
+
+ map({ "n", "x" }, "<localleader>j", function() mc.lineAddCursor(1) end)
+ map({ "n", "x" }, "<localleader>k", function() mc.lineAddCursor(-1) end)
+ map({ "n", "x" }, "<localleader>J", function() mc.lineSkipCursor(1) end)
+ map({ "n", "x" }, "<localleader>K", function() mc.lineSkipCursor(-1) end)
+
+ map({ "n", "x" }, "<localleader>cn", function() mc.matchAddCursor(1) end)
+ map({ "n", "x" }, "<localleader>cN", function() mc.matchAddCursor(-1) end)
+ map({ "n", "x" }, "<localleader>cs", function() mc.matchSkipCursor(1) end)
+ map({ "n", "x" }, "<localleader>cS", function() mc.matchSkipCursor(-1) end)
+ map({ "n", "x" }, "<localleader>cM", mc.matchAllAddCursors)
+ map("x", "<localleader>m", mc.matchCursors)
+ map("x", "<localleader>s", mc.splitCursors)
+
+ -- map("n", "<localleader>g", mc.addCursorOperator)
+ map({ "n", "x" }, "<localleader>g", mc.operator)
+ -- stylua: ignore end
+
+ -- Customize how cursors look.
+ local hl = vim.api.nvim_set_hl
+ hl(0, "MultiCursorCursor", { reverse = true })
+ hl(0, "MultiCursorVisual", { link = "Visual" })
+ hl(0, "MultiCursorSign", { link = "SignColumn" })
+ hl(0, "MultiCursorMatchPreview", { link = "Search" })
+ hl(0, "MultiCursorDisabledCursor", { reverse = true })
+ hl(0, "MultiCursorDisabledVisual", { link = "Visual" })
+ hl(0, "MultiCursorDisabledSign", { link = "SignColumn" })
+ end,
+ },
+ {
+ "yanky.nvim",
+ event = "DeferredUIEnter",
+ after = function(_)
+ require("yanky").setup({
+ highlight = { timer = 150 },
+ system_clipboard = {
+ sync_with_ring = true,
+ },
+ })
+ end,
+ keys = {
+ { "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" },
+ { "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Text After Cursor" },
+ { "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Text Before Cursor" },
+ { "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Text After Selection" },
+ { "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Text Before Selection" },
+ { "[y", "<Plug>(YankyCycleForward)", desc = "Cycle Forward Through Yank History" },
+ { "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" },
+ { "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
+ { "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
+ { "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
+ { "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
+ { ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" },
+ { "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" },
+ { ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" },
+ { "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" },
+ { "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put After Applying a Filter" },
+ { "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" },
+ },
+ },
+ {
"which-key.nvim",
event = "DeferredUIEnter",
after = function(_)
require("which-key").setup()
require("which-key").add({
+ {
+ "<leader>w",
+ group = "windows",
+ proxy = "<C-w>",
+ expand = function()
+ return require("which-key.extras").expand.win()
+ end,
+ },
+
{ "<leader>s", group = "search" },
{
@@ -14,7 +98,61 @@ return {
{ "<leader>gh", group = "hunk" },
{ "<leader>S", group = "surround" },
},
+
+ { "<leader>x", group = "extra" },
+ { "<leader>xS", group = "supercollider" },
+ })
+ end,
+ },
+ {
+ "oil.nvim",
+ -- NOTE: lazy loading is not recommended
+ event = "DeferredUIEnter",
+ after = function(_)
+ require("oil").setup()
+ end,
+ keys = {
+ { "-", "<CMD>Oil<CR>", { desc = "Open parent directory" } },
+ },
+ },
+ {
+ "scnvim",
+ -- NOTE: this plugin is broken when try to lazyload
+ lazy = false,
+ after = function(_)
+ local scnvim = require("scnvim")
+ local map = scnvim.map
+ local map_expr = scnvim.map_expr
+
+ scnvim.setup({
+ ensure_installed = true,
+ keymaps = {
+ ["<M-CR>"] = {
+ map("editor.send_block", { "i", "n" }),
+ map("editor.send_selection", "x"),
+ },
+ ["<C-CR>"] = map("editor.send_line", { "i", "n" }),
+ ["<C-k>"] = map("signature.show", { "i", "n" }),
+
+ ["<F12>"] = map("sclang.hard_stop", { "i", "n", "x" }),
+ },
+ })
+
+ vim.api.nvim_create_augroup("my.scnvim", { clear = true })
+ vim.api.nvim_create_autocmd("InsertEnter", {
+ pattern = "*.scd",
+ group = "my.scnvim",
+ once = true,
+ callback = function()
+ -- Loading snippets to LuaSnip
+ require("luasnip").add_snippets("supercollider", require("scnvim/utils").get_snippets())
+ end,
})
end,
+ keys = {
+ { "<leader>xSs", "<CMD>SCNvimStart<CR>", desc = "Start SuperCollider" },
+ { "<leader>xSS", "<CMD>SCNvimStop<CR>", desc = "Stop SuperCollider" },
+ { "<leader>xSr", "<CMD>SCNvimRecompile<CR>", desc = "Recompile SuperCollider sclang" },
+ },
},
}
diff --git a/lua/config/plugins/formatting.lua b/lua/config/plugins/formatting.lua
index 9563905..98bbe06 100644
--- a/lua/config/plugins/formatting.lua
+++ b/lua/config/plugins/formatting.lua
@@ -10,6 +10,17 @@ return {
lua = { "stylua" },
nix = { "nixfmt" },
rust = { "rustfmt", lsp_format = "fallback" },
+
+ html = { "prettierd" },
+ htmlangular = { "prettierd" },
+ json = { "biome" },
+ jsonc = { "biome" },
+ javascript = { "biome" },
+ javascriptreact = { "biome" },
+ ["javascript.jsx"] = { "biome" },
+ typescript = { "biome" },
+ typescriptreact = { "biome" },
+ ["typescript.jsx"] = { "biome" },
},
})
diff --git a/lua/config/plugins/fuzzy.lua b/lua/config/plugins/fuzzy.lua
index fb3cd60..95bb108 100644
--- a/lua/config/plugins/fuzzy.lua
+++ b/lua/config/plugins/fuzzy.lua
@@ -14,87 +14,35 @@ return {
"fzf-lua",
event = "DeferredUIEnter",
after = function(_)
- require("fzf-lua").setup()
+ require("fzf-lua").setup({
+ keymap = {
+ fzf = {
+ ["tab"] = "down",
+ ["shift-tab"] = "up",
+ ["ctrl-q"] = "select-all+accept",
+ },
+ },
+ })
end,
keys = {
-- General
- {
- "<leader><leader>",
- function()
- require("fzf-lua").files()
- end,
- mode = { "n" },
- desc = "Search Files",
- },
- {
- "<leader><localleader>",
- function()
- require("fzf-lua").buffers()
- end,
- mode = { "n" },
- desc = "Search Buffers",
- },
- {
- "<leader>/",
- function()
- require("fzf-lua").live_grep()
- end,
- mode = { "n" },
- desc = "Search Grep",
- },
- {
- "<leader>:",
- function()
- require("fzf-lua").command_history()
- end,
- mode = { "n" },
- desc = "Command History",
- },
+ -- stylua: ignore start
+ { "<leader><leader>", function() require("fzf-lua").files() end, mode = { "n" }, desc = "Search Files", },
+ { "<leader><localleader>", function() require("fzf-lua").buffers() end, mode = { "n" }, desc = "Search Buffers", },
+ { "<leader>/", function() require("fzf-lua").live_grep() end, mode = { "n" }, desc = "Search Grep", },
+ { "<leader>:", function() require("fzf-lua").command_history() end, mode = { "n" }, desc = "Command History", },
-- Search
- {
- "<leader>sR",
- function()
- require("fzf-lua").resume()
- end,
- mode = { "n" },
- desc = "[R]esume [S]earch",
- },
- {
- "<leader>sb",
- function()
- require("fzf-lua").buffers()
- end,
- mode = { "n" },
- desc = "[S]earch [B]uffers",
- },
- {
- "<leader>sf",
- function()
- require("fzf-lua").files()
- end,
- mode = { "n" },
- desc = "[S]earch [F]iles",
- },
- {
- "<leader>sg",
- function()
- require("fzf-lua").live_grep()
- end,
- mode = { "n" },
- desc = "[S]earch [G]rep",
- },
+ { "<leader>sR", function() require("fzf-lua").resume() end, mode = { "n" }, desc = "[R]esume [S]earch", },
+ { "<leader>sb", function() require("fzf-lua").buffers() end, mode = { "n" }, desc = "[S]earch [B]uffers", },
+ { "<leader>sf", function() require("fzf-lua").files() end, mode = { "n" }, desc = "[S]earch [F]iles", },
+ { "<leader>sg", function() require("fzf-lua").live_grep() end, mode = { "n" }, desc = "[S]earch [G]rep", },
+ { "<leader>sh", function() require("fzf-lua").helptags() end, mode = { "n" }, desc = "[S]earch [G]rep", },
-- Code
- {
- "<leader>ca",
- function()
- require("fzf-lua").lsp_code_actions()
- end,
- mode = { "n" },
- desc = "[C]ode [A]ctions",
- },
+ { "<leader>ca", function() require("fzf-lua").lsp_code_actions() end, mode = { "n" }, desc = "[C]ode [A]ctions", },
+ -- stylua: ignore end
},
},
}
diff --git a/lua/config/plugins/init.lua b/lua/config/plugins/init.lua
index 1ec4b50..3c372a0 100644
--- a/lua/config/plugins/init.lua
+++ b/lua/config/plugins/init.lua
@@ -54,7 +54,9 @@ require("lze").load({
{ import = "config.plugins.treesitter" },
{ import = "config.plugins.mini" },
{ import = "config.plugins.completion" },
+ { import = "config.plugins.snippets" },
{ import = "config.plugins.formatting" },
{ import = "config.plugins.git" },
+ { import = "config.plugins.debug" },
{ import = "config.plugins.extra" },
})
diff --git a/lua/config/plugins/snippets.lua b/lua/config/plugins/snippets.lua
new file mode 100644
index 0000000..5a37b0c
--- /dev/null
+++ b/lua/config/plugins/snippets.lua
@@ -0,0 +1,13 @@
+return {
+ {
+ "luasnip",
+ dep_of = { "blink.cmp" },
+ load = function(name)
+ vim.cmd.packadd(name)
+ vim.cmd.packadd("friendly-snippets")
+ end,
+ after = function(_)
+ require("luasnip.loaders.from_vscode").lazy_load()
+ end,
+ },
+}
diff --git a/lua/config/plugins/treesitter.lua b/lua/config/plugins/treesitter.lua
index 931a474..63bf48d 100644
--- a/lua/config/plugins/treesitter.lua
+++ b/lua/config/plugins/treesitter.lua
@@ -2,6 +2,7 @@ return {
{
"nvim-treesitter",
event = "DeferredUIEnter",
+ dep_of = { "nvim-ts-autotag" },
load = function(name)
vim.cmd.packadd(name)
vim.cmd.packadd("nvim-treesitter-textobjects")
@@ -13,4 +14,11 @@ return {
})
end,
},
+ {
+ "nvim-ts-autotag",
+ event = { "BufReadPre", "BufNewFile" },
+ after = function(_)
+ require("nvim-ts-autotag").setup()
+ end,
+ },
}
diff --git a/lua/config/plugins/ui.lua b/lua/config/plugins/ui.lua
index 19da163..593efc7 100644
--- a/lua/config/plugins/ui.lua
+++ b/lua/config/plugins/ui.lua
@@ -4,7 +4,45 @@ return {
event = "DeferredUIEnter",
after = function(_)
require("bufferline").setup({
- highlights = require("catppuccin.groups.integrations.bufferline").get(),
+ highlights = require("catppuccin.special.bufferline").get_theme(),
+ })
+ end,
+ },
+
+ {
+ "lualine.nvim",
+ event = "DeferredUIEnter",
+ after = function(_)
+ require("lualine").setup({
+ options = {
+ theme = "catppuccin",
+ },
+
+ sections = {
+ lualine_a = { "mode" },
+ lualine_b = { "branch", "diff", "diagnostics" },
+ lualine_c = { "filename" },
+
+ lualine_x = {
+ -- SuperCollider status bar (server status)
+ {
+ function()
+ -- NOTE: for some reason LuaLS doesn't find `gsub` in string o.O
+ ---@diagnostic disable-next-line
+ return require("scnvim.statusline").get_server_status():gsub("%%", "%%%%")
+ end,
+ cond = function()
+ return vim.bo.filetype == "supercollider"
+ end,
+ },
+
+ "filetype",
+ "encoding",
+ "fileformat",
+ },
+ lualine_y = { "progress" },
+ lualine_z = { "location" },
+ },
})
end,
},