[nvim] Switch from Mason to Chezmoi
This commit is contained in:
@@ -7,11 +7,13 @@ packages:
|
||||
- btop
|
||||
- bitwarden-cli
|
||||
- curl
|
||||
- dotnet-sdk
|
||||
- eza
|
||||
- fzf
|
||||
- git
|
||||
- lazygit
|
||||
- paru
|
||||
- npm
|
||||
- ripgrep
|
||||
- tmux
|
||||
- wget
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[".local/share/lua-language-server"]
|
||||
type = "archive"
|
||||
url = "https://github.com/LuaLS/lua-language-server/releases/download/3.18.2/lua-language-server-3.18.2-linux-x64.tar.gz"
|
||||
exact = true
|
||||
|
||||
[".local/share/netcoredbg"]
|
||||
type = "archive"
|
||||
url = "https://github.com/Samsung/netcoredbg/releases/download/3.1.3-1062/netcoredbg-linux-amd64.tar.gz"
|
||||
exact = true
|
||||
stripComponents = 1
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
{{ if -eq .chezmoi.osRelease.id "nixos" }}
|
||||
{{ if eq .chezmoi.osRelease.id "nixos" }}
|
||||
exit 0
|
||||
{{ end }}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
{{ if -eq .chezmoi.osRelease.id "nixos" }}
|
||||
{{ if eq .chezmoi.osRelease.id "nixos" }}
|
||||
exit 0
|
||||
{{ end }}
|
||||
|
||||
|
||||
+10
-6
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
{{ if -eq .chezmoi.osRelease.id "nixos" }}
|
||||
{{ if eq .chezmoi.osRelease.id "nixos" }}
|
||||
exit 0
|
||||
{{ end }}
|
||||
|
||||
@@ -12,22 +12,26 @@ sudo pacman -Sy --noconfirm
|
||||
|
||||
pkgs=()
|
||||
{{ range .packages.arch }}
|
||||
if ! pacman -Q "{{ . }}" &>/dev/null; then
|
||||
pkgs+=("{{ . }}")
|
||||
fi
|
||||
{{ end }}
|
||||
|
||||
if [[ ${#pkgs[@]} -gt 0 ]]; then
|
||||
echo "Installing pacman packages"
|
||||
sudo pacman -S --noconfirm "${pkgs[@]}"
|
||||
sudo pacman -S --noconfirm --needed "${pkgs[@]}"
|
||||
fi
|
||||
|
||||
pkgs=()
|
||||
aur_pkgs=()
|
||||
{{ range .packages.aur }}
|
||||
pkgs+=("{{ . }}")
|
||||
if ! pacman -Q "{{ . }}" &>/dev/null; then
|
||||
aur_pkgs+=("{{ . }}")
|
||||
fi
|
||||
{{ end }}
|
||||
|
||||
if [[ ${#pkgs[@]} -gt 0 ]]; then
|
||||
if [[ ${#aur_pkgs[@]} -gt 0 ]]; then
|
||||
echo "Installing AUR packages"
|
||||
paru -S --noconfirm "${pkgs[@]}"
|
||||
paru -S --noconfirm --needed "${aur_pkgs[@]}"
|
||||
fi
|
||||
|
||||
{{ end }}
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
{{ if eq .chezmoi.osRelease.id "nixos" }}
|
||||
exit 0
|
||||
{{ end }}
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "Installing LSPs for Neovim..."
|
||||
|
||||
npm install -g --prefix ~/.local \
|
||||
@vtsls/language-server \
|
||||
@vue/language-server \
|
||||
vscode-langservers-extracted
|
||||
|
||||
dotnet tool install -g roslyn-language-server --prerelease
|
||||
dotnet tool install -g csharpier
|
||||
|
||||
echo "Done"
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
{{ if -eq .chezmoi.osRelease.id "nixos" }}
|
||||
exit 0
|
||||
{{ if eq .chezmoi.osRelease.id "nixos" }}
|
||||
exit 0
|
||||
{{ end }}
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
exit
|
||||
q
|
||||
@@ -5,27 +5,12 @@ require("config.keymaps")
|
||||
require("config.lazy")
|
||||
require("config.theme") -- ignored by git
|
||||
|
||||
vim.lsp.config("roslyn", require("config.lsp.roslyn"))
|
||||
require("config.lsp")
|
||||
|
||||
vim.lsp.enable({ "nixd" }) -- installed locally
|
||||
|
||||
-- Set custom breakpoint style
|
||||
vim.fn.sign_define('DapBreakpoint', {
|
||||
text = '⚪',
|
||||
texthl = 'DapBreakpointSymbol',
|
||||
linehl = 'DapBreakpoint',
|
||||
numhl = 'DapBreakpoint'
|
||||
})
|
||||
vim.fn.sign_define('DapStopped', {
|
||||
text = '🔴',
|
||||
texthl = 'yellow',
|
||||
linehl = 'DapBreakpoint',
|
||||
numhl = 'DapBreakpoint'
|
||||
})
|
||||
vim.fn.sign_define('DapBreakpointRejected', {
|
||||
text = '⭕',
|
||||
texthl = 'DapStoppedSymbol',
|
||||
linehl = 'DapBreakpoint',
|
||||
numhl = 'DapBreakpoint'
|
||||
vim.lsp.enable({
|
||||
"lua_ls",
|
||||
"html",
|
||||
"roslyn_ls",
|
||||
})
|
||||
|
||||
require("config.diagnostics")
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
return {
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
local vue_language_server_path = vim.fn.expand "$MASON/packages" .. "/vue-language-server" .. "/node_modules/@vue/language-server"
|
||||
|
||||
return {
|
||||
cmd = { "vtsls", "--stdio" },
|
||||
init_options = {
|
||||
hostInfo = "neovim",
|
||||
},
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
},
|
||||
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,
|
||||
settings = {
|
||||
vtsls = {
|
||||
tsserver = {
|
||||
globalPlugins = {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = vue_language_server_path,
|
||||
languages = { "vue" },
|
||||
configNamespace = "typescript",
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
vim.fn.sign_define('DapBreakpoint', {
|
||||
text = '⚪',
|
||||
texthl = 'DapBreakpointSymbol',
|
||||
linehl = 'DapBreakpoint',
|
||||
numhl = 'DapBreakpoint'
|
||||
})
|
||||
vim.fn.sign_define('DapStopped', {
|
||||
text = '🔴',
|
||||
texthl = 'yellow',
|
||||
linehl = 'DapBreakpoint',
|
||||
numhl = 'DapBreakpoint'
|
||||
})
|
||||
vim.fn.sign_define('DapBreakpointRejected', {
|
||||
text = '⭕',
|
||||
texthl = 'DapStoppedSymbol',
|
||||
linehl = 'DapBreakpoint',
|
||||
numhl = 'DapBreakpoint'
|
||||
})
|
||||
@@ -0,0 +1,6 @@
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
vim.lsp.config("html", {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
@@ -4,10 +4,9 @@ return {
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local utils = require("dap-dll-autopicker")
|
||||
local mason_path = vim.fn.stdpath("data") .. "/mason/packages/netcoredbg/netcoredbg"
|
||||
local netcoredbg_adapter = {
|
||||
type = "executable",
|
||||
command = mason_path,
|
||||
command = "netcoredbg",
|
||||
args = { "--interpreter=vscode" },
|
||||
}
|
||||
dap.adapters.netcoredbg = netcoredbg_adapter
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
dependencies = { "neovim/nvim-lspconfig", },
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"docker_compose_language_service",
|
||||
"lua_ls",
|
||||
"html",
|
||||
-- "roslyn", install with :MasonInstall
|
||||
"vtsls",
|
||||
"vue_ls",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
dependencies = { "neovim/nvim-lspconfig", },
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"coreclr",
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = { "mason-org/mason.nvim", }
|
||||
},
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
opts = {
|
||||
registries = {
|
||||
"github:mason-org/mason-registry",
|
||||
"github:Crashdummyy/mason-registry",
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig"
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
return {
|
||||
"seblyng/roslyn.nvim",
|
||||
---@module 'roslyn.config'
|
||||
---@type RoslynNvimConfig
|
||||
opts = {},
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{{ .chezmoi.homeDir }}/.local/share/lua-language-server/bin/lua-language-server
|
||||
@@ -0,0 +1 @@
|
||||
{{ .chezmoi.homeDir }}/.local/share/netcoredbg/netcoredbg
|
||||
Reference in New Issue
Block a user