From 07d294425a98ee5d1e22d03e2b24ae2c76e487c0 Mon Sep 17 00:00:00 2001
From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>
Date: Sat, 23 Aug 2025 12:42:37 +0900
Subject: updates
---
mac/.config/LunarVim/utils/bin/jdtls | 62 +++
mac/.config/LunarVim/utils/bin/lvim.ps1 | 13 +
mac/.config/LunarVim/utils/bin/lvim.template | 11 +
.../LunarVim/utils/ci/generate_new_lockfile.lua | 125 ++++++
.../LunarVim/utils/ci/generate_new_lockfile.sh | 19 +
mac/.config/LunarVim/utils/ci/run_commitlint.sh | 10 +
mac/.config/LunarVim/utils/ci/run_test.sh | 25 ++
mac/.config/LunarVim/utils/ci/update_changelog.sh | 15 +
mac/.config/LunarVim/utils/ci/verify_plugins.lua | 147 +++++++
mac/.config/LunarVim/utils/ci/verify_plugins.sh | 10 +
mac/.config/LunarVim/utils/desktop/16x16/lvim.svg | 10 +
mac/.config/LunarVim/utils/desktop/22x22/lvim.svg | 16 +
mac/.config/LunarVim/utils/desktop/24x24/lvim.svg | 16 +
mac/.config/LunarVim/utils/desktop/32x32/lvim.svg | 16 +
mac/.config/LunarVim/utils/desktop/48x48/lvim.svg | 16 +
mac/.config/LunarVim/utils/desktop/64x64/lvim.svg | 16 +
mac/.config/LunarVim/utils/desktop/lvim.desktop | 13 +
mac/.config/LunarVim/utils/docker/Dockerfile.local | 27 ++
.../LunarVim/utils/docker/Dockerfile.remote | 27 ++
.../LunarVim/utils/installer/config.example.lua | 5 +
.../utils/installer/config_win.example.lua | 27 ++
.../utils/installer/install-neovim-from-release | 83 ++++
mac/.config/LunarVim/utils/installer/install.ps1 | 305 ++++++++++++++
mac/.config/LunarVim/utils/installer/install.sh | 461 +++++++++++++++++++++
.../LunarVim/utils/installer/install_bin.sh | 40 ++
.../LunarVim/utils/installer/install_stylua.sh | 63 +++
mac/.config/LunarVim/utils/installer/uninstall.ps1 | 63 +++
mac/.config/LunarVim/utils/installer/uninstall.sh | 89 ++++
28 files changed, 1730 insertions(+)
create mode 100755 mac/.config/LunarVim/utils/bin/jdtls
create mode 100644 mac/.config/LunarVim/utils/bin/lvim.ps1
create mode 100644 mac/.config/LunarVim/utils/bin/lvim.template
create mode 100644 mac/.config/LunarVim/utils/ci/generate_new_lockfile.lua
create mode 100644 mac/.config/LunarVim/utils/ci/generate_new_lockfile.sh
create mode 100644 mac/.config/LunarVim/utils/ci/run_commitlint.sh
create mode 100644 mac/.config/LunarVim/utils/ci/run_test.sh
create mode 100644 mac/.config/LunarVim/utils/ci/update_changelog.sh
create mode 100644 mac/.config/LunarVim/utils/ci/verify_plugins.lua
create mode 100644 mac/.config/LunarVim/utils/ci/verify_plugins.sh
create mode 100644 mac/.config/LunarVim/utils/desktop/16x16/lvim.svg
create mode 100644 mac/.config/LunarVim/utils/desktop/22x22/lvim.svg
create mode 100644 mac/.config/LunarVim/utils/desktop/24x24/lvim.svg
create mode 100644 mac/.config/LunarVim/utils/desktop/32x32/lvim.svg
create mode 100644 mac/.config/LunarVim/utils/desktop/48x48/lvim.svg
create mode 100644 mac/.config/LunarVim/utils/desktop/64x64/lvim.svg
create mode 100644 mac/.config/LunarVim/utils/desktop/lvim.desktop
create mode 100644 mac/.config/LunarVim/utils/docker/Dockerfile.local
create mode 100644 mac/.config/LunarVim/utils/docker/Dockerfile.remote
create mode 100644 mac/.config/LunarVim/utils/installer/config.example.lua
create mode 100644 mac/.config/LunarVim/utils/installer/config_win.example.lua
create mode 100755 mac/.config/LunarVim/utils/installer/install-neovim-from-release
create mode 100644 mac/.config/LunarVim/utils/installer/install.ps1
create mode 100755 mac/.config/LunarVim/utils/installer/install.sh
create mode 100755 mac/.config/LunarVim/utils/installer/install_bin.sh
create mode 100755 mac/.config/LunarVim/utils/installer/install_stylua.sh
create mode 100644 mac/.config/LunarVim/utils/installer/uninstall.ps1
create mode 100755 mac/.config/LunarVim/utils/installer/uninstall.sh
(limited to 'mac/.config/LunarVim/utils')
diff --git a/mac/.config/LunarVim/utils/bin/jdtls b/mac/.config/LunarVim/utils/bin/jdtls
new file mode 100755
index 0000000..a882158
--- /dev/null
+++ b/mac/.config/LunarVim/utils/bin/jdtls
@@ -0,0 +1,62 @@
+#!/usr/bin/env bash
+
+# NOTE:
+# This doesn't work as is on Windows. You'll need to create an equivalent `.bat` file instead
+#
+# NOTE:
+# If you're not using Linux you'll need to adjust the `-configuration` option
+# to point to the `config_mac' or `config_win` folders depending on your system.
+
+case Darwin in
+Linux)
+ CONFIG="$HOME/.local/share/nvim/lsp_servers/jdtls/config_linux"
+ ;;
+Darwin)
+ CONFIG="$HOME/.local/share/nvim/lsp_servers/jdtls/config_mac"
+ ;;
+esac
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ]; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ]; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ]; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# JAR="$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar"
+JAR="$HOME/.local/share/nvim/lsp_servers/jdtls/plugins/org.eclipse.equinox.launcher_*.jar"
+GRADLE_HOME=$HOME/gradle "$JAVACMD" \
+ -Declipse.application=org.eclipse.jdt.ls.core.id1 \
+ -Dosgi.bundles.defaultStartLevel=4 \
+ -Declipse.product=org.eclipse.jdt.ls.core.product \
+ -Dlog.protocol=true \
+ -Dlog.level=ALL \
+ -javaagent:$HOME/.local/share/nvim/lsp_servers/jdtls/lombok.jar \
+ -Xms1g \
+ -Xmx2G \
+ -jar $(echo "$JAR") \
+ -configuration "$CONFIG" \
+ -data "${1:-$HOME/workspace}" \
+ --add-modules=ALL-SYSTEM \
+ --add-opens java.base/java.util=ALL-UNNAMED \
+ --add-opens java.base/java.lang=ALL-UNNAMED
+
+# for older java versions if you wanna use lombok
+# -Xbootclasspath/a:/usr/local/share/lombok/lombok.jar \
+
+# -javaagent:/usr/local/share/lombok/lombok.jar \
diff --git a/mac/.config/LunarVim/utils/bin/lvim.ps1 b/mac/.config/LunarVim/utils/bin/lvim.ps1
new file mode 100644
index 0000000..3ec8125
--- /dev/null
+++ b/mac/.config/LunarVim/utils/bin/lvim.ps1
@@ -0,0 +1,13 @@
+#Requires -Version 7.1
+$ErrorActionPreference = "Stop" # exit when command fails
+
+$env:XDG_DATA_HOME = $env:XDG_DATA_HOME ?? $env:APPDATA
+$env:XDG_CONFIG_HOME = $env:XDG_CONFIG_HOME ?? $env:LOCALAPPDATA
+$env:XDG_CACHE_HOME = $env:XDG_CACHE_HOME ?? $env:TEMP
+
+$env:LUNARVIM_RUNTIME_DIR = $env:LUNARVIM_RUNTIME_DIR ?? "$env:XDG_DATA_HOME\lunarvim"
+$env:LUNARVIM_CONFIG_DIR = $env:LUNARVIM_CONFIG_DIR ?? "$env:XDG_CONFIG_HOME\lvim"
+$env:LUNARVIM_CACHE_DIR = $env:LUNARVIM_CACHE_DIR ?? "$env:XDG_CACHE_HOME\lvim"
+$env:LUNARVIM_BASE_DIR = $env:LUNARVIM_BASE_DIR ?? "$env:LUNARVIM_RUNTIME_DIR\lvim"
+
+nvim -u "$env:LUNARVIM_BASE_DIR\init.lua" @args
diff --git a/mac/.config/LunarVim/utils/bin/lvim.template b/mac/.config/LunarVim/utils/bin/lvim.template
new file mode 100644
index 0000000..4c04b9f
--- /dev/null
+++ b/mac/.config/LunarVim/utils/bin/lvim.template
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+export NVIM_APPNAME="${NVIM_APPNAME:-NVIM_APPNAME_VAR}"
+
+export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-RUNTIME_DIR_VAR}"
+export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-CONFIG_DIR_VAR}"
+export LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-CACHE_DIR_VAR}"
+
+export LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-BASE_DIR_VAR}"
+
+exec -a "$NVIM_APPNAME" nvim -u "$LUNARVIM_BASE_DIR/init.lua" "$@"
diff --git a/mac/.config/LunarVim/utils/ci/generate_new_lockfile.lua b/mac/.config/LunarVim/utils/ci/generate_new_lockfile.lua
new file mode 100644
index 0000000..2677b20
--- /dev/null
+++ b/mac/.config/LunarVim/utils/ci/generate_new_lockfile.lua
@@ -0,0 +1,125 @@
+local sp = os.getenv "SNAPSHOT_PATH"
+
+local function call_proc(process, opts, cb)
+ local output, error_output = "", ""
+ local handle_stdout = function(err, chunk)
+ assert(not err, err)
+ if chunk then
+ output = output .. chunk
+ end
+ end
+
+ local handle_stderr = function(err, chunk)
+ assert(not err, err)
+ if chunk then
+ error_output = error_output .. chunk
+ end
+ end
+
+ local uv = vim.loop
+ local handle
+
+ local stdout = uv.new_pipe(false)
+ local stderr = uv.new_pipe(false)
+
+ local stdio = { nil, stdout, stderr }
+
+ handle = uv.spawn(
+ process,
+ { args = opts.args, cwd = opts.cwd or uv.cwd(), stdio = stdio },
+ vim.schedule_wrap(function(code)
+ if code ~= 0 then
+ stdout:read_stop()
+ stderr:read_stop()
+ end
+
+ local check = uv.new_check()
+ check:start(function()
+ for _, pipe in ipairs(stdio) do
+ if pipe and not pipe:is_closing() then
+ return
+ end
+ end
+ check:stop()
+ handle:close()
+ cb(code, output, error_output)
+ end)
+ end)
+ )
+
+ uv.read_start(stdout, handle_stdout)
+ uv.read_start(stderr, handle_stderr)
+
+ return handle
+end
+
+local plugins_list = {}
+
+local completed = 0
+
+local function write_lockfile(verbose)
+ local default_plugins = {}
+ local active_jobs = {}
+
+ local core_plugins = require "lvim.plugins"
+ for _, plugin in pairs(core_plugins) do
+ local name = plugin[1]:match "/(%S*)"
+ local url = "https://github.com/" .. plugin[1]
+ local commit = ""
+ table.insert(default_plugins, {
+ name = name,
+ url = url,
+ commit = commit,
+ branch = plugin.branch or "HEAD",
+ tag = plugin.tag,
+ })
+ end
+
+ table.sort(default_plugins, function(a, b)
+ return a.name < b.name
+ end)
+
+ for _, entry in pairs(default_plugins) do
+ local on_done = function(success, result, errors)
+ completed = completed + 1
+ if not success then
+ print("error: " .. errors)
+ return
+ end
+ local latest_sha = result:gsub("\tHEAD\n", ""):sub(1, 7)
+ if entry.tag then
+ local dereferenced_commit = result:match("\n(.*)\trefs/tags/" .. entry.tag .. "%^{}\n")
+ if dereferenced_commit then
+ latest_sha = dereferenced_commit:sub(1, 7)
+ end
+ end
+ plugins_list[entry.name] = {
+ commit = latest_sha,
+ }
+ end
+
+ local handle = call_proc("git", {
+ args = { "ls-remote", entry.url, entry.tag and entry.tag .. "*" or entry.branch },
+ }, on_done)
+ assert(handle)
+ table.insert(active_jobs, handle)
+ end
+
+ print("active: " .. #active_jobs)
+ print("plugins: " .. #default_plugins)
+
+ vim.wait(#active_jobs * 60 * 1000, function()
+ return completed == #active_jobs
+ end)
+
+ if verbose then
+ print(vim.inspect(plugins_list))
+ end
+
+ local fd = assert(io.open(sp, "w"))
+ fd:write(vim.json.encode(plugins_list), "\n")
+ fd:flush()
+end
+
+write_lockfile()
+vim.cmd "q"
diff --git a/mac/.config/LunarVim/utils/ci/generate_new_lockfile.sh b/mac/.config/LunarVim/utils/ci/generate_new_lockfile.sh
new file mode 100644
index 0000000..ebd71b3
--- /dev/null
+++ b/mac/.config/LunarVim/utils/ci/generate_new_lockfile.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+set -e
+
+REPO_DIR=$(git rev-parse --show-toplevel)
+
+export SNAPSHOT_NAME="default.json"
+export SNAPSHOT_DIR="${REPO_DIR}/snapshots"
+
+mkdir -p "${SNAPSHOT_DIR}"
+
+export SNAPSHOT_PATH="${REPO_DIR}/snapshots/${SNAPSHOT_NAME}"
+
+time lvim --headless \
+ -c "source ./utils/ci/generate_new_lockfile.lua"
+
+temp=$(mktemp)
+
+jq --sort-keys . "${SNAPSHOT_PATH}" >"${temp}"
+mv "${temp}" "${SNAPSHOT_PATH}"
diff --git a/mac/.config/LunarVim/utils/ci/run_commitlint.sh b/mac/.config/LunarVim/utils/ci/run_commitlint.sh
new file mode 100644
index 0000000..b752956
--- /dev/null
+++ b/mac/.config/LunarVim/utils/ci/run_commitlint.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+set -eo pipefail
+
+REPO_DIR="$(git rev-parse --show-toplevel)"
+HELP_URL="https://github.com/LunarVim/LunarVim/blob/rolling/CONTRIBUTING.md#commit-messages"
+CONFIG="$REPO_DIR/.github/workflows/commitlint.config.js"
+
+if ! npx commitlint --edit --verbose --help-url "$HELP_URL" --config "$CONFIG"; then
+ exit 1
+fi
diff --git a/mac/.config/LunarVim/utils/ci/run_test.sh b/mac/.config/LunarVim/utils/ci/run_test.sh
new file mode 100644
index 0000000..3e1bcf1
--- /dev/null
+++ b/mac/.config/LunarVim/utils/ci/run_test.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+set -e
+
+export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$HOME/.local/share/lunarvim"}"
+export LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$LUNARVIM_RUNTIME_DIR/lvim"}"
+
+export LVIM_TEST_ENV=true
+
+# we should start with an empty configuration
+LUNARVIM_CONFIG_DIR="$(mktemp -d)"
+LUNARVIM_CACHE_DIR="$(mktemp -d)"
+
+export LUNARVIM_CONFIG_DIR LUNARVIM_CACHE_DIR
+
+printf "cache_dir: %s\nconfig_dir: %s\n" "$LUNARVIM_CACHE_DIR" "$LUNARVIM_CONFIG_DIR"
+
+lvim() {
+ nvim -u "$LUNARVIM_BASE_DIR/tests/minimal_init.lua" --cmd "set runtimepath+=$LUNARVIM_BASE_DIR" "$@"
+}
+
+if [ -n "$1" ]; then
+ lvim --headless -c "lua require('plenary.busted').run('$1')"
+else
+ lvim --headless -c "PlenaryBustedDirectory tests/specs { minimal_init = './tests/minimal_init.lua' }"
+fi
diff --git a/mac/.config/LunarVim/utils/ci/update_changelog.sh b/mac/.config/LunarVim/utils/ci/update_changelog.sh
new file mode 100644
index 0000000..49dae53
--- /dev/null
+++ b/mac/.config/LunarVim/utils/ci/update_changelog.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+set -eo pipefail
+
+BRANCH="$(git rev-parse --abbrev-ref HEAD)"
+
+if [ "$BRANCH" != "master" ]; then
+ exit 0
+fi
+
+REPO_DIR="$(git rev-parse --show-toplevel)"
+LATEST_TAG="$(git describe --tags --abbrev=0)"
+CONFIG_FILE="$REPO_DIR/.github/workflows/cliff.toml"
+CHANGELOG="$REPO_DIR/CHANGELOG.md"
+
+git -C "$REPO_DIR" cliff "$LATEST_TAG"..HEAD -u -c "$CONFIG_FILE" -p "$CHANGELOG"
diff --git a/mac/.config/LunarVim/utils/ci/verify_plugins.lua b/mac/.config/LunarVim/utils/ci/verify_plugins.lua
new file mode 100644
index 0000000..95d98a1
--- /dev/null
+++ b/mac/.config/LunarVim/utils/ci/verify_plugins.lua
@@ -0,0 +1,147 @@
+local completed = 0
+local collection = {}
+local active_jobs = {}
+
+local fmt = string.format
+local core_plugins = require "lvim.plugins"
+
+local default_snapshot_path = join_paths(get_lvim_base_dir(), "snapshots", "default.json")
+local fd = io.open(default_snapshot_path, "rb")
+local content
+if fd then
+ content = fd:read "*a"
+end
+local default_sha1 = vim.json.decode(content)
+
+local get_short_name = function(spec)
+ return spec[1]:match "/(%S*)"
+end
+
+local get_default_sha1 = function(spec)
+ local short_name, _ = get_short_name(spec)
+ assert(default_sha1[short_name])
+ return default_sha1[short_name].commit
+end
+
+local is_directory = require("lvim.utils").is_directory
+local lazydir = join_paths(get_runtime_dir(), "site", "pack", "lazy")
+
+local verify_lazy = function()
+ if not is_directory(lazydir) then
+ io.write "Lazy.nvim not installed!"
+ os.exit(1)
+ end
+ local status_ok, lazy = pcall(require, "lazy")
+ if status_ok and lazy then
+ return
+ end
+ io.write "Lazy.nvim not installed!"
+ os.exit(1)
+end
+
+local get_install_path = function(spec)
+ local prefix = join_paths(lazydir, "opt")
+ local path = join_paths(prefix, get_short_name(spec))
+ return is_directory(path) and path
+end
+
+local function call_proc(process, opts, cb)
+ local output, error_output = "", ""
+ local handle_stdout = function(err, chunk)
+ assert(not err, err)
+ if chunk then
+ output = output .. chunk
+ end
+ end
+
+ local handle_stderr = function(err, chunk)
+ assert(not err, err)
+ if chunk then
+ error_output = error_output .. chunk
+ end
+ end
+
+ local uv = vim.loop
+ local handle
+
+ local stdout = uv.new_pipe(false)
+ local stderr = uv.new_pipe(false)
+
+ local stdio = { nil, stdout, stderr }
+
+ handle = uv.spawn(
+ process,
+ { args = opts.args, cwd = opts.cwd or uv.cwd(), stdio = stdio },
+ vim.schedule_wrap(function(code)
+ if code ~= 0 then
+ ---@diagnostic disable-next-line: undefined-field
+ stdout:read_stop()
+ ---@diagnostic disable-next-line: undefined-field
+ stderr:read_stop()
+ end
+
+ local check = uv.new_check()
+ check:start(function()
+ for _, pipe in ipairs(stdio) do
+ if pipe and not pipe:is_closing() then
+ return
+ end
+ end
+ check:stop()
+ handle:close()
+ cb(code, output, error_output)
+ end)
+ end)
+ )
+
+ uv.read_start(stdout, handle_stdout)
+ uv.read_start(stderr, handle_stderr)
+
+ return handle
+end
+
+local function verify_core_plugins(verbose)
+ for _, spec in pairs(core_plugins) do
+ local path = get_install_path(spec)
+ if spec.enabled or spec.enabled == nil and path then
+ table.insert(collection, {
+ name = get_short_name(spec),
+ commit = get_default_sha1(spec),
+ path = path,
+ })
+ end
+ end
+
+ for _, entry in pairs(collection) do
+ local on_done = function(code, result, errors)
+ completed = completed + 1
+ if code ~= 0 then
+ io.write(errors .. "\n")
+ -- os.exit(code)
+ else
+ if verbose then
+ io.write(fmt("verified [%s]\n", entry.name))
+ end
+ end
+ local current_commit = result:gsub("\n", ""):gsub([[']], [[]]):sub(1, 7)
+ -- just in case there are some extra qutoes or it's a longer commit hash
+ if current_commit ~= entry.commit then
+ io.write(fmt("mismatch at [%s]: expected [%s], got [%s]\n", entry.name, entry.commit, current_commit))
+ os.exit(1)
+ end
+ end
+
+ local handle = call_proc("git", { args = { "rev-parse", "--short", "HEAD" }, cwd = entry.path }, on_done)
+ assert(handle)
+ table.insert(active_jobs, handle)
+ end
+
+ vim.wait(#active_jobs * 60 * 1000, function()
+ ---@diagnostic disable-next-line: redundant-return-value
+ return completed == #active_jobs
+ end)
+end
+
+verify_lazy()
+verify_core_plugins()
+vim.cmd "q"
diff --git a/mac/.config/LunarVim/utils/ci/verify_plugins.sh b/mac/.config/LunarVim/utils/ci/verify_plugins.sh
new file mode 100644
index 0000000..48ed12f
--- /dev/null
+++ b/mac/.config/LunarVim/utils/ci/verify_plugins.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+set -e
+
+BASEDIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
+BASEDIR="$(dirname -- "$(dirname -- "$BASEDIR")")"
+
+LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$BASEDIR"}"
+
+lvim --headless \
+ -c "luafile ${LUNARVIM_BASE_DIR}/utils/ci/verify_plugins.lua"
diff --git a/mac/.config/LunarVim/utils/desktop/16x16/lvim.svg b/mac/.config/LunarVim/utils/desktop/16x16/lvim.svg
new file mode 100644
index 0000000..6898fd0
--- /dev/null
+++ b/mac/.config/LunarVim/utils/desktop/16x16/lvim.svg
@@ -0,0 +1,10 @@
+
diff --git a/mac/.config/LunarVim/utils/desktop/22x22/lvim.svg b/mac/.config/LunarVim/utils/desktop/22x22/lvim.svg
new file mode 100644
index 0000000..06f24f5
--- /dev/null
+++ b/mac/.config/LunarVim/utils/desktop/22x22/lvim.svg
@@ -0,0 +1,16 @@
+
diff --git a/mac/.config/LunarVim/utils/desktop/24x24/lvim.svg b/mac/.config/LunarVim/utils/desktop/24x24/lvim.svg
new file mode 100644
index 0000000..456298d
--- /dev/null
+++ b/mac/.config/LunarVim/utils/desktop/24x24/lvim.svg
@@ -0,0 +1,16 @@
+
diff --git a/mac/.config/LunarVim/utils/desktop/32x32/lvim.svg b/mac/.config/LunarVim/utils/desktop/32x32/lvim.svg
new file mode 100644
index 0000000..13e53c2
--- /dev/null
+++ b/mac/.config/LunarVim/utils/desktop/32x32/lvim.svg
@@ -0,0 +1,16 @@
+
diff --git a/mac/.config/LunarVim/utils/desktop/48x48/lvim.svg b/mac/.config/LunarVim/utils/desktop/48x48/lvim.svg
new file mode 100644
index 0000000..35baac2
--- /dev/null
+++ b/mac/.config/LunarVim/utils/desktop/48x48/lvim.svg
@@ -0,0 +1,16 @@
+
diff --git a/mac/.config/LunarVim/utils/desktop/64x64/lvim.svg b/mac/.config/LunarVim/utils/desktop/64x64/lvim.svg
new file mode 100644
index 0000000..fd2a964
--- /dev/null
+++ b/mac/.config/LunarVim/utils/desktop/64x64/lvim.svg
@@ -0,0 +1,16 @@
+
diff --git a/mac/.config/LunarVim/utils/desktop/lvim.desktop b/mac/.config/LunarVim/utils/desktop/lvim.desktop
new file mode 100644
index 0000000..cb4cb47
--- /dev/null
+++ b/mac/.config/LunarVim/utils/desktop/lvim.desktop
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Name=LunarVim
+GenericName=Text Editor
+Comment=An IDE layer for Neovim with sane defaults. Completely free and community driven.
+TryExec=lvim
+Exec=lvim %F
+Terminal=true
+Type=Application
+Keywords=Text;editor;
+Icon=lvim
+Categories=Utility;TextEditor;
+StartupNotify=false
+MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
diff --git a/mac/.config/LunarVim/utils/docker/Dockerfile.local b/mac/.config/LunarVim/utils/docker/Dockerfile.local
new file mode 100644
index 0000000..ed4a67f
--- /dev/null
+++ b/mac/.config/LunarVim/utils/docker/Dockerfile.local
@@ -0,0 +1,27 @@
+# To run this file execute:
+# docker build -f -t Lunarvim:local
+
+FROM ubuntu:latest
+
+# Set environment correctly
+ENV DEBIAN_FRONTEND=noninteractive
+ENV PATH="/root/.local/bin:/root/.cargo/bin:/root/.npm-global/bin${PATH}"
+
+# Copy in local directory
+COPY --chown=root:root . /LunarVim
+
+# Install dependencies and LunarVim
+RUN apt update && \
+ apt -y install sudo curl build-essential git fzf python3-dev python3-pip cargo && \
+ curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
+ apt update && \
+ apt -y install nodejs && \
+ apt clean && rm -rf /var/lib/apt/lists/* /tmp/* && \
+ /LunarVim/utils/installer/install-neovim-from-release && \
+ /LunarVim/utils/installer/install.sh --local --no-install-dependencies
+
+# Setup LVIM to run on startup
+ENTRYPOINT ["/bin/bash"]
+CMD ["lvim"]
+
+# vim: ft=dockerfile:
diff --git a/mac/.config/LunarVim/utils/docker/Dockerfile.remote b/mac/.config/LunarVim/utils/docker/Dockerfile.remote
new file mode 100644
index 0000000..e6f811e
--- /dev/null
+++ b/mac/.config/LunarVim/utils/docker/Dockerfile.remote
@@ -0,0 +1,27 @@
+# To run this file execute:
+# docker build -f Dockerfile.remote . -t Lunarvim:remote
+
+FROM ubuntu:latest
+
+# Build argument to point to correct branch on GitHub
+ARG LV_BRANCH=release-1.2/neovim-0.8
+
+# Set environment correctly
+ENV DEBIAN_FRONTEND=noninteractive
+ENV PATH="/root/.local/bin:/root/.cargo/bin:/root/.npm-global/bin${PATH}"
+
+# Install dependencies and LunarVim
+RUN apt update && \
+ apt -y install sudo curl build-essential git fzf python3-dev python3-pip cargo && \
+ curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
+ apt update && \
+ apt -y install nodejs && \
+ apt clean && rm -rf /var/lib/apt/lists/* /tmp/* && \
+ curl -LSs https://raw.githubusercontent.com/lunarvim/lunarvim/${LV_BRANCH}/utils/installer/install-neovim-from-release | bash && \
+ LV_BRANCH=${LV_BRANCH} curl -LSs https://raw.githubusercontent.com/lunarvim/lunarvim/${LV_BRANCH}/utils/installer/install.sh | bash -s -- --no-install-dependencies
+
+# Setup LVIM to run on startup
+ENTRYPOINT ["/bin/bash"]
+CMD ["lvim"]
+
+# vim: ft=dockerfile:
diff --git a/mac/.config/LunarVim/utils/installer/config.example.lua b/mac/.config/LunarVim/utils/installer/config.example.lua
new file mode 100644
index 0000000..9776f64
--- /dev/null
+++ b/mac/.config/LunarVim/utils/installer/config.example.lua
@@ -0,0 +1,5 @@
+-- Read the docs: https://www.lunarvim.org/docs/configuration
+-- Example configs: https://github.com/LunarVim/starter.lvim
+-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
+-- Forum: https://www.reddit.com/r/lunarvim/
+-- Discord: https://discord.com/invite/Xb9B4Ny
diff --git a/mac/.config/LunarVim/utils/installer/config_win.example.lua b/mac/.config/LunarVim/utils/installer/config_win.example.lua
new file mode 100644
index 0000000..1fccb5a
--- /dev/null
+++ b/mac/.config/LunarVim/utils/installer/config_win.example.lua
@@ -0,0 +1,27 @@
+-- Read the docs: https://www.lunarvim.org/docs/configuration
+-- Example configs: https://github.com/LunarVim/starter.lvim
+-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
+-- Forum: https://www.reddit.com/r/lunarvim/
+-- Discord: https://discord.com/invite/Xb9B4Ny
+
+-- Enable powershell as your default shell
+vim.opt.shell = "pwsh.exe"
+vim.opt.shellcmdflag =
+ "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
+vim.cmd [[
+ let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
+ let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
+ set shellquote= shellxquote=
+ ]]
+
+-- Set a compatible clipboard manager
+vim.g.clipboard = {
+ copy = {
+ ["+"] = "win32yank.exe -i --crlf",
+ ["*"] = "win32yank.exe -i --crlf",
+ },
+ paste = {
+ ["+"] = "win32yank.exe -o --lf",
+ ["*"] = "win32yank.exe -o --lf",
+ },
+}
diff --git a/mac/.config/LunarVim/utils/installer/install-neovim-from-release b/mac/.config/LunarVim/utils/installer/install-neovim-from-release
new file mode 100755
index 0000000..f041f77
--- /dev/null
+++ b/mac/.config/LunarVim/utils/installer/install-neovim-from-release
@@ -0,0 +1,83 @@
+#!/usr/bin/env bash
+
+set -eu pipefall
+
+declare -r LV_INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}"
+declare -r RELEASE_VER="${RELEASE_VER:-latest}" # can be set to nightly
+
+declare ARCHIVE_NAME
+declare OS
+
+OS="$(uname -s)"
+
+if [ "$OS" == "Linux" ]; then
+ ARCHIVE_NAME="nvim-linux64"
+elif [ "$OS" == "Darwin" ]; then
+ ARCHIVE_NAME="nvim-macos-x86_64"
+else
+ echo "$OS platform is not supported currently"
+ exit 1
+fi
+
+if [[ "${RELEASE_VER}" == "latest" ]]; then
+ declare -r RELEASE_URL="https://github.com/neovim/neovim/releases/${RELEASE_VER}/download/${ARCHIVE_NAME}.tar.gz"
+else
+ declare -r RELEASE_URL="https://github.com/neovim/neovim/releases/download/${RELEASE_VER}/${ARCHIVE_NAME}.tar.gz"
+fi
+declare -r CHECKSUM_URL="$RELEASE_URL.sha256sum"
+
+DOWNLOAD_DIR="$(mktemp -d)"
+readonly DOWNLOAD_DIR
+
+RELEASE_SHA="$(curl -Ls "$CHECKSUM_URL" | awk '{print $1}')"
+readonly RELEASE_SHA
+
+function main() {
+ if [ ! -d "$LV_INSTALL_PREFIX" ]; then
+ mkdir -p "$LV_INSTALL_PREFIX" || __invalid__prefix__handler
+ fi
+ download_neovim
+ verify_neovim
+ install_neovim
+}
+
+function download_neovim() {
+ echo "Downloading Neovim's binary from $RELEASE_VER release.."
+ if ! curl --progress-bar --fail -L "$RELEASE_URL" -o "$DOWNLOAD_DIR/$ARCHIVE_NAME.tar.gz"; then
+ echo "Download failed. Check that the release/filename are correct."
+ exit 1
+ fi
+ echo "Download complete!"
+}
+
+function verify_neovim() {
+ echo "Verifying the installation.."
+ DOWNLOADED_SHA="$(openssl dgst -sha256 "$DOWNLOAD_DIR/$ARCHIVE_NAME.tar.gz" | awk '{print $2}')"
+
+ if [ "$RELEASE_SHA" != "$DOWNLOADED_SHA" ]; then
+ echo "Error! checksum mismatch."
+ echo "Expected: $RELEASE_SHA but got: $DOWNLOADED_SHA"
+ exit 1
+ fi
+ echo "Verification complete!"
+}
+
+function install_neovim() {
+
+ echo "Installing Neovim.."
+ pushd "$DOWNLOAD_DIR"
+ tar -xzf "$DOWNLOAD_DIR/$ARCHIVE_NAME.tar.gz"
+ popd
+ # https://dev.to/ackshaey/macos-vs-linux-the-cp-command-will-trip-you-up-2p00
+ cp -r "$DOWNLOAD_DIR/$ARCHIVE_NAME/." "$LV_INSTALL_PREFIX"
+ echo "Installation complete!"
+ echo "Now you can run $LV_INSTALL_PREFIX/bin/nvim"
+}
+
+function __invalid__prefix__handler() {
+ echo "Error! Invalid value for LV_INSTALL_PREFIX: [$INSTALL_PREFIX]"
+ echo "Please verify that the folder exists and re-run the installer!"
+ exit 1
+}
+
+main "$@"
diff --git a/mac/.config/LunarVim/utils/installer/install.ps1 b/mac/.config/LunarVim/utils/installer/install.ps1
new file mode 100644
index 0000000..5aef434
--- /dev/null
+++ b/mac/.config/LunarVim/utils/installer/install.ps1
@@ -0,0 +1,305 @@
+#Requires -Version 7.1
+$ErrorActionPreference = "Stop" # exit when command fails
+if ($PSVersionTable.PSVersion -lt 7.1) {
+ Write-Error "Powershell version needs to be greater than 7.1!"
+}
+
+# set script variables
+$LV_BRANCH = $LV_BRANCH ?? "master"
+$LV_REMOTE = $LV_REMOTE ?? "lunarvim/lunarvim.git"
+$INSTALL_PREFIX = $INSTALL_PREFIX ?? "$HOME\.local"
+
+$env:XDG_DATA_HOME = $env:XDG_DATA_HOME ?? $env:APPDATA
+$env:XDG_CONFIG_HOME = $env:XDG_CONFIG_HOME ?? $env:LOCALAPPDATA
+$env:XDG_CACHE_HOME = $env:XDG_CACHE_HOME ?? $env:TEMP
+
+$env:LUNARVIM_RUNTIME_DIR = $env:LUNARVIM_RUNTIME_DIR ?? "$env:XDG_DATA_HOME\lunarvim"
+$env:LUNARVIM_CONFIG_DIR = $env:LUNARVIM_CONFIG_DIR ?? "$env:XDG_CONFIG_HOME\lvim"
+$env:LUNARVIM_CACHE_DIR = $env:LUNARVIM_CACHE_DIR ?? "$env:XDG_CACHE_HOME\lvim"
+$env:LUNARVIM_BASE_DIR = $env:LUNARVIM_BASE_DIR ?? "$env:LUNARVIM_RUNTIME_DIR\lvim"
+
+$__lvim_dirs = (
+ $env:LUNARVIM_BASE_DIR,
+ $env:LUNARVIM_RUNTIME_DIR,
+ $env:LUNARVIM_CONFIG_DIR,
+ $env:LUNARVIM_CACHE_DIR
+)
+
+function __add_separator($div_width) {
+ "-" * $div_width
+ Write-Output ""
+}
+
+function msg($text){
+ Write-Output $text
+ __add_separator "80"
+}
+
+function main($cliargs) {
+
+ print_logo
+
+ verify_lvim_dirs
+
+ if ($cliargs.Contains("--overwrite")) {
+ Write-Output "!!Warning!! -> Removing all lunarvim related config because of the --overwrite flag"
+ $answer = Read-Host "Would you like to continue? [y]es or [n]o "
+ if ("$answer" -ne "y" -and "$answer" -ne "Y") {
+ exit 1
+ }
+ uninstall_lvim
+ }
+ if ($cliargs.Contains("--local") -or $cliargs.Contains("--testing")) {
+ msg "Using local LunarVim installation"
+ local_install
+ exit
+ }
+
+ msg "Checking dependencies.."
+ check_system_deps
+
+ $answer = Read-Host "Would you like to check lunarvim's NodeJS dependencies? [y]es or [n]o (default: no) "
+ if ("$answer" -eq "y" -or "$answer" -eq "Y") {
+ install_nodejs_deps
+ }
+
+ $answer = Read-Host "Would you like to check lunarvim's Python dependencies? [y]es or [n]o (default: no) "
+ if ("$answer" -eq "y" -or "$answer" -eq "Y") {
+ install_python_deps
+ }
+
+
+ if (Test-Path "$env:LUNARVIM_BASE_DIR\init.lua" ) {
+ msg "Updating LunarVim"
+ validate_lunarvim_files
+ }
+ else {
+ msg "Cloning Lunarvim"
+ clone_lvim
+ setup_lvim
+ }
+}
+
+function print_missing_dep_msg($dep) {
+ Write-Output "[ERROR]: Unable to find dependency [$dep]"
+ Write-Output "Please install it first and re-run the installer."
+}
+
+$winget_package_matrix=@{"git" = "Git.Git"; "nvim" = "Neovim.Neovim"; "make" = "GnuWin32.Make"; "node" = "OpenJS.NodeJS"; "pip" = "Python.Python.3.11"}
+$winget_additional_arguments_matrix=@{"git" = "--source winget --interactive"; "nvim" = "--interactive"; "make" = "--interactive"; "node" = ""; "pip" = ""}
+
+$scoop_package_matrix=@{"git" = "git"; "nvim" = "neovim"; "make" = "make"; "node" = "nodejs"; "pip" = "python"}
+
+function install_system_package($dep) {
+ # Make installers sometimes have a problem when adding make to path
+ Write-Output "WARNING: Preparing 'make' installation. The make directory ('C:\Program Files (x86)\GnuWin32\bin') might not be added to the PATH by the installer, and you might have to manually to the PATH!"
+ if (Get-Command -Name "winget" -ErrorAction SilentlyContinue) {
+ Write-Output "Attempting to install dependency [$dep] with winget"
+
+ $command="winget"
+ $command_arguments = "-e --id $($winget_package_matrix[$dep]) $($winget_additional_arguments_matrix[$dep])".Trim() -split ' '
+ }
+ elseif (Get-Command -Name "scoop" -ErrorAction SilentlyContinue) {
+ Write-Output "Attempting to install dependency [$dep] with scoop"
+ # TODO: check if it's fine to not run it with --global
+ $command = "scoop"
+ $command_arguments = "$($scoop_package_matrix[$dep])".Trim() -split ' '
+ }
+ else {
+ print_missing_dep_msg "$dep"
+ exit 1
+ }
+
+ try {
+ & $command install $command_arguments
+ # Refresh the path after installation
+ $env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
+ } catch {
+ Write-Output "An error occurred: $_"
+ exit 1
+ }
+}
+
+function check_system_dep($dep) {
+ try {
+ Get-Command -Name $dep -ErrorAction Stop | Out-Null
+ }
+ catch {
+ install_system_package "$dep"
+ }
+}
+
+function check_system_deps() {
+ check_system_dep "git"
+ check_system_dep "nvim"
+ check_system_dep "make"
+}
+
+function install_nodejs_deps() {
+ $dep = "node"
+ try {
+ check_system_dep "$dep"
+ Invoke-Command -ScriptBlock { npm install --global neovim tree-sitter-cli } -ErrorAction Break
+ }
+ catch {
+ print_missing_dep_msg "$dep"
+ }
+}
+
+function install_python_deps() {
+ $dep = "pip"
+ try {
+ check_system_dep "$dep"
+ Invoke-Command -ScriptBlock { python -m pip install --user pynvim } -ErrorAction Break
+ }
+ catch {
+ print_missing_dep_msg "$dep"
+ }
+}
+
+function backup_old_config() {
+ $src = "$env:LUNARVIM_CONFIG_DIR"
+ if (Test-Path $src) {
+ New-Item "$src.old" -ItemType Directory -Force | Out-Null
+ Copy-Item -Force -Recurse "$src\*" "$src.old\." | Out-Null
+ }
+ msg "Backup operation complete"
+}
+
+
+function local_install() {
+ verify_lvim_dirs
+ $repoDir = git rev-parse --show-toplevel
+ $gitLocalCloneCmd = git clone --progress "$repoDir" "$env:LUNARVIM_BASE_DIR"
+ Invoke-Command -ErrorAction Stop -ScriptBlock { $gitLocalCloneCmd; setup_lvim }
+}
+
+function clone_lvim() {
+ try {
+ $gitCloneCmd = git clone --progress --depth 1 --branch "$LV_BRANCH" `
+ "https://github.com/$LV_REMOTE" `
+ "$env:LUNARVIM_BASE_DIR"
+ Invoke-Command -ErrorAction Stop -ScriptBlock { $gitCloneCmd }
+ }
+ catch {
+ msg "Failed to clone repository. Installation failed."
+ exit 1
+ }
+}
+
+function setup_shim() {
+ if ((Test-Path "$INSTALL_PREFIX\bin") -eq $false) {
+ New-Item "$INSTALL_PREFIX\bin" -ItemType Directory | Out-Null
+ }
+
+ Copy-Item -Force "$env:LUNARVIM_BASE_DIR\utils\bin\lvim.ps1" "$INSTALL_PREFIX\bin\lvim.ps1"
+}
+
+function uninstall_lvim() {
+ foreach ($dir in $__lvim_dirs) {
+ if (Test-Path "$dir") {
+ Remove-Item -Force -Recurse "$dir"
+ }
+ }
+}
+
+function verify_lvim_dirs() {
+ foreach ($dir in $__lvim_dirs) {
+ if ((Test-Path "$dir") -eq $false) {
+ New-Item "$dir" -ItemType Directory | Out-Null
+ }
+ }
+ backup_old_config
+}
+
+
+function setup_lvim() {
+ msg "Installing LunarVim shim"
+ setup_shim
+
+ msg "Installing sample configuration"
+
+ if (Test-Path "$env:LUNARVIM_CONFIG_DIR\config.lua") {
+ Move-Item "$env:LUNARVIM_CONFIG_DIR\config.lua" "$env:LUNARVIM_CONFIG_DIR\config.lua.old"
+ }
+
+ New-Item -ItemType File -Path "$env:LUNARVIM_CONFIG_DIR\config.lua" | Out-Null
+
+ $exampleConfig = "$env:LUNARVIM_BASE_DIR\utils\installer\config_win.example.lua"
+ Copy-Item -Force "$exampleConfig" "$env:LUNARVIM_CONFIG_DIR\config.lua"
+
+ Write-Host "Make sure to run `:Lazy sync` at first launch" -ForegroundColor Green
+
+ create_alias
+
+ msg "Thank you for installing LunarVim!!"
+
+ Write-Output "You can start it by running: $INSTALL_PREFIX\bin\lvim.ps1"
+ Write-Output "Do not forget to use a font with glyphs (icons) support [https://github.com/ryanoasis/nerd-fonts]"
+}
+
+
+function validate_lunarvim_files() {
+ Set-Alias lvim "$INSTALL_PREFIX\bin\lvim.ps1"
+ try {
+ $verify_version_cmd="if !empty(v:errmsg) | cquit | else | quit | endif"
+ Invoke-Command -ScriptBlock { lvim --headless -c 'LvimUpdate' -c "$verify_version_cmd" } -ErrorAction SilentlyContinue
+ }
+ catch {
+ Write-Output "Unable to guarantee data integrity while updating. Please run `:LvimUpdate` manually instead."
+ exit 1
+ }
+ Write-Output "Your LunarVim installation is now up to date!"
+}
+
+function create_alias {
+ try {
+ $answer = Read-Host $(`
+ "Would you like to create an alias inside your Powershell profile?`n" + `
+ "(This enables you to start lvim with the command 'lvim') [y]es or [n]o (default: no)" )
+ }
+ catch {
+ msg "Non-interactive mode detected. Skipping alias creation"
+ return
+ }
+
+ if ("$answer" -ne "y" -or "$answer" -ne "Y") {
+ return
+ }
+
+ $lvim_bin="$INSTALL_PREFIX\bin\lvim.ps1"
+ $lvim_alias = Get-Alias lvim -ErrorAction SilentlyContinue
+
+ if ($lvim_alias.Definition -eq $lvim_bin) {
+ Write-Output "Alias is already set and will not be reset."
+ return
+ }
+
+ try {
+ Get-Content $PROFILE -ErrorAction Stop
+ }
+ catch {
+ New-Item -Path $PROFILE -ItemType "file" -Force
+ }
+
+ Add-Content -Path $PROFILE -Value $("`r`nSet-Alias lvim '$lvim_bin'")
+
+ Write-Host 'To use the new alias in this window reload your profile with: `. $PROFILE`' -ForegroundColor Green
+}
+
+function print_logo(){
+ Write-Output "
+
+ 88\ 88\
+ 88 | \__|
+ 88 |88\ 88\ 888888$\ 888888\ 888888\ 88\ 88\ 88\ 888888\8888\
+ 88 |88 | 88 |88 __88\ \____88\ 88 __88\\88\ 88 |88 |88 _88 _88\
+ 88 |88 | 88 |88 | 88 | 888888$ |88 | \__|\88\88 / 88 |88 / 88 / 88 |
+ 88 |88 | 88 |88 | 88 |88 __88 |88 | \88$ / 88 |88 | 88 | 88 |
+ 88 |\888888 |88 | 88 |\888888$ |88 | \$ / 88 |88 | 88 | 88 |
+ \__| \______/ \__| \__| \_______|\__| \_/ \__|\__| \__| \__|
+
+ "
+}
+
+main "$args"
diff --git a/mac/.config/LunarVim/utils/installer/install.sh b/mac/.config/LunarVim/utils/installer/install.sh
new file mode 100755
index 0000000..0fd09bc
--- /dev/null
+++ b/mac/.config/LunarVim/utils/installer/install.sh
@@ -0,0 +1,461 @@
+#!/usr/bin/env bash
+set -eo pipefail
+
+OS="$(uname -s)"
+
+#Set branch to master unless specified by the user
+declare -x LV_BRANCH="${LV_BRANCH:-"master"}"
+declare -xr LV_REMOTE="${LV_REMOTE:-lunarvim/lunarvim.git}"
+declare -xr INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}"
+
+declare -xr XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}"
+declare -xr XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}"
+declare -xr XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}"
+
+declare -xr NVIM_APPNAME="${NVIM_APPNAME:-"lvim"}"
+
+declare -xr LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$XDG_DATA_HOME/lunarvim"}"
+declare -xr LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/$NVIM_APPNAME"}"
+declare -xr LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$XDG_CACHE_HOME/$NVIM_APPNAME"}"
+declare -xr LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$LUNARVIM_RUNTIME_DIR/$NVIM_APPNAME"}"
+
+declare -xr LUNARVIM_LOG_LEVEL="${LUNARVIM_LOG_LEVEL:-warn}"
+
+declare BASEDIR
+BASEDIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
+BASEDIR="$(dirname -- "$(dirname -- "$BASEDIR")")"
+readonly BASEDIR
+
+declare ARGS_LOCAL=0
+declare ARGS_OVERWRITE=0
+declare ARGS_INSTALL_DEPENDENCIES=1
+declare INTERACTIVE_MODE=1
+declare ADDITIONAL_WARNINGS=""
+
+declare -a __lvim_dirs=(
+ "$LUNARVIM_RUNTIME_DIR"
+ "$LUNARVIM_CACHE_DIR"
+ "$LUNARVIM_BASE_DIR"
+)
+
+declare -a __npm_deps=(
+ "neovim"
+)
+# treesitter installed with brew causes conflicts #3738
+if ! command -v tree-sitter &>/dev/null; then
+ __npm_deps+=("tree-sitter-cli")
+fi
+
+declare -a __rust_deps=(
+ "fd::fd-find"
+ "rg::ripgrep"
+)
+
+function usage() {
+ echo "Usage: install.sh []"
+ echo ""
+ echo "Options:"
+ echo " -h, --help Print this help message"
+ echo " -l, --local Install local copy of LunarVim"
+ echo " -y, --yes Disable confirmation prompts (answer yes to all questions)"
+ echo " --overwrite Overwrite previous LunarVim configuration (a backup is always performed first)"
+ echo " --[no-]install-dependencies Whether to automatically install external dependencies (will prompt by default)"
+}
+
+function parse_arguments() {
+ while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -l | --local)
+ ARGS_LOCAL=1
+ ;;
+ --overwrite)
+ ARGS_OVERWRITE=1
+ ;;
+ -y | --yes)
+ INTERACTIVE_MODE=0
+ ;;
+ --install-dependencies)
+ ARGS_INSTALL_DEPENDENCIES=1
+ ;;
+ --no-install-dependencies)
+ ARGS_INSTALL_DEPENDENCIES=0
+ ;;
+ -h | --help)
+ usage
+ exit 0
+ ;;
+ esac
+ shift
+ done
+}
+
+function msg() {
+ local text="$1"
+ local div_width="80"
+ printf "%${div_width}s\n" ' ' | tr ' ' -
+ printf "%s\n" "$text"
+}
+
+function confirm() {
+ local question="$1"
+ while true; do
+ msg "$question"
+ read -p "[y]es or [n]o (default: no) : " -r answer
+ case "$answer" in
+ y | Y | yes | YES | Yes)
+ return 0
+ ;;
+ n | N | no | NO | No | *[[:blank:]]* | "")
+ return 1
+ ;;
+ *)
+ msg "Please answer [y]es or [n]o."
+ ;;
+ esac
+ done
+}
+
+function stringify_array() {
+ echo -n "${@}" | sed 's/ /, /'
+}
+
+function main() {
+ parse_arguments "$@"
+
+ print_logo
+
+ msg "Detecting platform for managing any additional neovim dependencies"
+ detect_platform
+
+ check_system_deps
+
+ if [ "$ARGS_INSTALL_DEPENDENCIES" -eq 1 ]; then
+ if [ "$INTERACTIVE_MODE" -eq 1 ]; then
+ if confirm "Would you like to install LunarVim's NodeJS/BunJS dependencies: $(stringify_array "${__npm_deps[@]}")?"; then
+ install_nodejs_deps
+ fi
+ if confirm "Would you like to install LunarVim's Rust dependencies: $(stringify_array "${__rust_deps[@]}")?"; then
+ install_rust_deps
+ fi
+ else
+ install_nodejs_deps
+ install_rust_deps
+ fi
+ fi
+
+ remove_old_cache_files
+
+ verify_lvim_dirs
+
+ if [ "$ARGS_LOCAL" -eq 1 ]; then
+ link_local_lvim
+ else
+ clone_lvim
+ fi
+
+ setup_lvim
+
+ msg "$ADDITIONAL_WARNINGS"
+ msg "Thank you for installing LunarVim!!"
+ echo "You can start it by running: $INSTALL_PREFIX/bin/$NVIM_APPNAME"
+ echo "Do not forget to use a font with glyphs (icons) support [https://github.com/ryanoasis/nerd-fonts]"
+}
+
+function detect_platform() {
+ case "$OS" in
+ Linux)
+ if [ -f "/etc/arch-release" ] || [ -f "/etc/artix-release" ]; then
+ RECOMMEND_INSTALL="sudo pacman -S"
+ elif [ -f "/etc/fedora-release" ] || [ -f "/etc/redhat-release" ]; then
+ RECOMMEND_INSTALL="sudo dnf install -y"
+ elif [ -f "/etc/gentoo-release" ]; then
+ RECOMMEND_INSTALL="emerge -tv"
+ else # assume debian based
+ RECOMMEND_INSTALL="sudo apt install -y"
+ fi
+ ;;
+ FreeBSD)
+ RECOMMEND_INSTALL="sudo pkg install -y"
+ ;;
+ NetBSD)
+ RECOMMEND_INSTALL="sudo pkgin install"
+ ;;
+ OpenBSD)
+ RECOMMEND_INSTALL="doas pkg_add"
+ ;;
+ Darwin)
+ RECOMMEND_INSTALL="brew install"
+ ;;
+ *)
+ echo "OS $OS is not currently supported."
+ exit 1
+ ;;
+ esac
+}
+
+function print_missing_dep_msg() {
+ if [ "$#" -eq 1 ]; then
+ echo "[ERROR]: Unable to find dependency [$1]"
+ echo "Please install it first and re-run the installer. Try: $RECOMMEND_INSTALL $1"
+ else
+ local cmds
+ cmds=$(for i in "$@"; do echo "$RECOMMEND_INSTALL $i"; done)
+ printf "[ERROR]: Unable to find dependencies [%s]" "$@"
+ printf "Please install any one of the dependencies and re-run the installer. Try: \n%s\n" "$cmds"
+ fi
+}
+
+function check_neovim_min_version() {
+ local verify_version_cmd='if !has("nvim-0.9") | cquit | else | quit | endif'
+
+ # exit with an error if min_version not found
+ if ! nvim --headless -u NONE -c "$verify_version_cmd"; then
+ echo "[ERROR]: LunarVim requires at least Neovim v0.9 or higher"
+ exit 1
+ fi
+}
+
+function verify_core_plugins() {
+ msg "Verifying core plugins"
+ if ! bash "$LUNARVIM_BASE_DIR/utils/ci/verify_plugins.sh"; then
+ echo "[ERROR]: Unable to verify plugins, make sure to manually run ':Lazy sync' when starting lvim for the first time."
+ exit 1
+ fi
+ echo "Verification complete!"
+}
+
+function validate_install_prefix() {
+ local prefix="$1"
+ case $PATH in
+ *"$prefix/bin"*)
+ return
+ ;;
+ esac
+ local profile="$HOME/.profile"
+ test -z "$ZSH_VERSION" && profile="$HOME/.zshenv"
+ ADDITIONAL_WARNINGS="[WARN] the folder $prefix/bin is not on PATH, consider adding 'export PATH=$prefix/bin:\$PATH' to your $profile"
+
+ # avoid problems when calling any verify_* function
+ export PATH="$prefix/bin:$PATH"
+}
+
+function check_system_deps() {
+
+ validate_install_prefix "$INSTALL_PREFIX"
+
+ if ! command -v git &>/dev/null; then
+ print_missing_dep_msg "git"
+ exit 1
+ fi
+ if ! command -v nvim &>/dev/null; then
+ print_missing_dep_msg "neovim"
+ exit 1
+ fi
+ check_neovim_min_version
+}
+
+function __install_nodejs_deps_pnpm() {
+ echo "Installing node modules with pnpm.."
+ pnpm install -g "${__npm_deps[@]}"
+ echo "All NodeJS dependencies are successfully installed"
+}
+
+function __install_nodejs_deps_npm() {
+ echo "Installing node modules with npm.."
+ for dep in "${__npm_deps[@]}"; do
+ if ! npm ls -g "$dep" &>/dev/null; then
+ printf "installing %s .." "$dep"
+ npm install -g "$dep"
+ fi
+ done
+
+ echo "All NodeJS dependencies are successfully installed"
+}
+
+function __install_nodejs_deps_yarn() {
+ echo "Installing node modules with yarn.."
+ yarn global add "${__npm_deps[@]}"
+ echo "All NodeJS dependencies are successfully installed"
+}
+
+function __install_nodejs_deps_bun() {
+ echo "Installing bun modules with bun..."
+ bun install -g "${__npm_deps[@]}"
+ echo "All BunJS dependencies are successfully installed"
+}
+
+function __validate_node_installation() {
+ local pkg_manager="$1"
+ local manager_home
+
+ if ! command -v "$pkg_manager" &>/dev/null; then
+ return 1
+ fi
+
+ if [ "$pkg_manager" == "npm" ]; then
+ manager_home="$(npm config get prefix 2>/dev/null)"
+ elif [ "$pkg_manager" == "bun" ]; then
+ manager_home="$BUN_INSTALL"
+ elif [ "$pkg_manager" == "pnpm" ]; then
+ manager_home="$(pnpm config get prefix 2>/dev/null)"
+ else
+ manager_home="$(yarn global bin 2>/dev/null)"
+ fi
+
+ if [ ! -d "$manager_home" ] || [ ! -w "$manager_home" ]; then
+ return 1
+ fi
+
+ return 0
+}
+
+function install_nodejs_deps() {
+ local -a pkg_managers=("pnpm" "bun" "yarn" "npm")
+ for pkg_manager in "${pkg_managers[@]}"; do
+ if __validate_node_installation "$pkg_manager"; then
+ eval "__install_nodejs_deps_$pkg_manager"
+ return
+ fi
+ done
+ echo "[WARN]: skipping installing optional nodejs dependencies due to insufficient permissions."
+ echo "check how to solve it: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally"
+}
+
+function __attempt_to_install_with_cargo() {
+ if command -v cargo &>/dev/null; then
+ echo "Installing missing Rust dependency with cargo"
+ cargo install "$1"
+ else
+ echo "[WARN]: Unable to find cargo. Make sure to install it to avoid any problems"
+ exit 1
+ fi
+}
+
+# we try to install the missing one with cargo even though it's unlikely to be found
+function install_rust_deps() {
+ for dep in "${__rust_deps[@]}"; do
+ if ! command -v "${dep%%::*}" &>/dev/null; then
+ __attempt_to_install_with_cargo "${dep##*::}"
+ fi
+ done
+ echo "All Rust dependencies are successfully installed"
+}
+
+function __backup_dir() {
+ local src="$1"
+ if [ ! -d "$src" ]; then
+ return
+ fi
+ mkdir -p "$src.old"
+ msg "Backing up old $src to $src.old"
+ if command -v rsync &>/dev/null; then
+ rsync --archive --quiet --backup --partial --copy-links --cvs-exclude "$src"/ "$src.old"
+ else
+ case "$OS" in
+ Darwin)
+ cp -R "$src/." "$src.old/."
+ ;;
+ *)
+ cp -r "$src/." "$src.old/."
+ ;;
+ esac
+ fi
+}
+
+function verify_lvim_dirs() {
+ for dir in "${__lvim_dirs[@]}"; do
+ if [ -d "$dir" ]; then
+ if [ "$ARGS_OVERWRITE" -eq 0 ]; then
+ __backup_dir "$dir"
+ fi
+ rm -rf "$dir"
+ fi
+ mkdir -p "$dir"
+ done
+ mkdir -p "$LUNARVIM_CONFIG_DIR"
+}
+
+function clone_lvim() {
+ msg "Cloning LunarVim configuration"
+ if ! git clone --progress --depth 1 --branch "$LV_BRANCH" \
+ "https://github.com/${LV_REMOTE}" "$LUNARVIM_BASE_DIR"; then
+ echo "Failed to clone repository. Installation failed."
+ exit 1
+ fi
+}
+
+function link_local_lvim() {
+ echo "Linking local LunarVim repo"
+
+ # Detect whether it's a symlink or a folder
+ if [ -d "$LUNARVIM_BASE_DIR" ]; then
+ msg "Moving old files to ${LUNARVIM_BASE_DIR}.old"
+ mv "$LUNARVIM_BASE_DIR" "${LUNARVIM_BASE_DIR}".old
+ fi
+
+ echo " - $BASEDIR -> $LUNARVIM_BASE_DIR"
+ ln -s -f "$BASEDIR" "$LUNARVIM_BASE_DIR"
+}
+
+function setup_shim() {
+ make -C "$LUNARVIM_BASE_DIR" install-bin
+}
+
+function remove_old_cache_files() {
+ local lazy_cache="$LUNARVIM_CACHE_DIR/lazy/cache"
+ if [ -e "$lazy_cache" ]; then
+ msg "Removing old lazy cache file"
+ rm -f "$lazy_cache"
+ fi
+}
+
+function setup_lvim() {
+
+ msg "Installing LunarVim shim"
+
+ setup_shim
+
+ create_desktop_file
+
+ [ ! -f "$LUNARVIM_CONFIG_DIR/config.lua" ] \
+ && cp "$LUNARVIM_BASE_DIR/utils/installer/config.example.lua" "$LUNARVIM_CONFIG_DIR/config.lua"
+
+ echo "Preparing Lazy setup"
+
+ "$INSTALL_PREFIX/bin/$NVIM_APPNAME" --headless -c 'quitall'
+
+ printf "\nLazy setup complete\n"
+
+ verify_core_plugins
+}
+
+function create_desktop_file() {
+ # TODO: Any other OSes that use desktop files?
+ ([ "$OS" != "Linux" ] || ! command -v xdg-desktop-menu &>/dev/null) && return
+ echo "Creating desktop file"
+
+ for d in "$LUNARVIM_BASE_DIR"/utils/desktop/*/; do
+ size_folder=$(basename "$d")
+ mkdir -p "$XDG_DATA_HOME/icons/hicolor/$size_folder/apps/"
+ cp "$LUNARVIM_BASE_DIR/utils/desktop/$size_folder/lvim.svg" "$XDG_DATA_HOME/icons/hicolor/$size_folder/apps"
+ done
+
+ xdg-desktop-menu install --novendor "$LUNARVIM_BASE_DIR/utils/desktop/lvim.desktop" || true
+}
+
+function print_logo() {
+ cat <<'EOF'
+
+ 88\ 88\
+ 88 | \__|
+ 88 |88\ 88\ 888888$\ 888888\ 888888\ 88\ 88\ 88\ 888888\8888\
+ 88 |88 | 88 |88 __88\ \____88\ 88 __88\\88\ 88 |88 |88 _88 _88\
+ 88 |88 | 88 |88 | 88 | 888888$ |88 | \__|\88\88 / 88 |88 / 88 / 88 |
+ 88 |88 | 88 |88 | 88 |88 __88 |88 | \88$ / 88 |88 | 88 | 88 |
+ 88 |\888888 |88 | 88 |\888888$ |88 | \$ / 88 |88 | 88 | 88 |
+ \__| \______/ \__| \__| \_______|\__| \_/ \__|\__| \__| \__|
+
+EOF
+}
+
+main "$@"
diff --git a/mac/.config/LunarVim/utils/installer/install_bin.sh b/mac/.config/LunarVim/utils/installer/install_bin.sh
new file mode 100755
index 0000000..a25ad37
--- /dev/null
+++ b/mac/.config/LunarVim/utils/installer/install_bin.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+set -eo pipefail
+
+INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}"
+
+XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}"
+XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}"
+XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}"
+
+NVIM_APPNAME="${NVIM_APPNAME:-lvim}"
+
+LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$XDG_DATA_HOME/lunarvim"}"
+LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/$NVIM_APPNAME"}"
+LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$XDG_CACHE_HOME/$NVIM_APPNAME"}"
+LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$LUNARVIM_RUNTIME_DIR/$NVIM_APPNAME"}"
+
+function setup_shim() {
+ local src="$LUNARVIM_BASE_DIR/utils/bin/lvim.template"
+ local dst="$INSTALL_PREFIX/bin/$NVIM_APPNAME"
+
+ [ ! -d "$INSTALL_PREFIX/bin" ] && mkdir -p "$INSTALL_PREFIX/bin"
+
+ # remove outdated installation so that `cp` doesn't complain
+ rm -f "$dst"
+
+ cp "$src" "$dst"
+
+ sed -e s"#NVIM_APPNAME_VAR#\"${NVIM_APPNAME}\"#"g \
+ -e s"#RUNTIME_DIR_VAR#\"${LUNARVIM_RUNTIME_DIR}\"#"g \
+ -e s"#CONFIG_DIR_VAR#\"${LUNARVIM_CONFIG_DIR}\"#"g \
+ -e s"#CACHE_DIR_VAR#\"${LUNARVIM_CACHE_DIR}\"#"g \
+ -e s"#BASE_DIR_VAR#\"${LUNARVIM_BASE_DIR}\"#"g "$src" \
+ | tee "$dst" >/dev/null
+
+ chmod u+x "$dst"
+}
+
+setup_shim "$@"
+
+echo "You can start LunarVim by running: $INSTALL_PREFIX/bin/$NVIM_APPNAME"
diff --git a/mac/.config/LunarVim/utils/installer/install_stylua.sh b/mac/.config/LunarVim/utils/installer/install_stylua.sh
new file mode 100755
index 0000000..963416e
--- /dev/null
+++ b/mac/.config/LunarVim/utils/installer/install_stylua.sh
@@ -0,0 +1,63 @@
+#!/usr/bin/env bash
+
+set -eu pipefall
+
+declare -r INSTALL_DIR="$PWD/utils"
+declare -r RELEASE="0.10.0"
+declare -r OS="linux"
+# declare -r OS="$(uname -s)"
+declare -r FILENAME="stylua-$RELEASE-$OS"
+
+declare -a __deps=("curl" "unzip")
+
+function check_deps() {
+ for dep in "${__deps[@]}"; do
+ if ! command -v "$dep" >/dev/null; then
+ echo "Missing depdendecy!"
+ echo "The \"$dep\" command was not found!. Please install and try again."
+ fi
+ done
+}
+
+function download_stylua() {
+ local DOWNLOAD_DIR
+ local URL="https://github.com/JohnnyMorganz/StyLua/releases/download/v$RELEASE/$FILENAME.zip"
+
+ DOWNLOAD_DIR="$(mktemp -d)"
+ echo "Initiating download for Stylua v$RELEASE"
+ if ! curl --progress-bar --fail -L "$URL" -o "$DOWNLOAD_DIR/$FILENAME.zip"; then
+ echo "Download failed. Check that the release/filename are correct."
+ exit 1
+ fi
+
+ echo "Installation in progress.."
+ unzip -q "$DOWNLOAD_DIR/$FILENAME.zip" -d "$DOWNLOAD_DIR"
+
+ if [ -f "$DOWNLOAD_DIR/stylua" ]; then
+ mv "$DOWNLOAD_DIR/stylua" "$INSTALL_DIR/stylua"
+ else
+ mv "$DOWNLOAD_DIR/$FILENAME/stylua" "$INSTALL_DIR/."
+ fi
+
+ chmod u+x "$INSTALL_DIR/stylua"
+}
+
+function verify_install() {
+ echo "Verifying installation.."
+ local DOWNLOADED_VER
+ DOWNLOADED_VER="$("$INSTALL_DIR/stylua" -V | awk '{ print $2 }')"
+ if [ "$DOWNLOADED_VER" != "$RELEASE" ]; then
+ echo "Mismatched version!"
+ echo "Expected: v$RELEASE but got v$DOWNLOADED_VER"
+ exit 1
+ fi
+ echo "Verification complete!"
+}
+
+function main() {
+ check_deps
+ download_stylua
+ verify_install
+}
+
+main "$@"
diff --git a/mac/.config/LunarVim/utils/installer/uninstall.ps1 b/mac/.config/LunarVim/utils/installer/uninstall.ps1
new file mode 100644
index 0000000..dcfeb26
--- /dev/null
+++ b/mac/.config/LunarVim/utils/installer/uninstall.ps1
@@ -0,0 +1,63 @@
+#Requires -Version 7.1
+$ErrorActionPreference = "Stop" # exit when command fails
+
+# set script variables
+$LV_BRANCH = $LV_BRANCH ?? "master"
+$LV_REMOTE = $LV_REMOTE ?? "lunarvim/lunarvim.git"
+$INSTALL_PREFIX = $INSTALL_PREFIX ?? "$HOME\.local"
+
+$env:XDG_DATA_HOME = $env:XDG_DATA_HOME ?? $env:APPDATA
+$env:XDG_CONFIG_HOME = $env:XDG_CONFIG_HOME ?? $env:LOCALAPPDATA
+$env:XDG_CACHE_HOME = $env:XDG_CACHE_HOME ?? $env:TEMP
+
+$env:LUNARVIM_RUNTIME_DIR = $env:LUNARVIM_RUNTIME_DIR ?? "$env:XDG_DATA_HOME\lunarvim"
+$env:LUNARVIM_CONFIG_DIR = $env:LUNARVIM_CONFIG_DIR ?? "$env:XDG_CONFIG_HOME\lvim"
+$env:LUNARVIM_CACHE_DIR = $env:LUNARVIM_CACHE_DIR ?? "$env:XDG_CACHE_HOME\lvim"
+$env:LUNARVIM_BASE_DIR = $env:LUNARVIM_BASE_DIR ?? "$env:LUNARVIM_RUNTIME_DIR\lvim"
+
+$__lvim_dirs = (
+ $env:LUNARVIM_BASE_DIR,
+ $env:LUNARVIM_RUNTIME_DIR,
+ $env:LUNARVIM_CONFIG_DIR,
+ $env:LUNARVIM_CACHE_DIR
+)
+
+function main($cliargs) {
+ Write-Output "Removing LunarVim binary..."
+ remove_lvim_bin
+ Write-Output "Removing LunarVim directories..."
+ $force = $false
+ if ($cliargs.Contains("--remove-backups")) {
+ $force = $true
+ }
+ remove_lvim_dirs $force
+ Write-Output "Uninstalled LunarVim!"
+}
+
+function remove_lvim_bin(){
+ $lvim_bin="$INSTALL_PREFIX\bin\lvim"
+ if (Test-Path $lvim_bin) {
+ Remove-Item -Force $lvim_bin
+ }
+ if (Test-Path alias:lvim) {
+ Write-Warning "Please make sure to remove the 'lvim' alias from your `$PROFILE`: $PROFILE"
+ }
+}
+
+function remove_lvim_dirs($force) {
+ foreach ($dir in $__lvim_dirs) {
+ if (Test-Path $dir) {
+ Remove-Item -Force -Recurse $dir
+ }
+ if ($force -eq $true) {
+ if (Test-Path "$dir.bak") {
+ Remove-Item -Force -Recurse "$dir.bak"
+ }
+ if (Test-Path "$dir.old") {
+ Remove-Item -Force -Recurse "$dir.old"
+ }
+ }
+ }
+}
+
+main($args)
diff --git a/mac/.config/LunarVim/utils/installer/uninstall.sh b/mac/.config/LunarVim/utils/installer/uninstall.sh
new file mode 100755
index 0000000..9b26263
--- /dev/null
+++ b/mac/.config/LunarVim/utils/installer/uninstall.sh
@@ -0,0 +1,89 @@
+#!/usr/bin/env bash
+set -eo pipefail
+
+ARGS_REMOVE_BACKUPS=0
+ARGS_REMOVE_CONFIG=0
+
+declare -r XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}"
+declare -r XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}"
+declare -r XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}"
+
+declare -xr NVIM_APPNAME="${NVIM_APPNAME:-"lvim"}"
+
+declare -xr LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$XDG_DATA_HOME/lunarvim"}"
+declare -xr LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/$NVIM_APPNAME"}"
+declare -xr LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$XDG_CACHE_HOME/$NVIM_APPNAME"}"
+declare -xr LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$LUNARVIM_RUNTIME_DIR/$NVIM_APPNAME"}"
+
+declare -a __lvim_dirs=(
+ "$LUNARVIM_RUNTIME_DIR"
+ "$LUNARVIM_CACHE_DIR"
+)
+
+__lvim_config_dir="$LUNARVIM_CONFIG_DIR"
+
+function usage() {
+ echo "Usage: uninstall.sh []"
+ echo ""
+ echo "Options:"
+ echo " -h, --help Print this help message"
+ echo " --remove-config Remove user config files as well"
+ echo " --remove-backups Remove old backup folders as well"
+}
+
+function parse_arguments() {
+ while [ "$#" -gt 0 ]; do
+ case "$1" in
+ --remove-backups)
+ ARGS_REMOVE_BACKUPS=1
+ ;;
+ --remove-config)
+ ARGS_REMOVE_CONFIG=1
+ ;;
+ -h | --help)
+ usage
+ exit 0
+ ;;
+ esac
+ shift
+ done
+}
+
+function remove_lvim_dirs() {
+ if [ "$ARGS_REMOVE_CONFIG" -eq 1 ]; then
+ __lvim_dirs+=("$__lvim_config_dir")
+ fi
+ for dir in "${__lvim_dirs[@]}"; do
+ rm -rf "$dir"
+ if [ "$ARGS_REMOVE_BACKUPS" -eq 1 ]; then
+ rm -rf "$dir.{bak,old}"
+ fi
+ done
+}
+
+function remove_lvim_bin() {
+ lvim_bin="$(command -v "$NVIM_APPNAME" 2>/dev/null)"
+ rm -f "$lvim_bin"
+}
+
+function remove_desktop_file() {
+ OS="$(uname -s)"
+ # TODO: Any other OSes that use desktop files?
+ ([ "$OS" != "Linux" ] || ! command -v xdg-desktop-menu &>/dev/null) && return
+ echo "Removing desktop file..."
+
+ find "$XDG_DATA_HOME/icons/hicolor" -name "lvim.svg" -type f -delete
+ xdg-desktop-menu uninstall lvim.desktop
+}
+
+function main() {
+ parse_arguments "$@"
+ echo "Removing LunarVim binary..."
+ remove_lvim_bin
+ echo "Removing LunarVim directories..."
+ remove_lvim_dirs
+ remove_desktop_file
+ echo "Uninstalled LunarVim!"
+}
+
+main "$@"
--
cgit v1.2.3