aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/nvim.sh
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2025-05-19 07:56:31 +0200
committerGitHub <noreply@github.com>2025-05-19 07:56:31 +0200
commit1d6730459c42f591602500da994f01ae43a97dbc (patch)
treec78417dd383456d2ef8a00600375534d17a9cd45 /scripts/nvim.sh
parentchore: fix references to williamboman/mason.nvim (#542) (diff)
downloadmason-lspconfig-1d6730459c42f591602500da994f01ae43a97dbc.tar
mason-lspconfig-1d6730459c42f591602500da994f01ae43a97dbc.tar.gz
mason-lspconfig-1d6730459c42f591602500da994f01ae43a97dbc.tar.bz2
mason-lspconfig-1d6730459c42f591602500da994f01ae43a97dbc.tar.lz
mason-lspconfig-1d6730459c42f591602500da994f01ae43a97dbc.tar.xz
mason-lspconfig-1d6730459c42f591602500da994f01ae43a97dbc.tar.zst
mason-lspconfig-1d6730459c42f591602500da994f01ae43a97dbc.zip
perf: host pre-compiled filetype mappings (#555)
Generating the filetype mappings by accessing `vim.lsp.config` turns out to be a bad idea because: 1) performance 2) some `lsp/` configurations in nvim-lspconfig execute code immediately (see angularls) 3) accessing `vim.lsp.config[server_name]` seems to populate `:checkhealth vim.lsp`
Diffstat (limited to 'scripts/nvim.sh')
-rwxr-xr-xscripts/nvim.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/nvim.sh b/scripts/nvim.sh
new file mode 100755
index 0000000..c2dcb6b
--- /dev/null
+++ b/scripts/nvim.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+set -exuo pipefail
+
+declare -x DEPENDENCIES="${PWD}/dependencies"
+declare -x MASON_DIR="$PWD"
+declare -x MASON_SCRIPT_DIR="${PWD}/scripts"
+
+nvim -u NONE -E -R --headless \
+ --cmd "set rtp^=${MASON_SCRIPT_DIR},${MASON_DIR}" \
+ --cmd "set packpath^=${DEPENDENCIES}" \
+ --cmd "packloadall" \
+ --cmd "luafile $1" \
+ --cmd "q"