Merge branch 'feat/nvim-v0.12'
This commit is contained in:
commit
74d6ef6bac
51 changed files with 1629 additions and 1627 deletions
|
|
@ -1,18 +1,9 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("juancwu.config").setup({})
|
||||
require("plugins")
|
||||
require("colorscheme")
|
||||
require("options")
|
||||
require("clipboard")
|
||||
require("keymaps")
|
||||
require("cmds")
|
||||
require("autocmds")
|
||||
require("lsp")
|
||||
require("treesitter")
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
||||
"catppuccin": { "branch": "main", "commit": "f19cab18ec4dc86d415512c7a572863b2adbcc18" },
|
||||
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "debe91547d7fb1eef34ce26a5106f277fbfdd109" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "258d2a5ef4a3e3d6d9ba9da72c9725c53e9afcbd" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
|
||||
"luvit-meta": { "branch": "main", "commit": "0ea4ff636c5bb559ffa78108561d0976f4de9682" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a1067cf84b4ff81b66d2bf4d01f4cbdb5de40bd0" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
|
||||
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
|
||||
"mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "e9fa0714fc753e1e737940577904e553ee340903" },
|
||||
"mini.nvim": { "branch": "main", "commit": "256d35c9e24c9cf5f5da568e121e988c6ceb1e3f" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
"nvim-lint": { "branch": "master", "commit": "0864f81c681e15d9bdc1156fe3a17bd07db5a3ed" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "b3cce1419ca67871ae782b3e529652f8a016f0de" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "6141a40173c6efa98242dc951ed4b6f892c97027" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" },
|
||||
"oil.nvim": { "branch": "master", "commit": "07f80ad645895af849a597d1cac897059d89b686" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "de495fabe171d48aed5525f002d14414efcecbb2" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "9ab9dade85d8c7d411cc89b592028da3d1b7955a" },
|
||||
"rose-pine": { "branch": "main", "commit": "72a04c4065345b51b56aed4859ea1d884f734097" },
|
||||
"solarized-osaka.nvim": { "branch": "main", "commit": "f796014c14b1910e08d42cc2077fef34f08e0295" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "14fd5ff7f84027064724ec3157fe903199e77ded" },
|
||||
"undotree": { "branch": "master", "commit": "fe9a9d0645f0f5532360b5e5f5c550d7bb4f1869" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" }
|
||||
}
|
||||
29
nvim/lsp/bashls.lua
Normal file
29
nvim/lsp/bashls.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
---@brief
|
||||
---
|
||||
--- https://github.com/bash-lsp/bash-language-server
|
||||
---
|
||||
--- `bash-language-server` can be installed via `npm`:
|
||||
--- ```sh
|
||||
--- npm i -g bash-language-server
|
||||
--- ```
|
||||
---
|
||||
--- Language server for bash, written using tree sitter in typescript.
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { "bash-language-server", "start" },
|
||||
settings = {
|
||||
bashIde = {
|
||||
-- Glob pattern for finding and parsing shell script files in the workspace.
|
||||
-- Used by the background analysis features across files.
|
||||
|
||||
-- Prevent recursive scanning which will cause issues when opening a file
|
||||
-- directly in the home directory (e.g. ~/foo.sh).
|
||||
--
|
||||
-- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)".
|
||||
globPattern = vim.env.GLOB_PATTERN or "*@(.sh|.inc|.bash|.command)",
|
||||
},
|
||||
},
|
||||
filetypes = { "bash", "sh" },
|
||||
root_markers = { ".git" },
|
||||
}
|
||||
51
nvim/lsp/css_variables.lua
Normal file
51
nvim/lsp/css_variables.lua
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
---@brief
|
||||
---
|
||||
--- https://github.com/vunguyentuan/vscode-css-variables/tree/master/packages/css-variables-language-server
|
||||
---
|
||||
--- CSS variables autocompletion and go-to-definition
|
||||
---
|
||||
--- `css-variables-language-server` can be installed via `npm`:
|
||||
---
|
||||
--- ```sh
|
||||
--- npm i -g css-variables-language-server
|
||||
--- ```
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { "css-variables-language-server", "--stdio" },
|
||||
filetypes = { "css", "scss", "less" },
|
||||
|
||||
-- Taken from lsp/ts_ls.lua to handle simple projects and monorepos.
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local root_markers = { "package-lock.json", "yarn.lock", "pnpm-lock.yaml", "bun.lockb", "bun.lock" }
|
||||
-- Give the root markers equal priority by wrapping them in a table
|
||||
root_markers = vim.fn.has("nvim-0.11.3") == 1 and { root_markers, { ".git" } }
|
||||
or vim.list_extend(root_markers, { ".git" })
|
||||
-- We fallback to the current working directory if no project root is found
|
||||
local project_root = vim.fs.root(bufnr, root_markers) or vim.fn.getcwd()
|
||||
|
||||
on_dir(project_root)
|
||||
end,
|
||||
|
||||
-- Same as inlined defaults that don't seem to work without hardcoding them in the lua config
|
||||
-- https://github.com/vunguyentuan/vscode-css-variables/blob/763a564df763f17aceb5f3d6070e0b444a2f47ff/packages/css-variables-language-server/src/CSSVariableManager.ts#L31-L50
|
||||
settings = {
|
||||
cssVariables = {
|
||||
lookupFiles = { "**/*.less", "**/*.scss", "**/*.sass", "**/*.css" },
|
||||
blacklistFolders = {
|
||||
"**/.cache",
|
||||
"**/.DS_Store",
|
||||
"**/.git",
|
||||
"**/.hg",
|
||||
"**/.next",
|
||||
"**/.svn",
|
||||
"**/bower_components",
|
||||
"**/CVS",
|
||||
"**/dist",
|
||||
"**/node_modules",
|
||||
"**/tests",
|
||||
"**/tmp",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
15
nvim/lsp/cssls.lua
Normal file
15
nvim/lsp/cssls.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { "vscode-css-language-server", "--stdio" },
|
||||
filetypes = { "css", "scss", "less" },
|
||||
root_markers = { "package.json", ".git" },
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
css = { validate = true },
|
||||
scss = { validate = true },
|
||||
less = { validate = true },
|
||||
},
|
||||
}
|
||||
99
nvim/lsp/gopls.lua
Normal file
99
nvim/lsp/gopls.lua
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
---@brief
|
||||
---
|
||||
--- https://github.com/golang/tools/tree/master/gopls
|
||||
---
|
||||
--- Google's lsp server for golang.
|
||||
|
||||
--- @class go_dir_custom_args
|
||||
---
|
||||
--- @field envvar_id string
|
||||
---
|
||||
--- @field custom_subdir string?
|
||||
|
||||
local mod_cache = nil
|
||||
local std_lib = nil
|
||||
|
||||
---@param custom_args go_dir_custom_args
|
||||
---@param on_complete fun(dir: string | nil)
|
||||
local function identify_go_dir(custom_args, on_complete)
|
||||
local cmd = { "go", "env", custom_args.envvar_id }
|
||||
vim.system(cmd, { text = true }, function(output)
|
||||
local res = vim.trim(output.stdout or "")
|
||||
if output.code == 0 and res ~= "" then
|
||||
if custom_args.custom_subdir and custom_args.custom_subdir ~= "" then
|
||||
res = res .. custom_args.custom_subdir
|
||||
end
|
||||
on_complete(res)
|
||||
else
|
||||
vim.schedule(function()
|
||||
vim.notify(
|
||||
("[gopls] identify " .. custom_args.envvar_id .. " dir cmd failed with code %d: %s\n%s"):format(
|
||||
output.code,
|
||||
vim.inspect(cmd),
|
||||
output.stderr
|
||||
)
|
||||
)
|
||||
end)
|
||||
on_complete(nil)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
---@return string?
|
||||
local function get_std_lib_dir()
|
||||
if std_lib and std_lib ~= "" then
|
||||
return std_lib
|
||||
end
|
||||
|
||||
identify_go_dir({ envvar_id = "GOROOT", custom_subdir = "/src" }, function(dir)
|
||||
if dir then
|
||||
std_lib = dir
|
||||
end
|
||||
end)
|
||||
return std_lib
|
||||
end
|
||||
|
||||
---@return string?
|
||||
local function get_mod_cache_dir()
|
||||
if mod_cache and mod_cache ~= "" then
|
||||
return mod_cache
|
||||
end
|
||||
|
||||
identify_go_dir({ envvar_id = "GOMODCACHE" }, function(dir)
|
||||
if dir then
|
||||
mod_cache = dir
|
||||
end
|
||||
end)
|
||||
return mod_cache
|
||||
end
|
||||
|
||||
---@param fname string
|
||||
---@return string?
|
||||
local function get_root_dir(fname)
|
||||
if mod_cache and fname:sub(1, #mod_cache) == mod_cache then
|
||||
local clients = vim.lsp.get_clients({ name = "gopls" })
|
||||
if #clients > 0 then
|
||||
return clients[#clients].config.root_dir
|
||||
end
|
||||
end
|
||||
if std_lib and fname:sub(1, #std_lib) == std_lib then
|
||||
local clients = vim.lsp.get_clients({ name = "gopls" })
|
||||
if #clients > 0 then
|
||||
return clients[#clients].config.root_dir
|
||||
end
|
||||
end
|
||||
return vim.fs.root(fname, "go.work") or vim.fs.root(fname, "go.mod") or vim.fs.root(fname, ".git")
|
||||
end
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { "gopls" },
|
||||
filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
get_mod_cache_dir()
|
||||
get_std_lib_dir()
|
||||
-- see: https://github.com/neovim/nvim-lspconfig/issues/804
|
||||
on_dir(get_root_dir(fname))
|
||||
end,
|
||||
}
|
||||
16
nvim/lsp/html.lua
Normal file
16
nvim/lsp/html.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { "vscode-html-language-server", "--stdio" },
|
||||
filetypes = { "html", "templ" },
|
||||
root_markers = { "package.json", ".git" },
|
||||
capabilities = capabilities,
|
||||
init_options = {
|
||||
provideFormatter = true,
|
||||
embeddedLanguages = { css = true, javascript = true },
|
||||
configurationSection = { "html", "css", "javascript" },
|
||||
},
|
||||
settings = {},
|
||||
}
|
||||
33
nvim/lsp/lua_ls.lua
Normal file
33
nvim/lsp/lua_ls.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { "lua-language-server" },
|
||||
filetypes = { "lua" },
|
||||
root_markers = {
|
||||
".luarc.json",
|
||||
".luarc.jsonc",
|
||||
".luacheckrc",
|
||||
".stylua.toml",
|
||||
"stylua.toml",
|
||||
"selene.toml",
|
||||
"selene.yml",
|
||||
".git",
|
||||
},
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "Lua 5.4",
|
||||
},
|
||||
completion = {
|
||||
enable = true,
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = { vim.env.VIMRUNTIME },
|
||||
checkThirdParty = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
195
nvim/lsp/rust-analyzer.lua
Normal file
195
nvim/lsp/rust-analyzer.lua
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
---@brief
|
||||
---
|
||||
--- https://github.com/rust-lang/rust-analyzer
|
||||
---
|
||||
--- rust-analyzer (aka rls 2.0), a language server for Rust
|
||||
---
|
||||
---
|
||||
--- See [docs](https://rust-analyzer.github.io/book/configuration.html) for extra settings. The settings can be used like this:
|
||||
--- ```lua
|
||||
--- vim.lsp.config('rust_analyzer', {
|
||||
--- settings = {
|
||||
--- ['rust-analyzer'] = {
|
||||
--- diagnostics = {
|
||||
--- enable = false;
|
||||
--- }
|
||||
--- }
|
||||
--- }
|
||||
--- })
|
||||
--- ```
|
||||
---
|
||||
--- Note: do not set `init_options` for this LS config, it will be automatically populated by the contents of settings["rust-analyzer"] per
|
||||
--- https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26.
|
||||
|
||||
local function reload_workspace(bufnr)
|
||||
local clients = vim.lsp.get_clients({ bufnr = bufnr, name = "rust_analyzer" })
|
||||
for _, client in ipairs(clients) do
|
||||
vim.notify("Reloading Cargo Workspace")
|
||||
---@diagnostic disable-next-line:param-type-mismatch
|
||||
client:request("rust-analyzer/reloadWorkspace", nil, function(err)
|
||||
if err then
|
||||
error(tostring(err))
|
||||
end
|
||||
vim.notify("Cargo workspace reloaded")
|
||||
end, 0)
|
||||
end
|
||||
end
|
||||
|
||||
local function user_sysroot_src()
|
||||
return vim.tbl_get(vim.lsp.config["rust_analyzer"], "settings", "rust-analyzer", "cargo", "sysrootSrc")
|
||||
end
|
||||
|
||||
local function default_sysroot_src()
|
||||
local sysroot = vim.tbl_get(vim.lsp.config["rust_analyzer"], "settings", "rust-analyzer", "cargo", "sysroot")
|
||||
if not sysroot then
|
||||
local rustc = os.getenv("RUSTC") or "rustc"
|
||||
local result = vim.system({ rustc, "--print", "sysroot" }, { text = true }):wait()
|
||||
|
||||
local stdout = result.stdout
|
||||
if result.code == 0 and stdout then
|
||||
if string.sub(stdout, #stdout) == "\n" then
|
||||
if #stdout > 1 then
|
||||
sysroot = string.sub(stdout, 1, #stdout - 1)
|
||||
else
|
||||
sysroot = ""
|
||||
end
|
||||
else
|
||||
sysroot = stdout
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return sysroot and vim.fs.joinpath(sysroot, "lib/rustlib/src/rust/library") or nil
|
||||
end
|
||||
|
||||
local function is_library(fname)
|
||||
local user_home = vim.fs.normalize(vim.env.HOME)
|
||||
local cargo_home = os.getenv("CARGO_HOME") or user_home .. "/.cargo"
|
||||
local registry = cargo_home .. "/registry/src"
|
||||
local git_registry = cargo_home .. "/git/checkouts"
|
||||
|
||||
local rustup_home = os.getenv("RUSTUP_HOME") or user_home .. "/.rustup"
|
||||
local toolchains = rustup_home .. "/toolchains"
|
||||
|
||||
local sysroot_src = user_sysroot_src() or default_sysroot_src()
|
||||
|
||||
for _, item in ipairs({ toolchains, registry, git_registry, sysroot_src }) do
|
||||
if item and vim.fs.relpath(item, fname) then
|
||||
local clients = vim.lsp.get_clients({ name = "rust_analyzer" })
|
||||
return #clients > 0 and clients[#clients].config.root_dir or nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { "rust-analyzer" },
|
||||
filetypes = { "rust" },
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
local reused_dir = is_library(fname)
|
||||
if reused_dir then
|
||||
on_dir(reused_dir)
|
||||
return
|
||||
end
|
||||
|
||||
local cargo_crate_dir = vim.fs.root(fname, { "Cargo.toml" })
|
||||
local cargo_workspace_root
|
||||
|
||||
if cargo_crate_dir == nil then
|
||||
on_dir(
|
||||
vim.fs.root(fname, { "rust-project.json" })
|
||||
or vim.fs.dirname(vim.fs.find(".git", { path = fname, upward = true })[1])
|
||||
)
|
||||
return
|
||||
end
|
||||
|
||||
local cmd = {
|
||||
"cargo",
|
||||
"metadata",
|
||||
"--no-deps",
|
||||
"--format-version",
|
||||
"1",
|
||||
"--manifest-path",
|
||||
cargo_crate_dir .. "/Cargo.toml",
|
||||
}
|
||||
|
||||
vim.system(cmd, { text = true }, function(output)
|
||||
if output.code == 0 then
|
||||
if output.stdout then
|
||||
local result = vim.json.decode(output.stdout)
|
||||
if result["workspace_root"] then
|
||||
cargo_workspace_root = vim.fs.normalize(result["workspace_root"])
|
||||
end
|
||||
end
|
||||
|
||||
on_dir(cargo_workspace_root or cargo_crate_dir)
|
||||
else
|
||||
vim.schedule(function()
|
||||
vim.notify(
|
||||
("[rust_analyzer] cmd failed with code %d: %s\n%s"):format(output.code, cmd, output.stderr)
|
||||
)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
capabilities = {
|
||||
experimental = {
|
||||
serverStatusNotification = true,
|
||||
commands = {
|
||||
commands = {
|
||||
"rust-analyzer.showReferences",
|
||||
"rust-analyzer.runSingle",
|
||||
"rust-analyzer.debugSingle",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
---@type lspconfig.settings.rust_analyzer
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
lens = {
|
||||
debug = { enable = true },
|
||||
enable = true,
|
||||
implementations = { enable = true },
|
||||
references = {
|
||||
adt = { enable = true },
|
||||
enumVariant = { enable = true },
|
||||
method = { enable = true },
|
||||
trait = { enable = true },
|
||||
},
|
||||
run = { enable = true },
|
||||
updateTest = { enable = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
before_init = function(init_params, config)
|
||||
-- See https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26
|
||||
if config.settings and config.settings["rust-analyzer"] then
|
||||
init_params.initializationOptions = config.settings["rust-analyzer"]
|
||||
end
|
||||
---@param command table{ title: string, command: string, arguments: any[] }
|
||||
vim.lsp.commands["rust-analyzer.runSingle"] = function(command)
|
||||
local r = command.arguments[1]
|
||||
local cmd = { "cargo", unpack(r.args.cargoArgs) }
|
||||
if r.args.executableArgs and #r.args.executableArgs > 0 then
|
||||
vim.list_extend(cmd, { "--", unpack(r.args.executableArgs) })
|
||||
end
|
||||
|
||||
local proc = vim.system(cmd, { cwd = r.args.cwd, env = r.args.environment })
|
||||
|
||||
local result = proc:wait()
|
||||
|
||||
if result.code == 0 then
|
||||
vim.notify(result.stdout, vim.log.levels.INFO)
|
||||
else
|
||||
vim.notify(result.stderr, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
end,
|
||||
on_attach = function(_, bufnr)
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "LspCargoReload", function()
|
||||
reload_workspace(bufnr)
|
||||
end, { desc = "Reload current cargo workspace" })
|
||||
end,
|
||||
}
|
||||
36
nvim/lsp/tailwindcss.lua
Normal file
36
nvim/lsp/tailwindcss.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { "tailwindcss-language-server", "--stdio" },
|
||||
filetypes = { "html", "css", "scss", "javascriptreact", "typescriptreact", "templ" },
|
||||
root_markers = {
|
||||
"tailwind.config.js",
|
||||
"tailwind.config.cjs",
|
||||
"tailwind.config.mjs",
|
||||
"tailwind.config.ts",
|
||||
"postcss.config.js",
|
||||
"package.json",
|
||||
".git",
|
||||
},
|
||||
init_options = {
|
||||
userLanguages = {
|
||||
templ = "html",
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
tailwindCSS = {
|
||||
validate = true,
|
||||
lint = {
|
||||
cssConflict = "warning",
|
||||
invalidApply = "error",
|
||||
invalidConfigPath = "error",
|
||||
invalidScreen = "error",
|
||||
invalidTailwindDirective = "error",
|
||||
invalidVariant = "error",
|
||||
recommendedVariantOrder = "warning",
|
||||
},
|
||||
includeLanguages = {
|
||||
templ = "html",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
6
nvim/lsp/templ.lua
Normal file
6
nvim/lsp/templ.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { "templ", "lsp" },
|
||||
filetypes = { "templ" },
|
||||
root_markers = { "go.mod", "go.work", ".git" },
|
||||
}
|
||||
199
nvim/lsp/ts_ls.lua
Normal file
199
nvim/lsp/ts_ls.lua
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
---@brief
|
||||
---
|
||||
--- https://github.com/typescript-language-server/typescript-language-server
|
||||
---
|
||||
--- `ts_ls`, aka `typescript-language-server`, is a Language Server Protocol implementation for TypeScript wrapping `tsserver`. Note that `ts_ls` is not `tsserver`.
|
||||
---
|
||||
--- `typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`:
|
||||
--- ```sh
|
||||
--- npm install -g typescript typescript-language-server
|
||||
--- ```
|
||||
---
|
||||
--- To configure typescript language server, add a
|
||||
--- [`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or
|
||||
--- [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your
|
||||
--- project.
|
||||
---
|
||||
--- Here's an example that disables type checking in JavaScript files.
|
||||
---
|
||||
--- ```json
|
||||
--- {
|
||||
--- "compilerOptions": {
|
||||
--- "module": "commonjs",
|
||||
--- "target": "es6",
|
||||
--- "checkJs": false
|
||||
--- },
|
||||
--- "exclude": [
|
||||
--- "node_modules"
|
||||
--- ]
|
||||
--- }
|
||||
--- ```
|
||||
---
|
||||
--- Use the `:LspTypescriptSourceAction` command to see "whole file" ("source") code-actions such as:
|
||||
--- - organize imports
|
||||
--- - remove unused code
|
||||
---
|
||||
--- Use the `:LspTypescriptGoToSourceDefinition` command to navigate to the source definition of a symbol (e.g., jump to the original implementation instead of type definitions).
|
||||
---
|
||||
--- ### Monorepo support
|
||||
---
|
||||
--- `ts_ls` supports monorepos by default. It will automatically find the `tsconfig.json` or `jsconfig.json` corresponding to the package you are working on.
|
||||
--- This works without the need of spawning multiple instances of `ts_ls`, saving memory.
|
||||
---
|
||||
--- It is recommended to use the same version of TypeScript in all packages, and therefore have it available in your workspace root. The location of the TypeScript binary will be determined automatically, but only once.
|
||||
---
|
||||
--- Some care must be taken here to correctly infer whether a file is part of a Deno program, or a TS program that
|
||||
--- expects to run in Node or Web Browsers. This supports having a Deno module using the denols LSP as a part of a
|
||||
--- mostly-not-Deno monorepo. We do this by finding the nearest package manager lock file, and the nearest deno.json
|
||||
--- or deno.jsonc.
|
||||
---
|
||||
--- Example:
|
||||
---
|
||||
--- ```
|
||||
--- project-root
|
||||
--- +-- node_modules/...
|
||||
--- +-- package-lock.json
|
||||
--- +-- package.json
|
||||
--- +-- packages
|
||||
--- +-- deno-module
|
||||
--- | +-- deno.json
|
||||
--- | +-- package.json <-- It's normal for Deno projects to have package.json files!
|
||||
--- | +-- src
|
||||
--- | +-- index.ts <-- this is a Deno file
|
||||
--- +-- node-module
|
||||
--- +-- package.json
|
||||
--- +-- src
|
||||
--- +-- index.ts <-- a non-Deno file (ie, should use ts_ls or tsgols)
|
||||
--- ```
|
||||
---
|
||||
--- From the file being edited, we walk up to find the nearest package manager lockfile. This is PROJECT ROOT.
|
||||
--- From the file being edited, find the nearest deno.json or deno.jsonc. This is DENO ROOT.
|
||||
--- From the file being edited, find the nearest deno.lock. This is DENO LOCK ROOT
|
||||
--- If DENO LOCK ROOT is found, and PROJECT ROOT is missing or shorter, then this is a deno file, and we abort.
|
||||
--- If DENO ROOT is found, and it's longer than or equal to PROJECT ROOT, then this is a Deno file, and we abort.
|
||||
--- Otherwise, attach at PROJECT ROOT, or the cwd if not found.
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
init_options = { hostInfo = "neovim" },
|
||||
cmd = function(dispatchers, config)
|
||||
local cmd = "typescript-language-server"
|
||||
if (config or {}).root_dir then
|
||||
local local_cmd = vim.fs.joinpath(config.root_dir, "node_modules/.bin", cmd)
|
||||
if vim.fn.executable(local_cmd) == 1 then
|
||||
cmd = local_cmd
|
||||
end
|
||||
end
|
||||
return vim.lsp.rpc.start({ cmd, "--stdio" }, dispatchers)
|
||||
end,
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
},
|
||||
root_dir = function(bufnr, on_dir)
|
||||
-- The project root is where the LSP can be started from
|
||||
-- As stated in the documentation above, this LSP supports monorepos and simple projects.
|
||||
-- We select then from the project root, which is identified by the presence of a package
|
||||
-- manager lock file.
|
||||
local root_markers = { "package-lock.json", "yarn.lock", "pnpm-lock.yaml", "bun.lockb", "bun.lock" }
|
||||
-- Give the root markers equal priority by wrapping them in a table
|
||||
root_markers = vim.fn.has("nvim-0.11.3") == 1 and { root_markers, { ".git" } }
|
||||
or vim.list_extend(root_markers, { ".git" })
|
||||
-- exclude deno
|
||||
local deno_root = vim.fs.root(bufnr, { "deno.json", "deno.jsonc" })
|
||||
local deno_lock_root = vim.fs.root(bufnr, { "deno.lock" })
|
||||
local project_root = vim.fs.root(bufnr, root_markers)
|
||||
if deno_lock_root and (not project_root or #deno_lock_root > #project_root) then
|
||||
-- deno lock is closer than package manager lock, abort
|
||||
return
|
||||
end
|
||||
if deno_root and (not project_root or #deno_root >= #project_root) then
|
||||
-- deno config is closer than or equal to package manager lock, abort
|
||||
return
|
||||
end
|
||||
-- project is standard TS, not deno
|
||||
-- We fallback to the current working directory if no project root is found
|
||||
on_dir(project_root or vim.fn.getcwd())
|
||||
end,
|
||||
handlers = {
|
||||
-- handle rename request for certain code actions like extracting functions / types
|
||||
["_typescript.rename"] = function(_, result, ctx)
|
||||
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
|
||||
vim.lsp.util.show_document({
|
||||
uri = result.textDocument.uri,
|
||||
range = {
|
||||
start = result.position,
|
||||
["end"] = result.position,
|
||||
},
|
||||
}, client.offset_encoding)
|
||||
vim.lsp.buf.rename()
|
||||
return vim.NIL
|
||||
end,
|
||||
},
|
||||
commands = {
|
||||
["editor.action.showReferences"] = function(command, ctx)
|
||||
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
|
||||
local file_uri, position, references = unpack(command.arguments)
|
||||
|
||||
local quickfix_items = vim.lsp.util.locations_to_items(references --[[@as any]], client.offset_encoding)
|
||||
vim.fn.setqflist({}, " ", {
|
||||
title = command.title,
|
||||
items = quickfix_items,
|
||||
context = {
|
||||
command = command,
|
||||
bufnr = ctx.bufnr,
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.util.show_document({
|
||||
uri = file_uri --[[@as string]],
|
||||
range = {
|
||||
start = position --[[@as lsp.Position]],
|
||||
["end"] = position --[[@as lsp.Position]],
|
||||
},
|
||||
}, client.offset_encoding)
|
||||
---@diagnostic enable: assign-type-mismatch
|
||||
|
||||
vim.cmd("botright copen")
|
||||
end,
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
|
||||
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "LspTypescriptSourceAction", function()
|
||||
local source_actions = vim.tbl_filter(function(action)
|
||||
return vim.startswith(action, "source.")
|
||||
end, client.server_capabilities.codeActionProvider.codeActionKinds)
|
||||
|
||||
vim.lsp.buf.code_action({
|
||||
context = {
|
||||
only = source_actions,
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end, {})
|
||||
|
||||
-- Go to source definition command
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "LspTypescriptGoToSourceDefinition", function()
|
||||
local win = vim.api.nvim_get_current_win()
|
||||
local params = vim.lsp.util.make_position_params(win, client.offset_encoding)
|
||||
client:exec_cmd({
|
||||
command = "_typescript.goToSourceDefinition",
|
||||
title = "Go to source definition",
|
||||
arguments = { params.textDocument.uri, params.position },
|
||||
}, { bufnr = bufnr }, function(err, result)
|
||||
if err then
|
||||
vim.notify("Go to source definition failed: " .. err.message, vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
if not result or vim.tbl_isempty(result) then
|
||||
vim.notify("No source definition found", vim.log.levels.INFO)
|
||||
return
|
||||
end
|
||||
vim.lsp.util.show_document(result[1], client.offset_encoding, { focus = true })
|
||||
end)
|
||||
end, { desc = "Go to source definition" })
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
{
|
||||
"workspace.library": [
|
||||
"/home/jc/.local/share/nvim/lazy/neodev.nvim/types/stable",
|
||||
"/home/jc/Applications/nvim-linux64/share/nvim/runtime/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/neodev.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/telescope.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/telescope-fzf-native.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/which-key.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/gitsigns.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/lsp-zero.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-dap-ui/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/todo-comments.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-lspconfig/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/lazy.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/mason.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/fzf-lua/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-treesitter-textobjects/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/mason-lspconfig.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/telescope-dap.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-web-devicons/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/telescope-file-browser.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-cmp/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/lualine.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-treesitter/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-ts-autotag/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-ts-context-commentstring/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/git.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-autopairs/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/Comment.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/rose-pine/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/indent-blankline.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/harpoon/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/LuaSnip/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-dap/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/cmp-nvim-lsp/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/plenary.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/null-ls.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/neodev.nvim/types/stable",
|
||||
"/home/jc/Applications/nvim-linux64/share/nvim/runtime/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/neodev.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/telescope.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/telescope-fzf-native.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/which-key.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/gitsigns.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/lsp-zero.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-dap-ui/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/todo-comments.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-lspconfig/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/lazy.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/mason.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/fzf-lua/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-treesitter-textobjects/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/mason-lspconfig.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/telescope-dap.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-web-devicons/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/telescope-file-browser.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-cmp/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/lualine.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-treesitter/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-ts-autotag/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-ts-context-commentstring/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/git.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-autopairs/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/Comment.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/rose-pine/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/indent-blankline.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/harpoon/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/LuaSnip/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/nvim-dap/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/cmp-nvim-lsp/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/plenary.nvim/lua",
|
||||
"/home/jc/.local/share/nvim/lazy/null-ls.nvim/lua",
|
||||
"/home/jc/ghq/juancwu/dotfiles/nvim/lua",
|
||||
"/home/jc/ghq/juancwu/dotfiles/nvim/lua",
|
||||
"${3rd}/luv/library"
|
||||
],
|
||||
"diagnostics.globals": [
|
||||
"vim"
|
||||
]
|
||||
}
|
||||
29
nvim/lua/autocmds.lua
Normal file
29
nvim/lua/autocmds.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
-- highlight on yank
|
||||
local highligh_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highligh_group,
|
||||
pattern = "*",
|
||||
})
|
||||
|
||||
-- disable indent group on some file types
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
local Utils = require("juancwu.utils")
|
||||
local os_utils = require("os_utils")
|
||||
|
||||
if Utils.os.is_linux() then
|
||||
if os_utils.is_linux() then
|
||||
local wayland_display = os.getenv("WAYLAND_DISPLAY")
|
||||
local ssh_tty = os.getenv("SSH_TTY")
|
||||
if Utils.os.is_wsl() then
|
||||
if os_utils.is_wsl() then
|
||||
vim.g.clipboard = {
|
||||
name = "win32yank",
|
||||
copy = {
|
||||
|
|
@ -57,7 +57,7 @@ if Utils.os.is_linux() then
|
|||
cache_enabled = 1,
|
||||
}
|
||||
end
|
||||
elseif Utils.os.is_mac() then
|
||||
elseif os_utils.is_mac() then
|
||||
vim.g.clipboard = {
|
||||
name = "mac-clipboard",
|
||||
copy = {
|
||||
11
nvim/lua/cmds.lua
Normal file
11
nvim/lua/cmds.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
vim.api.nvim_create_user_command("FormatDisable", function()
|
||||
vim.g.disable_autoformat = true
|
||||
end, {
|
||||
desc = "Disable autoformat on save",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("FormatEnable", function()
|
||||
vim.g.disable_autoformat = false
|
||||
end, {
|
||||
desc = "Enable autoformat on save",
|
||||
})
|
||||
75
nvim/lua/colorscheme.lua
Normal file
75
nvim/lua/colorscheme.lua
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
vim.pack.add({ { src = "https://github.com/catppuccin/nvim", name = "catppuccin" } })
|
||||
|
||||
require("catppuccin").setup({
|
||||
flavour = "auto", -- latte, frappe, macchiato, mocha
|
||||
background = { -- :h background
|
||||
light = "latte",
|
||||
dark = "mocha",
|
||||
},
|
||||
transparent_background = false, -- disables setting the background color.
|
||||
float = {
|
||||
transparent = false, -- enable transparent floating windows
|
||||
solid = false, -- use solid styling for floating windows, see |winborder|
|
||||
},
|
||||
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
|
||||
dim_inactive = {
|
||||
enabled = false, -- dims the background color of inactive window
|
||||
shade = "dark",
|
||||
percentage = 0.15, -- percentage of the shade to apply to the inactive window
|
||||
},
|
||||
no_italic = false, -- Force no italic
|
||||
no_bold = false, -- Force no bold
|
||||
no_underline = false, -- Force no underline
|
||||
styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
|
||||
comments = { "italic" }, -- Change the style of comments
|
||||
conditionals = { "italic" },
|
||||
loops = {},
|
||||
functions = {},
|
||||
keywords = {},
|
||||
strings = {},
|
||||
variables = {},
|
||||
numbers = {},
|
||||
booleans = {},
|
||||
properties = {},
|
||||
types = {},
|
||||
operators = {},
|
||||
-- miscs = {}, -- Uncomment to turn off hard-coded styles
|
||||
},
|
||||
lsp_styles = { -- Handles the style of specific lsp hl groups (see `:h lsp-highlight`).
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
ok = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
ok = { "underline" },
|
||||
},
|
||||
inlay_hints = {
|
||||
background = true,
|
||||
},
|
||||
},
|
||||
color_overrides = {},
|
||||
custom_highlights = {},
|
||||
default_integrations = true,
|
||||
auto_integrations = false,
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
nvimtree = true,
|
||||
notify = false,
|
||||
mini = {
|
||||
enabled = true,
|
||||
indentscope_color = "",
|
||||
},
|
||||
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
||||
},
|
||||
})
|
||||
|
||||
-- setup must be called before loading
|
||||
vim.cmd.colorscheme("catppuccin-nvim")
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
---@class Config: ConfigOptions
|
||||
local M = {}
|
||||
|
||||
---@class ConfigOptions
|
||||
local defaultOpts = {
|
||||
---@type string | fun()
|
||||
colorscheme = "catppuccin",
|
||||
}
|
||||
|
||||
vim.g.disable_autoformat = false
|
||||
|
||||
---@param name "options" | "keymaps" | "clipboard"
|
||||
function M.load(name)
|
||||
local mod = "juancwu.config." .. name
|
||||
local error_handler = function(err)
|
||||
local msg = "Failed loading " .. mod .. "\n\n" .. err
|
||||
print(msg)
|
||||
end
|
||||
xpcall(function()
|
||||
require(mod)
|
||||
end, error_handler)
|
||||
end
|
||||
|
||||
---@type ConfigOptions
|
||||
local options
|
||||
|
||||
---@param opts? ConfigOptions
|
||||
function M.setup(opts)
|
||||
options = vim.tbl_deep_extend("force", defaultOpts, opts or {}) or {}
|
||||
|
||||
M.load("options")
|
||||
M.load("keymaps")
|
||||
M.load("clipboard")
|
||||
|
||||
require("lazy").setup("juancwu.plugins")
|
||||
|
||||
-- try to load colorscheme
|
||||
xpcall(function()
|
||||
if type(M.colorscheme) == "function" then
|
||||
M.colorscheme()
|
||||
else
|
||||
vim.cmd.colorscheme(M.colorscheme)
|
||||
end
|
||||
end, function(err)
|
||||
if type(M.colorscheme) == "string" then
|
||||
local msg = "Failed to load colorscheme " .. M.colorscheme .. "\n\n" .. err
|
||||
print(msg)
|
||||
else
|
||||
print("Failed to load colorscheme\n\n" .. err)
|
||||
end
|
||||
vim.cmd.colorscheme("rose-pine")
|
||||
end)
|
||||
|
||||
-- create command to disable autoformat
|
||||
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
||||
vim.g.disable_autoformat = true
|
||||
end, { desc = "Disable Autoformat" })
|
||||
vim.api.nvim_create_user_command("FormatEnable", function(args)
|
||||
vim.g.disable_autoformat = false
|
||||
end, { desc = "Enable Autoformat" })
|
||||
end
|
||||
|
||||
setmetatable(M, {
|
||||
__index = function(_, k)
|
||||
if options == nil then
|
||||
return vim.deepcopy(defaultOpts)[k]
|
||||
end
|
||||
|
||||
return options[k]
|
||||
end,
|
||||
})
|
||||
|
||||
return M
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
-- easy escape
|
||||
vim.keymap.set("i", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
vim.keymap.set("v", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
vim.keymap.set("n", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
|
||||
-- open the explorer
|
||||
vim.keymap.set("n", "<leader>ex", "<cmd>Ex<CR>")
|
||||
|
||||
-- move highlighted lines
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
-- make cursor stay in same position when appending line below
|
||||
vim.keymap.set("n", "J", "mzJ`z")
|
||||
|
||||
-- make cursor stay in the middle while moving down/up the page
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
|
||||
-- make cursor stay in the middle while looking through search results
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
-- select and replace
|
||||
vim.keymap.set("n", "<leader>ss", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
-- do not copy with x, for god sake, WHY copy something that is being deleted??
|
||||
vim.keymap.set("n", "x", '"_x')
|
||||
|
||||
-- no copy, delete line, for god sake...
|
||||
vim.keymap.set("n", "dd", '"_dd')
|
||||
vim.keymap.set("n", "dx", "dd") -- cut line, under my control
|
||||
vim.keymap.set("v", "d", '"_d')
|
||||
|
||||
-- copy/paste to/from system clipboard
|
||||
vim.keymap.set({ "n", "v" }, "<leader>y", '"+y')
|
||||
vim.keymap.set({ "n", "v" }, "<leader>p", '"+p')
|
||||
|
||||
-- increment/decrement a count, helpful for changing indeces
|
||||
vim.keymap.set("n", "+", "<C-a>")
|
||||
vim.keymap.set("n", "-", "<C-x>")
|
||||
|
||||
-- do not copy when deleting word
|
||||
vim.keymap.set("n", "dw", '"_dw')
|
||||
vim.keymap.set("n", "db", 'vb"_d') -- delete in backwards
|
||||
|
||||
vim.keymap.set("n", "<C-a>", "gg<S-v>G") -- select all
|
||||
|
||||
-- split pane
|
||||
vim.keymap.set("n", "ss", ":split<Return><C-w>w", { silent = true }) -- horizontal
|
||||
vim.keymap.set("n", "sv", ":vsplit<Return><C-w>w", { silent = true }) -- vertical
|
||||
|
||||
-- pane movement
|
||||
vim.keymap.set("n", "..", "<C-w>w") -- toggle
|
||||
vim.keymap.set("n", "sh", "<C-w>h")
|
||||
vim.keymap.set("n", "sk", "<C-w>k")
|
||||
vim.keymap.set("n", "sl", "<C-w>l")
|
||||
vim.keymap.set("n", "sj", "<C-w>j")
|
||||
|
||||
-- resize pane
|
||||
vim.keymap.set("n", "<C-w><left>", "<C-w>5>")
|
||||
vim.keymap.set("n", "<C-w><right>", "<C-w>5<")
|
||||
vim.keymap.set("n", "<C-w><up>", "<C-w>5+")
|
||||
vim.keymap.set("n", "<C-w><down>", "<C-w>5-")
|
||||
|
||||
-- lazygit on floaterm
|
||||
vim.keymap.set("n", "<leader>g", "<cmd>FloatermNew lazygit<CR>", { noremap = true })
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
local M = {}
|
||||
|
||||
---@param opts? ConfigOptions
|
||||
function M.setup(opts)
|
||||
require("juancwu.config").setup(opts)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -1,139 +0,0 @@
|
|||
-- return { -- Autocompletion
|
||||
-- "hrsh7th/nvim-cmp",
|
||||
-- event = "InsertEnter",
|
||||
-- dependencies = {
|
||||
-- -- Snippet Engine & its associated nvim-cmp source
|
||||
-- {
|
||||
-- "L3MON4D3/LuaSnip",
|
||||
-- build = (function()
|
||||
-- -- Build Step is needed for regex support in snippets.
|
||||
-- -- This step is not supported in many windows environments.
|
||||
-- -- Remove the below condition to re-enable on windows.
|
||||
-- if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
|
||||
-- return
|
||||
-- end
|
||||
-- return "make install_jsregexp"
|
||||
-- end)(),
|
||||
-- dependencies = {
|
||||
-- {
|
||||
-- "rafamadriz/friendly-snippets",
|
||||
-- config = function()
|
||||
-- require("luasnip.loaders.from_vscode").lazy_load()
|
||||
-- end,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- "saadparwaiz1/cmp_luasnip",
|
||||
-- "hrsh7th/cmp-nvim-lsp",
|
||||
-- "hrsh7th/cmp-path",
|
||||
-- },
|
||||
-- config = function()
|
||||
-- -- See `:help cmp`
|
||||
-- local cmp = require("cmp")
|
||||
-- local luasnip = require("luasnip")
|
||||
-- luasnip.config.setup({})
|
||||
--
|
||||
-- cmp.setup({
|
||||
-- snippet = {
|
||||
-- expand = function(args)
|
||||
-- luasnip.lsp_expand(args.body)
|
||||
-- end,
|
||||
-- },
|
||||
-- completion = { completeopt = "menu,menuone,noinsert" },
|
||||
--
|
||||
-- -- For an understanding of why these mappings were
|
||||
-- -- chosen, you will need to read `:help ins-completion`
|
||||
-- --
|
||||
-- -- No, but seriously. Please read `:help ins-completion`, it is really good!
|
||||
-- mapping = cmp.mapping.preset.insert({
|
||||
-- -- Select the [n]ext item
|
||||
-- ["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
-- -- Select the [p]revious item
|
||||
-- ["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
--
|
||||
-- -- Scroll the documentation window [b]ack / [f]orward
|
||||
-- ["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
-- ["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
--
|
||||
-- -- Accept ([y]es) the completion.
|
||||
-- -- This will auto-import if your LSP supports it.
|
||||
-- -- This will expand snippets if the LSP sent a snippet.
|
||||
-- ["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
--
|
||||
-- -- Manually trigger a completion from nvim-cmp.
|
||||
-- -- Generally you don't need this, because nvim-cmp will display
|
||||
-- -- completions whenever it has completion options available.
|
||||
-- ["<C-Space>"] = cmp.mapping.complete({}),
|
||||
--
|
||||
-- -- <c-l> will move you to the right of each of the expansion locations.
|
||||
-- -- <c-h> is similar, except moving you backwards.
|
||||
-- ["<C-l>"] = cmp.mapping(function()
|
||||
-- if luasnip.expand_or_locally_jumpable() then
|
||||
-- luasnip.expand_or_jump()
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
-- ["<C-h>"] = cmp.mapping(function()
|
||||
-- if luasnip.locally_jumpable(-1) then
|
||||
-- luasnip.jump(-1)
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
-- }),
|
||||
-- sources = {
|
||||
-- {
|
||||
-- name = "lazydev",
|
||||
-- -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
||||
-- group_index = 0,
|
||||
-- },
|
||||
-- { name = "nvim_lsp" },
|
||||
-- { name = "luasnip" },
|
||||
-- { name = "path" },
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
-- }
|
||||
--
|
||||
|
||||
return {
|
||||
"saghen/blink.cmp",
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
version = "1.*",
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = "enter" },
|
||||
signature = {
|
||||
enabled = true,
|
||||
},
|
||||
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = true } },
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
dependencies = { "hrsh7th/nvim-cmp" },
|
||||
config = function()
|
||||
require("nvim-autopairs").setup({})
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
local cmp = require("cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
return {
|
||||
"windwp/nvim-ts-autotag",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
|
||||
ft = {
|
||||
"html",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"svelte",
|
||||
"vue",
|
||||
"tsx",
|
||||
"jsx",
|
||||
"xml",
|
||||
"php",
|
||||
"markdown",
|
||||
"astro",
|
||||
"glimmer",
|
||||
"handlebars",
|
||||
"hbs",
|
||||
"templ",
|
||||
"blade",
|
||||
},
|
||||
config = function()
|
||||
local autotag = require("nvim-ts-autotag")
|
||||
autotag.setup({
|
||||
enable = true,
|
||||
enable_close_on_slash = false,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
return {
|
||||
-- rose-pine
|
||||
{
|
||||
"rose-pine/nvim",
|
||||
name = "rose-pine",
|
||||
priority = 1000,
|
||||
},
|
||||
|
||||
-- onedark
|
||||
{
|
||||
"navarasu/onedark.nvim",
|
||||
priority = 1000,
|
||||
},
|
||||
|
||||
-- solarized-osaka
|
||||
{
|
||||
"craftzdog/solarized-osaka.nvim",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
transparent = false,
|
||||
},
|
||||
},
|
||||
|
||||
-- tokyonight
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = true,
|
||||
opts = { style = "moon" },
|
||||
},
|
||||
|
||||
-- catppuccin
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
lazy = true,
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
flavour = "mocha",
|
||||
integrations = { blink_cmp = true },
|
||||
},
|
||||
},
|
||||
|
||||
-- great kanagawa
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
dependencies = {
|
||||
{
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
opts = {
|
||||
enable_autocmd = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local comment = require("Comment")
|
||||
comment.setup({
|
||||
pre_hook = function(ctx)
|
||||
-- only for tsx/jsx filetypes
|
||||
if vim.bo.filetype == "typescriptreact" or vim.bo.filetype == "javascriptreact" then
|
||||
local U = require("Comment.utils")
|
||||
|
||||
-- determine wheter to use linwise or blockwise commentstring
|
||||
local type = ctx.ctype == U.ctype.linewise and "__default" or "__multiline"
|
||||
|
||||
-- determine the location where to calcualte commentstring from
|
||||
local location = nil
|
||||
if ctx.ctype == U.ctype.blockwise then
|
||||
location = require("ts_context_commentstring.utils").get_cursor_location()
|
||||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||
location = require("ts_context_commentstring.utils").get_visual_start_location()
|
||||
end
|
||||
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring({
|
||||
key = type,
|
||||
location = location,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
local formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
javascript = { "biome" },
|
||||
typescript = { "biome" },
|
||||
javascriptreact = { "biome" },
|
||||
typescriptreact = { "biome" },
|
||||
css = { "biome" },
|
||||
markdown = { "biome" },
|
||||
jsonc = { "biome" },
|
||||
json = { "biome" },
|
||||
go = { "gofmt", "goimports" },
|
||||
python = { "autopep8" },
|
||||
yaml = { "yamlfmt" },
|
||||
yml = { "yamlfmt" },
|
||||
zig = { "zigfmt" },
|
||||
rust = { "rustfmt" },
|
||||
templ = { "templ" },
|
||||
php = { "pint" },
|
||||
blade = { "blade-formatter" },
|
||||
}
|
||||
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre", "BufEnter" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>ff",
|
||||
function()
|
||||
require("conform").format({ async = true, lsp_format = "fallback" })
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[F]ormat buffer",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
notify_on_error = false,
|
||||
formatters_by_ft = formatters_by_ft,
|
||||
formatters = {
|
||||
pint = {
|
||||
command = "vendor/bin/pint",
|
||||
args = { "$FILENAME" },
|
||||
stdin = false,
|
||||
},
|
||||
["blade-formatter"] = {
|
||||
command = "blade-formatter",
|
||||
args = {
|
||||
"--write",
|
||||
"--stdin",
|
||||
},
|
||||
},
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
return {
|
||||
timeout_ms = 2500,
|
||||
lsp_format = "fallback",
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("FormatDisable", function()
|
||||
vim.g.disable_autoformat = true
|
||||
end, {
|
||||
desc = "Disable autoformat on save",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("FormatEnable", function()
|
||||
vim.g.disable_autoformat = false
|
||||
end, {
|
||||
desc = "Enable autoformat on save",
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
return {
|
||||
"tpope/vim-fugitive",
|
||||
cmd = {
|
||||
"Git",
|
||||
"G",
|
||||
"Gdiffsplit",
|
||||
"Gread",
|
||||
"Gwrite",
|
||||
"Ggrep",
|
||||
"GMove",
|
||||
"GDelete",
|
||||
"GBrowse",
|
||||
"GRemove",
|
||||
"GRename",
|
||||
"Glgrep",
|
||||
"Gedit",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>gs", "<cmd>Git<CR>", desc = "Git status" },
|
||||
{ "<leader>gbl", "<cmd>Git blame<CR>", desc = "Open [G]it [Bl]ame" },
|
||||
{ "<leader>gd", "<cmd>Gdiffsplit<CR>", desc = "Open [G]it [D]iff" },
|
||||
},
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol",
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "-" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
return {
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
opts = {
|
||||
library = {
|
||||
{ path = "luvit-meta/library", words = { "vim%.uv" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,214 +0,0 @@
|
|||
return {
|
||||
-- lspconfig
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
|
||||
{ "williamboman/mason.nvim", opts = {} },
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
|
||||
-- status updates for LSP
|
||||
{ "j-hui/fidget.nvim", opts = {} },
|
||||
|
||||
{ "saghen/blink.cmp" },
|
||||
},
|
||||
config = function()
|
||||
-- stole this from kickstart, great config
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
||||
callback = function(event)
|
||||
-- This is the helper function to set keymaps locally for this buffer
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or "n"
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||
end
|
||||
|
||||
-- Use built-in LSP for definitions (replaces deprecated Telescope function)
|
||||
map("gd", vim.lsp.buf.definition, "[G]oto [D]efinition")
|
||||
|
||||
-- Use Telescope for references (auto-closes on selection)
|
||||
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||
|
||||
-- Use built-in LSP for implementation (replaces deprecated Telescope function)
|
||||
map("gI", vim.lsp.buf.implementation, "[G]oto [I]mplementation")
|
||||
|
||||
-- Use built-in LSP for type definitions (replaces deprecated Telescope function)
|
||||
map("<leader>D", vim.lsp.buf.type_definition, "Type [D]efinition")
|
||||
|
||||
-- Telescope for document symbols (this is a good use for Telescope)
|
||||
map("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols")
|
||||
|
||||
-- Telescope for workspace symbols (also a good use for Telescope)
|
||||
map("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
|
||||
|
||||
-- Built-in LSP for renaming
|
||||
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
|
||||
-- Built-in LSP for code actions
|
||||
map("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" })
|
||||
|
||||
-- Built-in LSP for declaration
|
||||
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
|
||||
-- Built-in LSP for diagnostics
|
||||
map("[d", vim.diagnostic.goto_prev, "Go to previous diagnostic")
|
||||
map("]d", vim.diagnostic.goto_next, "Go to next diagnostic")
|
||||
|
||||
-- The following two autocommands are used to highlight references of the
|
||||
-- word under your cursor when your cursor rests there for a little while.
|
||||
-- See `:help CursorHold` for information about when this is executed
|
||||
--
|
||||
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
|
||||
local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspDetach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }),
|
||||
callback = function(event2)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event2.buf })
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("blink.cmp").get_lsp_capabilities(capabilities)
|
||||
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
templ = "templ",
|
||||
},
|
||||
pattern = {
|
||||
[".*%.blade%.php"] = "blade",
|
||||
},
|
||||
})
|
||||
|
||||
local servers = {
|
||||
ts_ls = {},
|
||||
gopls = {},
|
||||
zls = {},
|
||||
rust_analyzer = {},
|
||||
templ = {
|
||||
filetypes = { "templ" },
|
||||
},
|
||||
intelephense = {},
|
||||
html = {
|
||||
filetypes = { "html", "twig", "hbs", "blade" },
|
||||
},
|
||||
emmet_ls = {
|
||||
filetypes = {
|
||||
"html",
|
||||
"typescriptreact",
|
||||
"javascriptreact",
|
||||
"css",
|
||||
"sass",
|
||||
"scss",
|
||||
"less",
|
||||
"blade",
|
||||
},
|
||||
},
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
cssls = {},
|
||||
css_variables = {},
|
||||
tailwindcss = {
|
||||
filetypes = {
|
||||
"templ",
|
||||
"html",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"blade",
|
||||
},
|
||||
init_options = {
|
||||
userLanguages = {
|
||||
templ = "html",
|
||||
blade = "html",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, { "stylua", "yamlfmt", "biome", "goimports", "pint", "blade-formatter" })
|
||||
-- require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
|
||||
|
||||
local profiles = {
|
||||
base = { "yamlfmt" },
|
||||
lua = { "lua_ls", "stylua" },
|
||||
web = {
|
||||
"ts_ls",
|
||||
"tailwindcss",
|
||||
"biome",
|
||||
"intelephense",
|
||||
"templ",
|
||||
"cssls",
|
||||
"css_variables",
|
||||
"html",
|
||||
"emmet_ls",
|
||||
"pint",
|
||||
"blade-formatter",
|
||||
},
|
||||
go = { "gopls", "goimports" },
|
||||
rust = { "rust_analyzer" },
|
||||
zig = { "zls" },
|
||||
all = ensure_installed,
|
||||
}
|
||||
|
||||
vim.api.nvim_create_user_command("InstallProfile", function(opts)
|
||||
local profile_name = opts.args
|
||||
local tools = profiles[profile_name]
|
||||
|
||||
if not tools then
|
||||
print(
|
||||
"Profile '"
|
||||
.. profile_name
|
||||
.. "' not found. Available: "
|
||||
.. table.concat(vim.tbl_keys(profiles), ", ")
|
||||
)
|
||||
return
|
||||
end
|
||||
|
||||
require("mason-tool-installer").setup({ ensure_installed = tools })
|
||||
vim.cmd("MasonToolsInstall")
|
||||
end, {
|
||||
desc = "Install tools for a specific profile (e.g., web, lua, go)",
|
||||
nargs = 1,
|
||||
complete = function()
|
||||
return vim.tbl_keys(profiles)
|
||||
end,
|
||||
})
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
handlers = {
|
||||
function(server_name)
|
||||
local server = servers[server_name] or {}
|
||||
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
||||
require("lspconfig")[server_name].setup(server)
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
config = function()
|
||||
local lualine = require("lualine")
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
--[[ section_separators = {
|
||||
left = '',
|
||||
right = ''
|
||||
},
|
||||
component_separators = {
|
||||
left = '',
|
||||
right = ''
|
||||
}, ]]
|
||||
section_separators = "",
|
||||
component_separators = "|",
|
||||
disabled_filetypes = {},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
file_status = true, -- display file status
|
||||
path = 1, -- no file path
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
symbols = { error = " ", warn = " ", info = " ", hint = "" },
|
||||
},
|
||||
"enconding",
|
||||
"filetype",
|
||||
},
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
file_status = true,
|
||||
path = 1,
|
||||
},
|
||||
},
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = { "fugitive" },
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
return {
|
||||
"Bilal2453/luvit-meta",
|
||||
lazy = true,
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
return {
|
||||
"echasnovski/mini.indentscope",
|
||||
version = false, -- wait till new 0.7.0 release to put it back on semver
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
-- symbol = "▏",
|
||||
symbol = "│",
|
||||
options = { try_as_border = true },
|
||||
},
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
enabled = false,
|
||||
branch = "v2.x",
|
||||
cmd = { "Neotree" },
|
||||
keys = {
|
||||
{ "<leader>fs", "<cmd>NeoTreeFloatToggle<CR>", desc = "Toggle [F]ile [S]ystem Floating Menu" },
|
||||
{ "<C-b>", "<cmd>NeoTreeFocusToggle<CR>", desc = "Open Side File System" },
|
||||
},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
use_default_mappings = true,
|
||||
mappings = {
|
||||
["<space>"] = {
|
||||
"toggle_node",
|
||||
nowait = true, -- disable `nowait` if you have existing combos starting with this char that you want to use
|
||||
},
|
||||
["<2-LeftMouse>"] = "open",
|
||||
["<cr>"] = "open",
|
||||
["<esc>"] = "cancel", -- close preview or floating neo-tree window
|
||||
["P"] = { "toggle_preview", config = { use_float = true } },
|
||||
["l"] = "focus_preview",
|
||||
["O"] = "open_split",
|
||||
["o"] = "open_vsplit",
|
||||
["S"] = "none",
|
||||
["s"] = "none",
|
||||
-- ["S"] = "split_with_window_picker",
|
||||
-- ["s"] = "vsplit_with_window_picker",
|
||||
["t"] = "open_tabnew",
|
||||
-- ["<cr>"] = "open_drop",
|
||||
-- ["t"] = "open_tab_drop",
|
||||
["w"] = "open_with_window_picker",
|
||||
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
|
||||
["C"] = "close_node",
|
||||
-- ['C'] = 'close_all_subnodes',
|
||||
["z"] = "close_all_nodes",
|
||||
--["Z"] = "expand_all_nodes",
|
||||
["a"] = {
|
||||
"add",
|
||||
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
|
||||
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
|
||||
config = {
|
||||
show_path = "none", -- "none", "relative", "absolute"
|
||||
},
|
||||
},
|
||||
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
|
||||
["d"] = "delete",
|
||||
["r"] = "rename",
|
||||
["y"] = "copy_to_clipboard",
|
||||
["x"] = "cut_to_clipboard",
|
||||
["p"] = "paste_from_clipboard",
|
||||
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
|
||||
-- ["c"] = {
|
||||
-- "copy",
|
||||
-- config = {
|
||||
-- show_path = "none" -- "none", "relative", "absolute"
|
||||
-- }
|
||||
--}
|
||||
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
|
||||
["q"] = "close_window",
|
||||
["R"] = "refresh",
|
||||
["?"] = "show_help",
|
||||
["<"] = "prev_source",
|
||||
[">"] = "next_source",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
local linters_by_ft = {
|
||||
javascript = { "biomejs", "eslint" },
|
||||
typescript = { "biomejs", "eslint" },
|
||||
javascriptreact = { "biomejs", "eslint" },
|
||||
typescriptreact = { "biomejs", "eslint" },
|
||||
jsonc = { "biomejs" },
|
||||
json = { "biomejs" },
|
||||
css = { "biomejs" },
|
||||
}
|
||||
|
||||
-- Function to find the first config file by walking up the directory tree
|
||||
local function find_first_config()
|
||||
local current_dir = vim.fn.expand("%:p:h")
|
||||
local home_dir = vim.fn.expand("$HOME")
|
||||
|
||||
local config_files = {
|
||||
biomejs = { "biome.json" },
|
||||
eslint = { ".eslintrc", ".eslintrc.js", ".eslintrc.json", ".eslintrc.yml" },
|
||||
}
|
||||
|
||||
while current_dir ~= home_dir and current_dir ~= "/" do
|
||||
for linter, patterns in pairs(config_files) do
|
||||
for _, pattern in ipairs(patterns) do
|
||||
local config_file = current_dir .. "/" .. pattern
|
||||
if vim.fn.filereadable(config_file) == 1 then
|
||||
return linter
|
||||
end
|
||||
end
|
||||
end
|
||||
current_dir = vim.fn.fnamemodify(current_dir, ":h")
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Function to determine the linter based on config files and file type
|
||||
local function get_linter()
|
||||
local filetype = vim.bo.filetype
|
||||
local available_linters = linters_by_ft[filetype] or {}
|
||||
local linter = find_first_config()
|
||||
|
||||
if linter then
|
||||
if vim.tbl_contains(available_linters, linter) then
|
||||
vim.g.current_linter = linter
|
||||
return linter
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
local function lint()
|
||||
local nvimlint = require("lint")
|
||||
local linter = get_linter()
|
||||
if linter ~= nil then
|
||||
nvimlint.try_lint(linter)
|
||||
else
|
||||
print("No linter found for filetype: " .. vim.bo.filetype)
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
keys = {
|
||||
{
|
||||
"<leader>lf",
|
||||
function()
|
||||
lint()
|
||||
end,
|
||||
mode = "n",
|
||||
desc = "[L]int [F]ile",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
vim.api.nvim_create_user_command("Lint", function()
|
||||
lint()
|
||||
end, { desc = "Lint file" })
|
||||
|
||||
vim.api.nvim_create_user_command("LintInfo", function()
|
||||
print("Current linter: " .. (vim.g.current_linter or "none"))
|
||||
end, {
|
||||
desc = "Show current linter being used",
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
return {
|
||||
"stevearc/oil.nvim",
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
-- Optional dependencies
|
||||
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
config = function()
|
||||
local oil = require("oil")
|
||||
|
||||
oil.setup({
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>oo",
|
||||
function()
|
||||
require("oil").open()
|
||||
end,
|
||||
mode = "n",
|
||||
desc = "[O]pen [O]il",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
return {
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {},
|
||||
}
|
||||
|
|
@ -1,187 +0,0 @@
|
|||
local function get_fd_command()
|
||||
if vim.fn.executable("fd") == 1 then
|
||||
return "fd"
|
||||
elseif vim.fn.executable("fdfind") == 1 then
|
||||
return "fdfind"
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
version = "0.1.8",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
enabled = true,
|
||||
cond = function()
|
||||
return vim.fn.executable("make") == 1
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
enabled = true,
|
||||
},
|
||||
{ "nvim-telescope/telescope-ui-select.nvim" },
|
||||
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local builtin = require("telescope.builtin")
|
||||
local fb_actions = require("telescope").extensions.file_browser.actions
|
||||
|
||||
local function telescope_buffer_dir()
|
||||
return vim.fn.expand("%:p:h")
|
||||
end
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
n = {
|
||||
["q"] = actions.close,
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown(),
|
||||
},
|
||||
file_browser = {
|
||||
theme = "dropdown",
|
||||
hijack_netrw = false,
|
||||
hidden = true,
|
||||
mappings = {
|
||||
["i"] = {
|
||||
["<C-w>"] = function()
|
||||
vim.cmd("normal vbd")
|
||||
end,
|
||||
["<C-j>"] = function(bufnr)
|
||||
actions.move_selection_next(bufnr)
|
||||
end,
|
||||
["<C-k>"] = function(bufnr)
|
||||
actions.move_selection_previous(bufnr)
|
||||
end,
|
||||
["<C-s>"] = function(bufnr)
|
||||
actions.select_vertical(bufnr)
|
||||
end,
|
||||
},
|
||||
["n"] = {
|
||||
["a"] = fb_actions.create,
|
||||
["h"] = fb_actions.goto_parent_dir,
|
||||
["/"] = function()
|
||||
vim.cmd("startinsert")
|
||||
end,
|
||||
["d"] = fb_actions.remove,
|
||||
["e"] = fb_actions.change_cwd,
|
||||
["<C-s>"] = function(bufnr)
|
||||
actions.select_vertical(bufnr)
|
||||
end,
|
||||
["<C-a>"] = function(bufnr)
|
||||
actions.toggle_all(bufnr)
|
||||
end,
|
||||
["<C-d>"] = function(bufnr)
|
||||
actions.move_selection_next(bufnr)
|
||||
end,
|
||||
["<C-u>"] = function(bufnr)
|
||||
actions.move_selection_previous(bufnr)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
pcall(telescope.load_extension, "file_browser")
|
||||
pcall(telescope.load_extension, "fzf")
|
||||
pcall(telescope.load_extension, "ui-select")
|
||||
|
||||
-- Builtin pickers
|
||||
vim.keymap.set("n", "<leader>sf", function()
|
||||
local fd_cmd = get_fd_command()
|
||||
local config = {
|
||||
hidden = true,
|
||||
file_ignore_patterns = {
|
||||
"node%_modules/.*",
|
||||
"%.git/.*",
|
||||
"%.rustup/.*",
|
||||
"target/.*",
|
||||
".devbox/.*",
|
||||
".nix/.*",
|
||||
"vendor/.*",
|
||||
"storage/.*",
|
||||
},
|
||||
}
|
||||
|
||||
if fd_cmd then
|
||||
config.find_command = {
|
||||
fd_cmd,
|
||||
"--type",
|
||||
"f",
|
||||
"--color",
|
||||
"never",
|
||||
"--hidden",
|
||||
"--no-ignore",
|
||||
}
|
||||
end
|
||||
|
||||
builtin.find_files(config)
|
||||
end, { desc = "[S]earch [F]iles" })
|
||||
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp Tags" })
|
||||
vim.keymap.set("n", "<leader>sb", builtin.buffers, { desc = "[S]earch [B]uffers" })
|
||||
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
|
||||
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||
-- vim.keymap.set("n", "gr", builtin.lsp_references, { desc = "[G]o to [R]eferences", noremap = true })
|
||||
-- vim.keymap.set("n", "gd", builtin.lsp_definitions, { desc = "[G]o to [D]efinitions" })
|
||||
-- vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "[G]o to [D]eclaration" })
|
||||
-- vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "[R]e[N]ame" })
|
||||
|
||||
-- Git pickers
|
||||
vim.keymap.set("n", "<leader>gf", builtin.git_files, { desc = "Search [G]it [F]iles" })
|
||||
vim.keymap.set("n", "<leader>gs", builtin.git_status, { desc = "List [G]it [S]tatus" })
|
||||
vim.keymap.set("n", "<leader>gh", builtin.git_stash, { desc = "List [G]it [S]tash" })
|
||||
vim.keymap.set("n", "<leader>gbb", builtin.git_branches, { desc = "List [G]it [B]ranches" })
|
||||
vim.keymap.set("n", "<leader>gc", builtin.git_bcommits, { desc = "List Buffer [G]it [C]ommits" })
|
||||
|
||||
-- File Browser Ext
|
||||
vim.keymap.set("n", "<leader>fs", function()
|
||||
telescope.extensions.file_browser.file_browser({
|
||||
path = "%:p:h",
|
||||
cwd = telescope_buffer_dir(),
|
||||
respect_gitignore = false,
|
||||
hidden = true,
|
||||
grouped = true,
|
||||
previewer = false,
|
||||
initial_mode = "normal",
|
||||
layout_config = { height = 40 },
|
||||
})
|
||||
end, { desc = "Open [F]ile [S]ystem Menu" })
|
||||
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = "[/] Fuzzily serach in current buffer" })
|
||||
|
||||
-- live grep in open files only
|
||||
vim.keymap.set("n", "<leader>s/", function()
|
||||
builtin.live_grep({
|
||||
grep_open_files = true,
|
||||
prompt_title = "Live Grep in Open Files",
|
||||
})
|
||||
end, { desc = "[S]search [/] in Open Files" })
|
||||
|
||||
-- shortcut for searching neovim config files
|
||||
vim.keymap.set("n", "<leader>sn", function()
|
||||
builtin.find_files({ cwd = vim.fn.stdpath("config") })
|
||||
end, { desc = "[S]earch [N]eovim files" })
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {},
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
return {
|
||||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
keys = {
|
||||
{
|
||||
"<leader>lg",
|
||||
function()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({
|
||||
cmd = "lazygit",
|
||||
direction = "float",
|
||||
float_opts = {
|
||||
border = "double",
|
||||
},
|
||||
on_open = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
end,
|
||||
on_close = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
end,
|
||||
})
|
||||
lazygit:toggle()
|
||||
end,
|
||||
desc = "Open lazygit in a floating window",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
size = 20,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true,
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
terminal_mappings = true,
|
||||
persist_size = true,
|
||||
persist_mode = true,
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = {
|
||||
"BufReadPost",
|
||||
"BufNewFile",
|
||||
},
|
||||
branch = "master",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
config = function()
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
treesitter.setup({
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"vimdoc",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"c",
|
||||
"lua",
|
||||
"rust",
|
||||
"go",
|
||||
"gosum",
|
||||
"gomod",
|
||||
"php",
|
||||
"blade",
|
||||
},
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
auto_install = true,
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<leader>c",
|
||||
node_incremental = "<C-p>",
|
||||
scope_incremental = "<C-s>",
|
||||
node_decremental = "<M-p>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["aa"] = "@parameter.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]M"] = "@function.outer",
|
||||
["]["] = "@class.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[M"] = "@function.outer",
|
||||
["[]"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>]"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>["] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
autotag = {
|
||||
enable = false,
|
||||
enable_close_on_slash = false,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
return {
|
||||
"mbbill/undotree",
|
||||
keys = {
|
||||
{ "<leader>u", "<cmd>UndotreeToggle<CR>", desc = "Toggle Undotree" },
|
||||
},
|
||||
config = function()
|
||||
local has_persistent_undo = vim.api.nvim_call_function("has", { "persistent_undo" })
|
||||
|
||||
if has_persistent_undo then
|
||||
local target_path = vim.api.nvim_call_function("expand", { "~/.undodir" })
|
||||
|
||||
local is_directory = vim.api.nvim_call_function("isdirectory", { target_path })
|
||||
|
||||
if not is_directory then
|
||||
vim.api.nvim_call_function("mkdir", { target_path, "p", 0700 })
|
||||
end
|
||||
|
||||
vim.opt.undodir = target_path
|
||||
vim.opt.undofile = true
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
vim.opt.timeout = true
|
||||
vim.opt.timeoutlen = 300
|
||||
|
||||
local wk = require("which-key")
|
||||
|
||||
wk.setup({
|
||||
delay = 0,
|
||||
icons = {
|
||||
mappings = vim.g.have_nerd_font,
|
||||
keys = vim.g.have_nerd_font and {} or {
|
||||
Up = "<Up> ",
|
||||
Down = "<Down> ",
|
||||
Left = "<Left> ",
|
||||
Right = "<Right> ",
|
||||
C = "<C-…> ",
|
||||
M = "<M-…> ",
|
||||
D = "<D-…> ",
|
||||
S = "<S-…> ",
|
||||
CR = "<CR> ",
|
||||
Esc = "<Esc> ",
|
||||
ScrollWheelDown = "<ScrollWheelDown> ",
|
||||
ScrollWheelUp = "<ScrollWheelUp> ",
|
||||
NL = "<NL> ",
|
||||
BS = "<BS> ",
|
||||
Space = "<Space> ",
|
||||
Tab = "<Tab> ",
|
||||
F1 = "<F1>",
|
||||
F2 = "<F2>",
|
||||
F3 = "<F3>",
|
||||
F4 = "<F4>",
|
||||
F5 = "<F5>",
|
||||
F6 = "<F6>",
|
||||
F7 = "<F7>",
|
||||
F8 = "<F8>",
|
||||
F9 = "<F9>",
|
||||
F10 = "<F10>",
|
||||
F11 = "<F11>",
|
||||
F12 = "<F12>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
---@class Utils
|
||||
---@field os juancwu.utils.os
|
||||
local M = setmetatable({}, {
|
||||
__index = function(t, k)
|
||||
t[k] = require("juancwu.utils." .. k)
|
||||
return t[k]
|
||||
end,
|
||||
})
|
||||
|
||||
return M
|
||||
187
nvim/lua/keymaps.lua
Normal file
187
nvim/lua/keymaps.lua
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
-- easy escape
|
||||
vim.keymap.set("i", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
vim.keymap.set("v", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
vim.keymap.set("n", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
|
||||
-- open the explorer
|
||||
vim.keymap.set("n", "<leader>ex", "<cmd>Ex<CR>")
|
||||
|
||||
-- move highlighted lines
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
-- make cursor stay in same position when appending line below
|
||||
vim.keymap.set("n", "J", "mzJ`z")
|
||||
|
||||
-- make cursor stay in the middle while moving down/up the page
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
|
||||
-- make cursor stay in the middle while looking through search results
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
-- select and replace
|
||||
vim.keymap.set("n", "<leader>ss", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
-- do not copy with x, for god sake, WHY copy something that is being deleted??
|
||||
vim.keymap.set("n", "x", '"_x')
|
||||
|
||||
-- no copy, delete line, for god sake...
|
||||
vim.keymap.set("n", "dd", '"_dd')
|
||||
vim.keymap.set("n", "dx", "dd") -- cut line, under my control
|
||||
vim.keymap.set("v", "d", '"_d')
|
||||
|
||||
-- copy/paste to/from system clipboard
|
||||
vim.keymap.set({ "n", "v" }, "<leader>y", '"+y')
|
||||
vim.keymap.set({ "n", "v" }, "<leader>p", '"+p')
|
||||
|
||||
-- increment/decrement a count, helpful for changing indeces
|
||||
vim.keymap.set("n", "+", "<C-a>")
|
||||
vim.keymap.set("n", "-", "<C-x>")
|
||||
|
||||
-- do not copy when deleting word
|
||||
vim.keymap.set("n", "dw", '"_dw')
|
||||
vim.keymap.set("n", "db", 'vb"_d') -- delete in backwards
|
||||
|
||||
vim.keymap.set("n", "<C-a>", "gg<S-v>G") -- select all
|
||||
|
||||
-- split pane
|
||||
vim.keymap.set("n", "ss", ":split<Return><C-w>w", { silent = true }) -- horizontal
|
||||
vim.keymap.set("n", "sv", ":vsplit<Return><C-w>w", { silent = true }) -- vertical
|
||||
|
||||
-- pane movement
|
||||
vim.keymap.set("n", "..", "<C-w>w") -- toggle
|
||||
vim.keymap.set("n", "sh", "<C-w>h")
|
||||
vim.keymap.set("n", "sk", "<C-w>k")
|
||||
vim.keymap.set("n", "sl", "<C-w>l")
|
||||
vim.keymap.set("n", "sj", "<C-w>j")
|
||||
|
||||
-- resize pane
|
||||
vim.keymap.set("n", "<C-w><left>", "<C-w>5>")
|
||||
vim.keymap.set("n", "<C-w><right>", "<C-w>5<")
|
||||
vim.keymap.set("n", "<C-w><up>", "<C-w>5+")
|
||||
vim.keymap.set("n", "<C-w><down>", "<C-w>5-")
|
||||
|
||||
-- lazygit on floaterm
|
||||
vim.keymap.set("n", "<leader>lg", function()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({
|
||||
cmd = "lazygit",
|
||||
direction = "float",
|
||||
float_opts = {
|
||||
border = "double",
|
||||
},
|
||||
on_open = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
end,
|
||||
on_close = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
end,
|
||||
})
|
||||
lazygit:toggle()
|
||||
end, { desc = "Open lazygit in a floating window" })
|
||||
|
||||
-- built-in package manager update
|
||||
vim.keymap.set("n", "<leader>pu", "<cmd>lua vim.pack.update()<CR>")
|
||||
|
||||
-- oil.nvim
|
||||
vim.keymap.set("n", "<leader>oo", "<cmd>Oil<CR>")
|
||||
|
||||
-- conform.nvim
|
||||
vim.keymap.set("n", "<leader>ff", "<cmd>lua require('conform').format({ async = true, lsp_format = 'fallback' })<CR>")
|
||||
|
||||
-- telescope
|
||||
local telescope = require("telescope")
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
local function get_fd_command()
|
||||
if vim.fn.executable("fd") == 1 then
|
||||
return "fd"
|
||||
elseif vim.fn.executable("fdfind") == 1 then
|
||||
return "fdfind"
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
local function telescope_buffer_dir()
|
||||
return vim.fn.expand("%:p:h")
|
||||
end
|
||||
|
||||
-- Builtin pickers
|
||||
vim.keymap.set("n", "<leader>sf", function()
|
||||
local fd_cmd = get_fd_command()
|
||||
local config = {
|
||||
hidden = true,
|
||||
file_ignore_patterns = {
|
||||
"node%_modules/.*",
|
||||
"%.git/.*",
|
||||
"%.rustup/.*",
|
||||
"target/.*",
|
||||
".devbox/.*",
|
||||
".nix/.*",
|
||||
"vendor/.*",
|
||||
"storage/.*",
|
||||
},
|
||||
}
|
||||
|
||||
if fd_cmd then
|
||||
config.find_command = {
|
||||
fd_cmd,
|
||||
"--type",
|
||||
"f",
|
||||
"--color",
|
||||
"never",
|
||||
"--hidden",
|
||||
"--no-ignore",
|
||||
}
|
||||
end
|
||||
|
||||
builtin.find_files(config)
|
||||
end, { desc = "[S]earch [F]iles" })
|
||||
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp Tags" })
|
||||
vim.keymap.set("n", "<leader>sb", builtin.buffers, { desc = "[S]earch [B]uffers" })
|
||||
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
|
||||
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||
|
||||
-- Git pickers
|
||||
vim.keymap.set("n", "<leader>gf", builtin.git_files, { desc = "Search [G]it [F]iles" })
|
||||
vim.keymap.set("n", "<leader>gs", builtin.git_status, { desc = "List [G]it [S]tatus" })
|
||||
vim.keymap.set("n", "<leader>gh", builtin.git_stash, { desc = "List [G]it [S]tash" })
|
||||
vim.keymap.set("n", "<leader>gbb", builtin.git_branches, { desc = "List [G]it [B]ranches" })
|
||||
vim.keymap.set("n", "<leader>gc", builtin.git_bcommits, { desc = "List Buffer [G]it [C]ommits" })
|
||||
|
||||
-- File Browser Ext
|
||||
vim.keymap.set("n", "<leader>fs", function()
|
||||
telescope.extensions.file_browser.file_browser({
|
||||
path = "%:p:h",
|
||||
cwd = telescope_buffer_dir(),
|
||||
respect_gitignore = false,
|
||||
hidden = true,
|
||||
grouped = true,
|
||||
previewer = false,
|
||||
initial_mode = "normal",
|
||||
layout_config = { height = 40 },
|
||||
})
|
||||
end, { desc = "Open [F]ile [S]ystem Menu" })
|
||||
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = "[/] Fuzzily serach in current buffer" })
|
||||
|
||||
-- live grep in open files only
|
||||
vim.keymap.set("n", "<leader>s/", function()
|
||||
builtin.live_grep({
|
||||
grep_open_files = true,
|
||||
prompt_title = "Live Grep in Open Files",
|
||||
})
|
||||
end, { desc = "[S]search [/] in Open Files" })
|
||||
|
||||
-- shortcut for searching neovim config files
|
||||
vim.keymap.set("n", "<leader>sn", function()
|
||||
builtin.find_files({ cwd = vim.fn.stdpath("config") })
|
||||
end, { desc = "[S]earch [N]eovim files" })
|
||||
89
nvim/lua/lsp.lua
Normal file
89
nvim/lua/lsp.lua
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
-- Workaround for Neovim 0.12 bug: vim/lsp/document_color.lua#get_hex_code
|
||||
-- doesn't clamp lsp.Color channels, so a server returning a channel slightly
|
||||
-- above 1.0 produces a malformed 7-char hex (e.g. "#1006467") and crashes
|
||||
-- get_contrast_color. Clamp channels before the upstream handler runs.
|
||||
do
|
||||
require("vim.lsp.document_color")
|
||||
local Provider = require("vim.lsp._capability").all.document_color
|
||||
local orig_handler = Provider.handler
|
||||
Provider.handler = function(self, err, result, ctx)
|
||||
if type(result) == "table" then
|
||||
for _, res in ipairs(result) do
|
||||
local c = res and res.color
|
||||
if c then
|
||||
c.red = math.max(0, math.min(1, tonumber(c.red) or 0))
|
||||
c.green = math.max(0, math.min(1, tonumber(c.green) or 0))
|
||||
c.blue = math.max(0, math.min(1, tonumber(c.blue) or 0))
|
||||
if c.alpha ~= nil then
|
||||
c.alpha = math.max(0, math.min(1, tonumber(c.alpha) or 0))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return orig_handler(self, err, result, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
vim.lsp.enable({
|
||||
"bashls",
|
||||
"cssls",
|
||||
"css_variables",
|
||||
"gopls",
|
||||
"html",
|
||||
"lua_ls",
|
||||
"rust-analyzer",
|
||||
"tailwindcss",
|
||||
"templ",
|
||||
"ts_ls",
|
||||
})
|
||||
vim.diagnostic.config({ virtual_text = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("juancwu-lsp-attach", { clear = true }),
|
||||
callback = function(event)
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or "n"
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||
end
|
||||
|
||||
map("gd", vim.lsp.buf.definition, "[G]oto [D]efinition")
|
||||
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||
map("gI", vim.lsp.buf.implementation, "[G]oto [I]mplementation")
|
||||
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
map("<leader>D", vim.lsp.buf.type_definition, "Type [D]efinition")
|
||||
map("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols")
|
||||
map("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
|
||||
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
map("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" })
|
||||
map("[d", function()
|
||||
vim.diagnostic.jump({ count = -1, float = true })
|
||||
end, "Go to previous diagnostic")
|
||||
map("]d", function()
|
||||
vim.diagnostic.jump({ count = 1, float = true })
|
||||
end, "Go to next diagnostic")
|
||||
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
|
||||
local highlight_augroup = vim.api.nvim_create_augroup("juancwu-lsp-highlight", { clear = false })
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspDetach", {
|
||||
group = vim.api.nvim_create_augroup("juancwu-lsp-detach", { clear = true }),
|
||||
callback = function(event2)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds({ group = "juancwu-lsp-highlight", buffer = event2.buf })
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
@ -42,16 +42,6 @@ vim.opt.termguicolors = true -- good shit, just take it
|
|||
-- activate persistent undo
|
||||
vim.opt.undofile = true
|
||||
|
||||
-- highlight on yank
|
||||
local highligh_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highligh_group,
|
||||
pattern = "*",
|
||||
})
|
||||
|
||||
vim.opt.completeopt = "menu,menuone,noselect"
|
||||
|
||||
vim.opt.breakindent = true
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
---@class juancwu.utils.os
|
||||
local M = {}
|
||||
|
||||
---@return boolean
|
||||
318
nvim/lua/plugins.lua
Normal file
318
nvim/lua/plugins.lua
Normal file
|
|
@ -0,0 +1,318 @@
|
|||
-- blink blink dependencies
|
||||
vim.pack.add({ { src = "https://github.com/nvim-mini/mini.icons.git" } })
|
||||
require("mini.icons").setup()
|
||||
|
||||
-- mason for easy install of lsp, formatters, etc
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/mason-org/mason.nvim" },
|
||||
})
|
||||
|
||||
-- mason setup
|
||||
require("mason").setup({})
|
||||
|
||||
-- see git blame, diff in editor
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/lewis6991/gitsigns.nvim", version = "v2.1.0" },
|
||||
})
|
||||
|
||||
require("gitsigns").setup({
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol",
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "-" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
})
|
||||
|
||||
-- autocomplete
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/saghen/blink.cmp", version = "v1.10.2" },
|
||||
})
|
||||
|
||||
require("blink.cmp").setup({
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
signature = { enabled = true },
|
||||
keymap = {
|
||||
preset = "default",
|
||||
["<C-y>"] = { "show", "show_documentation", "hide_documentation" },
|
||||
["<C-n>"] = { "select_and_accept" },
|
||||
["<C-k>"] = { "select_prev", "fallback" },
|
||||
["<C-j>"] = { "select_next", "fallback" },
|
||||
["<C-l>"] = { "snippet_forward", "fallback" },
|
||||
["<C-h>"] = { "snippet_backward", "fallback" },
|
||||
-- ["<C-e>"] = { "hide" },
|
||||
},
|
||||
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = true,
|
||||
nerd_font_variant = "normal",
|
||||
},
|
||||
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 200,
|
||||
},
|
||||
},
|
||||
|
||||
cmdline = {
|
||||
keymap = {
|
||||
preset = "inherit",
|
||||
["<CR>"] = { "accept_and_enter", "fallback" },
|
||||
},
|
||||
},
|
||||
|
||||
sources = { default = { "lsp" } },
|
||||
})
|
||||
|
||||
-- filesystem navigation
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/stevearc/oil.nvim.git", version = "v2.15.0" },
|
||||
})
|
||||
|
||||
require("oil").setup({
|
||||
columns = {
|
||||
"icon",
|
||||
},
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
})
|
||||
|
||||
-- formatting
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/stevearc/conform.nvim.git",
|
||||
version = "v9.1.0",
|
||||
},
|
||||
})
|
||||
|
||||
local formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
javascript = { "biome" },
|
||||
typescript = { "biome" },
|
||||
javascriptreact = { "biome" },
|
||||
typescriptreact = { "biome" },
|
||||
css = { "biome" },
|
||||
markdown = { "biome" },
|
||||
jsonc = { "biome" },
|
||||
json = { "biome" },
|
||||
go = { "gofmt", "goimports" },
|
||||
python = { "autopep8" },
|
||||
yaml = { "yamlfmt" },
|
||||
yml = { "yamlfmt" },
|
||||
zig = { "zigfmt" },
|
||||
rust = { "rustfmt" },
|
||||
templ = { "templ" },
|
||||
php = { "pint" },
|
||||
blade = { "blade-formatter" },
|
||||
}
|
||||
|
||||
require("conform").setup({
|
||||
notify_on_error = false,
|
||||
formatters_by_ft = formatters_by_ft,
|
||||
formatters = {
|
||||
pint = {
|
||||
command = "vendor/bin/pint",
|
||||
args = { "$FILENAME" },
|
||||
stdin = false,
|
||||
},
|
||||
["blade-formatter"] = {
|
||||
command = "blade-formatter",
|
||||
args = {
|
||||
"--write",
|
||||
"--stdin",
|
||||
},
|
||||
},
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
return {
|
||||
timeout_ms = 2500,
|
||||
lsp_format = "fallback",
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
-- tree-sitter
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/nvim-treesitter/nvim-treesitter.git",
|
||||
version = "4916d6592ede8c07973490d9322f187e07dfefac",
|
||||
},
|
||||
})
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects.git",
|
||||
version = "851e865342e5a4cb1ae23d31caf6e991e1c99f1e",
|
||||
},
|
||||
})
|
||||
|
||||
-- floating windows
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/akinsho/toggleterm.nvim.git",
|
||||
version = "v2.13.1",
|
||||
},
|
||||
})
|
||||
|
||||
require("toggleterm").setup({
|
||||
size = 20,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true,
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
terminal_mappings = true,
|
||||
persist_size = true,
|
||||
persist_mode = true,
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- show indentation group
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/nvim-mini/mini.indentscope.git",
|
||||
version = "v0.17.0",
|
||||
},
|
||||
})
|
||||
|
||||
require("mini.indentscope").setup({
|
||||
symbol = "│",
|
||||
options = { try_as_border = true },
|
||||
})
|
||||
|
||||
-- telescope
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/nvim-lua/plenary.nvim.git",
|
||||
version = "v0.1.4",
|
||||
},
|
||||
})
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/nvim-telescope/telescope.nvim.git",
|
||||
version = "v0.2.2",
|
||||
},
|
||||
})
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/nvim-telescope/telescope-fzf-native.nvim.git",
|
||||
version = "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c",
|
||||
},
|
||||
})
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/nvim-telescope/telescope-file-browser.nvim.git",
|
||||
version = "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e",
|
||||
},
|
||||
})
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/nvim-telescope/telescope-ui-select.nvim.git",
|
||||
version = "6e51d7da30bd139a6950adf2a47fda6df9fa06d2",
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("PackChanged", {
|
||||
desc = "Build telescope-fzf-native.nvim",
|
||||
callback = function(ev)
|
||||
local data = ev.data
|
||||
if
|
||||
data
|
||||
and data.spec
|
||||
and data.spec.name == "telescope-fzf-native.nvim"
|
||||
and (data.kind == "install" or data.kind == "update")
|
||||
and vim.fn.executable("make") == 1
|
||||
then
|
||||
vim.system({ "make" }, { cwd = data.path }):wait()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local fb_actions = telescope.extensions.file_browser.actions
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
n = {
|
||||
["q"] = actions.close,
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown(),
|
||||
},
|
||||
file_browser = {
|
||||
theme = "dropdown",
|
||||
hijack_netrw = false,
|
||||
hidden = true,
|
||||
mappings = {
|
||||
["i"] = {
|
||||
["<C-w>"] = function()
|
||||
vim.cmd("normal vbd")
|
||||
end,
|
||||
["<C-j>"] = function(bufnr)
|
||||
actions.move_selection_next(bufnr)
|
||||
end,
|
||||
["<C-k>"] = function(bufnr)
|
||||
actions.move_selection_previous(bufnr)
|
||||
end,
|
||||
["<C-s>"] = function(bufnr)
|
||||
actions.select_vertical(bufnr)
|
||||
end,
|
||||
},
|
||||
["n"] = {
|
||||
["a"] = fb_actions.create,
|
||||
["h"] = fb_actions.goto_parent_dir,
|
||||
["/"] = function()
|
||||
vim.cmd("startinsert")
|
||||
end,
|
||||
["d"] = fb_actions.remove,
|
||||
["e"] = fb_actions.change_cwd,
|
||||
["<C-s>"] = function(bufnr)
|
||||
actions.select_vertical(bufnr)
|
||||
end,
|
||||
["<C-a>"] = function(bufnr)
|
||||
actions.toggle_all(bufnr)
|
||||
end,
|
||||
["<C-d>"] = function(bufnr)
|
||||
actions.move_selection_next(bufnr)
|
||||
end,
|
||||
["<C-u>"] = function(bufnr)
|
||||
actions.move_selection_previous(bufnr)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
pcall(telescope.load_extension, "file_browser")
|
||||
pcall(telescope.load_extension, "fzf")
|
||||
pcall(telescope.load_extension, "ui-select")
|
||||
47
nvim/lua/treesitter.lua
Normal file
47
nvim/lua/treesitter.lua
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
local treesitter = require("nvim-treesitter")
|
||||
|
||||
treesitter.setup({
|
||||
install_dir = vim.fn.stdpath("data") .. "/site",
|
||||
autotag = {
|
||||
enable = false,
|
||||
enable_close_on_slash = false,
|
||||
},
|
||||
})
|
||||
|
||||
-- Install parsers
|
||||
local ensured_installed = {
|
||||
"go",
|
||||
"gosum",
|
||||
"gomod",
|
||||
"rust",
|
||||
"c",
|
||||
"php",
|
||||
"blade",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"lua",
|
||||
"templ",
|
||||
}
|
||||
local already_installed = treesitter.get_installed()
|
||||
local parsers_to_install = vim.iter(ensured_installed)
|
||||
:filter(function(parser)
|
||||
return not vim.tbl_contains(already_installed, parser)
|
||||
end)
|
||||
:totable()
|
||||
treesitter.install(parsers_to_install)
|
||||
|
||||
-- highlighting and indentation
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
-- Enable treesitter highlighting and disable regex syntax
|
||||
pcall(vim.treesitter.start)
|
||||
-- Enable treesitter-based indentation
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
})
|
||||
|
||||
-- textobjects
|
||||
-- Disable entire built-in ftplugin mappings to avoid conflicts.
|
||||
-- See https://github.com/neovim/neovim/tree/master/runtime/ftplugin for built-in ftplugins.
|
||||
vim.g.no_plugin_maps = true
|
||||
require("nvim-treesitter-textobjects").setup({})
|
||||
181
nvim/nvim-pack-lock.json
Normal file
181
nvim/nvim-pack-lock.json
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
{
|
||||
"plugins": {
|
||||
"Comment.nvim": {
|
||||
"rev": "e30b7f2008e52442154b66f7c519bfd2f1e32acb",
|
||||
"src": "https://github.com/numToStr/Comment.nvim"
|
||||
},
|
||||
"blink.cmp": {
|
||||
"rev": "456d38d1cd3743926f329204c2340f3e7840aad6",
|
||||
"src": "https://github.com/saghen/blink.cmp",
|
||||
"version": "'v1.10.2'"
|
||||
},
|
||||
"catppuccin": {
|
||||
"rev": "426dbebe06b5c69fd846ceb17b42e12f890aedf1",
|
||||
"src": "https://github.com/catppuccin/nvim"
|
||||
},
|
||||
"conform.nvim": {
|
||||
"rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395",
|
||||
"src": "https://github.com/stevearc/conform.nvim.git",
|
||||
"version": "'v9.1.0'"
|
||||
},
|
||||
"fidget.nvim": {
|
||||
"rev": "889e2e96edef4e144965571d46f7a77bcc4d0ddf",
|
||||
"src": "https://github.com/j-hui/fidget.nvim"
|
||||
},
|
||||
"friendly-snippets": {
|
||||
"rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9",
|
||||
"src": "https://github.com/rafamadriz/friendly-snippets"
|
||||
},
|
||||
"gitsigns.nvim": {
|
||||
"rev": "8d82c240f190fc33723d48c308ccc1ed8baad69d",
|
||||
"src": "https://github.com/lewis6991/gitsigns.nvim",
|
||||
"version": "'v2.1.0'"
|
||||
},
|
||||
"kanagawa.nvim": {
|
||||
"rev": "aef7f5cec0a40dbe7f3304214850c472e2264b10",
|
||||
"src": "https://github.com/rebelot/kanagawa.nvim"
|
||||
},
|
||||
"lazydev.nvim": {
|
||||
"rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d",
|
||||
"src": "https://github.com/folke/lazydev.nvim"
|
||||
},
|
||||
"lualine.nvim": {
|
||||
"rev": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c",
|
||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
"luvit-meta": {
|
||||
"rev": "cc9b2d412d2fbd30b94a70cfc214c2a3be27a0a2",
|
||||
"src": "https://github.com/Bilal2453/luvit-meta"
|
||||
},
|
||||
"mason-lspconfig.nvim": {
|
||||
"rev": "0a3b42c3e503df87aef6d6513e13148381495c3a",
|
||||
"src": "https://github.com/williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
"mason-tool-installer.nvim": {
|
||||
"rev": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc",
|
||||
"src": "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim"
|
||||
},
|
||||
"mason.nvim": {
|
||||
"rev": "b03fb0f20bc1d43daf558cda981a2be22e73ac42",
|
||||
"src": "https://github.com/mason-org/mason.nvim"
|
||||
},
|
||||
"mini.icons": {
|
||||
"rev": "7fdae2443a0e2910015ca39ad74b50524ee682d3",
|
||||
"src": "https://github.com/nvim-mini/mini.icons.git"
|
||||
},
|
||||
"mini.indentscope": {
|
||||
"rev": "e0601f75aa5137a5a13bb92a988c9a300f5bd3de",
|
||||
"src": "https://github.com/nvim-mini/mini.indentscope.git",
|
||||
"version": "'v0.17.0'"
|
||||
},
|
||||
"mini.nvim": {
|
||||
"rev": "c67822c53e8e282fe863343e88aa0a8ca3534059",
|
||||
"src": "https://github.com/echasnovski/mini.nvim"
|
||||
},
|
||||
"nvim-autopairs": {
|
||||
"rev": "59bce2eef357189c3305e25bc6dd2d138c1683f5",
|
||||
"src": "https://github.com/windwp/nvim-autopairs"
|
||||
},
|
||||
"nvim-lint": {
|
||||
"rev": "eab58b48eb11d7745c11c505e0f3057165902461",
|
||||
"src": "https://github.com/mfussenegger/nvim-lint"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "3c156abc4f7912f66d8687512d75b939b14fbc42",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "4916d6592ede8c07973490d9322f187e07dfefac",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter.git",
|
||||
"version": "'4916d6592ede8c07973490d9322f187e07dfefac'"
|
||||
},
|
||||
"nvim-treesitter-textobjects": {
|
||||
"rev": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects.git",
|
||||
"version": "'851e865342e5a4cb1ae23d31caf6e991e1c99f1e'"
|
||||
},
|
||||
"nvim-ts-autotag": {
|
||||
"rev": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595",
|
||||
"src": "https://github.com/windwp/nvim-ts-autotag"
|
||||
},
|
||||
"nvim-ts-context-commentstring": {
|
||||
"rev": "6141a40173c6efa98242dc951ed4b6f892c97027",
|
||||
"src": "https://github.com/JoosepAlviste/nvim-ts-context-commentstring"
|
||||
},
|
||||
"nvim-web-devicons": {
|
||||
"rev": "c72328a5494b4502947a022fe69c0c47e53b6aa6",
|
||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
"oil.nvim": {
|
||||
"rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e",
|
||||
"src": "https://github.com/stevearc/oil.nvim.git",
|
||||
"version": "'v2.15.0'"
|
||||
},
|
||||
"onedark.nvim": {
|
||||
"rev": "213c23ae45a04797572242568d5d51937181792d",
|
||||
"src": "https://github.com/navarasu/onedark.nvim"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim.git",
|
||||
"version": "'v0.1.4'"
|
||||
},
|
||||
"render-markdown.nvim": {
|
||||
"rev": "54d4b5431e9634ee3d8d30784e017239b5b89d41",
|
||||
"src": "https://github.com/MeanderingProgrammer/render-markdown.nvim"
|
||||
},
|
||||
"rose-pine": {
|
||||
"rev": "9504524e5ed0e326534698f637f9d038ba4cd0ee",
|
||||
"src": "https://github.com/rose-pine/nvim"
|
||||
},
|
||||
"solarized-osaka.nvim": {
|
||||
"rev": "f0c2f0ba0bd56108d53c9bfae4bb28ff6c67bbdb",
|
||||
"src": "https://github.com/craftzdog/solarized-osaka.nvim"
|
||||
},
|
||||
"telescope-file-browser.nvim": {
|
||||
"rev": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e",
|
||||
"src": "https://github.com/nvim-telescope/telescope-file-browser.nvim.git",
|
||||
"version": "'3610dc7dc91f06aa98b11dca5cc30dfa98626b7e'"
|
||||
},
|
||||
"telescope-fzf-native.nvim": {
|
||||
"rev": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c",
|
||||
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim.git",
|
||||
"version": "'6fea601bd2b694c6f2ae08a6c6fab14930c60e2c'"
|
||||
},
|
||||
"telescope-ui-select.nvim": {
|
||||
"rev": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2",
|
||||
"src": "https://github.com/nvim-telescope/telescope-ui-select.nvim.git",
|
||||
"version": "'6e51d7da30bd139a6950adf2a47fda6df9fa06d2'"
|
||||
},
|
||||
"telescope.nvim": {
|
||||
"rev": "f7c673b8e46e8f233ff581d3624a517d33a7e264",
|
||||
"src": "https://github.com/nvim-telescope/telescope.nvim.git",
|
||||
"version": "'v0.2.2'"
|
||||
},
|
||||
"todo-comments.nvim": {
|
||||
"rev": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668",
|
||||
"src": "https://github.com/folke/todo-comments.nvim"
|
||||
},
|
||||
"toggleterm.nvim": {
|
||||
"rev": "9a88eae817ef395952e08650b3283726786fb5fb",
|
||||
"src": "https://github.com/akinsho/toggleterm.nvim.git",
|
||||
"version": "'v2.13.1'"
|
||||
},
|
||||
"tokyonight.nvim": {
|
||||
"rev": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6",
|
||||
"src": "https://github.com/folke/tokyonight.nvim"
|
||||
},
|
||||
"undotree": {
|
||||
"rev": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d",
|
||||
"src": "https://github.com/mbbill/undotree"
|
||||
},
|
||||
"vim-fugitive": {
|
||||
"rev": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0",
|
||||
"src": "https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
"which-key.nvim": {
|
||||
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
|
||||
"src": "https://github.com/folke/which-key.nvim"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue