diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-08-23 12:42:37 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-08-23 12:42:37 +0900 |
| commit | 07d294425a98ee5d1e22d03e2b24ae2c76e487c0 (patch) | |
| tree | a6818f0d64438c5fdb88b00a35d944f80c056213 /mac/.config/LunarVim/utils | |
| parent | 6fc28cdb3529ca8ee864cb5c41674cb0a4af72a1 (diff) | |
updates
Diffstat (limited to 'mac/.config/LunarVim/utils')
28 files changed, 1730 insertions, 0 deletions
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 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" version="1.1"> + <circle style="fill:#4f4f4f" cx="8" cy="8" r="8"/> + <path style="fill:#ffffff" d="M 6.270786,6 H 7.270393 L 6.399607,11 H 5.4 Z"/> + <path style="fill:#ffffff" d="m 8.9788284,10 v 1 H 5.4000004 L 5.64,10 Z"/> + <path style="fill:#6f6fee" d="M 8 3 A 5 5 0 0 0 3 8 A 5 5 0 0 0 8 13 A 5 5 0 0 0 13 8 A 5 5 0 0 0 8 3 z M 8 4 A 4.0000001 4.0000001 0 0 1 12 8 A 4.0000001 4.0000001 0 0 1 8 12 A 4.0000001 4.0000001 0 0 1 4 8 A 4.0000001 4.0000001 0 0 1 8 4 z"/> + <path style="fill:#ffffff" d="M 8,7.3304688 V 11 H 9 V 7.3304688 C 8.8433906,7.3753512 8.674825,7.4 8.5,7.4 8.325175,7.4 8.1566094,7.375352 8,7.3304688 Z"/> + <path style="fill:#ffffff" d="m 10.34358,6 h 0.99958 L 9.24,11 H 8.24042 Z"/> + <path style="fill:#59d4f1" d="M 3.5644531 5.0019531 C 3.2874864 5.0076244 3.0408032 5.0355933 2.8261719 5.0898438 C 2.4446055 5.186288 2.1239441 5.3751204 2.0273438 5.7460938 C 1.9307428 6.1170665 2.1035029 6.4946837 2.3710938 6.8359375 C 2.5408113 7.0523749 2.7626959 7.2697752 3.0273438 7.4902344 C 3.0493821 7.2726184 3.0837732 7.0580708 3.1328125 6.8496094 C 2.9822517 6.7117295 2.8555085 6.578593 2.7617188 6.4589844 C 2.5522032 6.1917933 2.5164475 6.0188003 2.5371094 5.9394531 C 2.5577714 5.8601064 2.6680418 5.7415288 2.9667969 5.6660156 C 3.2655515 5.5905026 3.710536 5.5710215 4.25 5.6171875 C 5.3289283 5.7095195 6.7903586 6.0596776 8.3515625 6.6484375 C 9.9127664 7.2371965 11.279225 7.9539585 12.208984 8.6191406 C 12.673864 8.9517314 13.030718 9.273824 13.240234 9.5410156 C 13.44975 9.8082077 13.483553 9.9811995 13.462891 10.060547 C 13.442231 10.139897 13.331958 10.258473 13.033203 10.333984 C 12.862309 10.377175 12.641933 10.40159 12.384766 10.40625 C 12.273012 10.609478 12.147711 10.803518 12.009766 10.988281 C 12.462418 11.011122 12.855509 10.990613 13.173828 10.910156 C 13.555395 10.813706 13.876056 10.622925 13.972656 10.251953 C 14.069256 9.8809797 13.8965 9.5053164 13.628906 9.1640625 C 13.361315 8.8228159 12.971582 8.4777562 12.478516 8.125 C 11.492385 7.4194869 10.09492 6.6920542 8.4980469 6.0898438 C 6.9011749 5.4876337 5.4080174 5.1252736 4.2636719 5.0273438 C 4.1206289 5.0151036 3.9833613 5.0059394 3.8515625 5.0019531 C 3.7527131 4.9989614 3.6567754 5.0000627 3.5644531 5.0019531 z"/> + <circle style="fill:#ffffff" cx="8.45" cy="6.25" r=".75"/> +</svg> 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 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" version="1.1"> + <circle style="opacity:0.2" cx="11" cy="11.5" r="10"/> + <circle style="fill:#4f4f4f" cx="11" cy="11" r="10"/> + <path style="opacity:0.2" d="M 8.5878906,8.5 7.5,14.5 h 1 3.472656 H 12 12.300781 l 2.628907,-6 h -1 L 12,12.904297 V 10.910156 A 1.5,1.5 0 0 1 11.5,11 1.5,1.5 0 0 1 11,10.910156 V 13.5 H 8.6816406 l 0.9062504,-5 z"/> + <path style="opacity:0.2" d="m 11,5.5 a 6,6 0 0 0 -6,6 6,6 0 0 0 6,6 6,6 0 0 0 6,-6 6,6 0 0 0 -6,-6 z m 0,0.9230769 A 5.0769231,5.0769231 0 0 1 16.076923,11.5 5.0769231,5.0769231 0 0 1 11,16.576923 5.0769231,5.0769231 0 0 1 5.9230769,11.5 5.0769231,5.0769231 0 0 1 11,6.4230769 Z"/> + <path style="fill:#ffffff" d="M 8.5884825,8 H 9.588483 L 8.5,14 h -1 z"/> + <path style="opacity:0.1;fill:#ffffff" d="M 11,1 A 10,10 0 0 0 1,11 10,10 0 0 0 1.01075,11.291 10,10 0 0 1 11,1.5 10,10 0 0 1 20.9895,11.209 10,10 0 0 0 21,11 10,10 0 0 0 11,1 Z"/> + <path style="fill:#ffffff" d="m 11.973536,13 v 1 H 7.5000005 L 7.8,13 Z"/> + <path style="fill:#6f6fee" d="m 11,5 a 6,6 0 0 0 -6,6 6,6 0 0 0 6,6 6,6 0 0 0 6,-6 6,6 0 0 0 -6,-6 z m 0,0.9230769 A 5.0769231,5.0769231 0 0 1 16.076923,11 5.0769231,5.0769231 0 0 1 11,16.076923 5.0769231,5.0769231 0 0 1 5.9230769,11 5.0769231,5.0769231 0 0 1 11,5.9230769 Z"/> + <path style="fill:#ffffff" d="M 11,10.410156 V 14 h 1 V 10.410156 A 1.5,1.5 0 0 1 11.5,10.5 1.5,1.5 0 0 1 11,10.410156 Z"/> + <path style="fill:#ffffff" d="m 13.92895,8 h 1 L 12.3,14 h -1 z"/> + <path style="opacity:0.2" d="M 5.0859375,7.5019531 C 4.7166486,7.5095131 4.3857845,7.5468071 4.0996094,7.6191406 3.5908542,7.7477316 3.16591,8.0014688 3.0371094,8.4960938 2.9083084,8.9907183 3.1373532,9.492266 3.4941406,9.947266 3.7722382,10.301914 4.4997487,10.832068 5.0078125,11.216797 5.0214895,10.921995 5.0566015,10.63375 5.1113281,10.351562 4.751879,10.066543 4.1825448,9.660671 4.0136719,9.445313 3.7343179,9.089062 3.6872945,8.8577481 3.7148438,8.7519531 3.7423928,8.6461586 3.8907222,8.4893549 4.2890625,8.3886719 4.6874019,8.2879889 5.2807146,8.2607121 6,8.3222656 c 1.4385712,0.123107 3.387144,0.5919496 5.46875,1.3769534 2.081606,0.785003 3.902899,1.740054 5.142578,2.626953 0.61984,0.443449 1.095646,0.872264 1.375,1.228516 0.279353,0.356249 0.326378,0.587564 0.298828,0.693359 -0.02755,0.105795 -0.175878,0.262598 -0.574218,0.363281 -0.242816,0.06137 -1.007389,0.03264 -1.585938,0.0098 -0.16587,0.271812 -0.352953,0.528429 -0.558594,0.769531 0.788474,0.05519 1.896167,0.100399 2.332032,-0.0098 0.508753,-0.128592 0.937605,-0.382329 1.066406,-0.876953 0.128801,-0.494625 -0.104151,-0.996172 -0.460938,-1.451172 C 18.147118,12.597735 17.628125,12.138305 16.970703,11.667969 15.655861,10.727283 13.793224,9.756063 11.664062,8.953125 9.534898,8.150188 7.5433721,7.6676809 6.0175781,7.5371094 5.8268541,7.5207894 5.6444818,7.5092212 5.46875,7.5039062 5.3369509,7.4999175 5.2090338,7.4994325 5.0859375,7.5019531 Z"/> + <path style="fill:#59d4f1" d="M 5.0859375,7.0019531 C 4.7166486,7.0095131 4.3857845,7.0468071 4.0996094,7.1191406 3.5908542,7.2477316 3.16591,7.5014688 3.0371094,7.9960938 2.9083084,8.4907183 3.1373532,8.9922661 3.4941406,9.447266 3.7722382,9.801914 4.4997487,10.332068 5.0078125,10.716797 5.0214895,10.421995 5.0566015,10.13375 5.1113281,9.851562 4.751879,9.566543 4.1825448,9.160671 4.0136719,8.9453125 3.7343179,8.589062 3.6872945,8.3577481 3.7148438,8.2519531 3.7423928,8.1461586 3.8907222,7.9893549 4.2890625,7.8886719 4.6874019,7.7879889 5.2807146,7.7607121 6,7.8222656 c 1.4385712,0.123107 3.387144,0.5919496 5.46875,1.3769534 2.081606,0.785003 3.902899,1.740054 5.142578,2.626953 0.61984,0.443449 1.095646,0.872264 1.375,1.228516 0.279353,0.356249 0.326378,0.587564 0.298828,0.693359 -0.02755,0.105795 -0.175878,0.262598 -0.574218,0.363281 -0.242816,0.06137 -1.007389,0.03264 -1.585938,0.0098 -0.16587,0.271812 -0.352953,0.528429 -0.558594,0.769531 0.788474,0.05519 1.896167,0.100399 2.332032,-0.0098 0.508753,-0.128592 0.937605,-0.382329 1.066406,-0.876953 0.128801,-0.494625 -0.104151,-0.996172 -0.460938,-1.451172 C 18.147118,12.097735 17.628125,11.638305 16.970703,11.167969 15.655861,10.227283 13.793224,9.256063 11.664062,8.453125 9.534898,7.650188 7.5433721,7.1676809 6.0175781,7.0371094 5.8268541,7.0207894 5.6444818,7.0092212 5.46875,7.0039062 5.3369509,6.9999175 5.2090338,6.9994325 5.0859375,7.0019531 Z"/> + <circle style="opacity:0.2" cx="11.5" cy="9.5" r="1"/> + <circle style="fill:#ffffff" cx="11.5" cy="9" r="1"/> +</svg> 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 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" version="1.1"> + <circle style="opacity:0.2" cx="12" cy="12.5" r="10"/> + <circle style="fill:#4f4f4f" cx="12" cy="12" r="10"/> + <path style="opacity:0.2" d="M 9.5878906,9.5 8.5,15.5 h 1 3.472656 H 13 13.300781 l 2.628907,-6 h -1 L 13,13.904297 V 11.910156 A 1.5,1.5 0 0 1 12.5,12 1.5,1.5 0 0 1 12,11.910156 V 14.5 H 9.6816406 l 0.9062504,-5 z"/> + <path style="opacity:0.2" d="m 12,6.5 a 6,6 0 0 0 -6,6 6,6 0 0 0 6,6 6,6 0 0 0 6,-6 6,6 0 0 0 -6,-6 z m 0,0.9230769 A 5.0769231,5.0769231 0 0 1 17.076923,12.5 5.0769231,5.0769231 0 0 1 12,17.576923 5.0769231,5.0769231 0 0 1 6.9230769,12.5 5.0769231,5.0769231 0 0 1 12,7.4230769 Z"/> + <path style="fill:#ffffff" d="M 9.5884825,9 H 10.588483 L 9.5,15 h -1 z"/> + <path style="opacity:0.1;fill:#ffffff" d="M 12,2 A 10,10 0 0 0 2,12 10,10 0 0 0 2.01075,12.291 10,10 0 0 1 12,2.5 10,10 0 0 1 21.9895,12.209 10,10 0 0 0 22,12 10,10 0 0 0 12,2 Z"/> + <path style="fill:#ffffff" d="m 12.973536,14 v 1 H 8.5000005 L 8.8,14 Z"/> + <path style="fill:#6f6fee" d="m 12,6 a 6,6 0 0 0 -6,6 6,6 0 0 0 6,6 6,6 0 0 0 6,-6 6,6 0 0 0 -6,-6 z m 0,0.9230769 A 5.0769231,5.0769231 0 0 1 17.076923,12 5.0769231,5.0769231 0 0 1 12,17.076923 5.0769231,5.0769231 0 0 1 6.9230769,12 5.0769231,5.0769231 0 0 1 12,6.9230769 Z"/> + <path style="fill:#ffffff" d="M 12 11.410156 L 12 15 L 13 15 L 13 11.410156 A 1.5 1.5 0 0 1 12.5 11.5 A 1.5 1.5 0 0 1 12 11.410156 z"/> + <path style="fill:#ffffff" d="m 14.92895,9 h 1 L 13.3,15 h -1 z"/> + <path style="opacity:0.2" d="m 6.0859375,8.5019531 c -0.3692889,0.00756 -0.700153,0.044854 -0.9863281,0.1171875 -0.5087552,0.128591 -0.9336994,0.3823282 -1.0625,0.8769532 -0.128801,0.4946245 0.1002438,0.9961722 0.4570312,1.4511722 0.2780976,0.354648 1.0056081,0.884802 1.5136719,1.269531 0.013677,-0.294802 0.048789,-0.583047 0.1035156,-0.865235 C 5.751879,11.066543 5.1825448,10.660671 5.0136719,10.445313 4.7343179,10.089062 4.6872945,9.8577481 4.7148438,9.7519531 4.7423928,9.6461586 4.8907222,9.4893549 5.2890625,9.3886719 5.6874019,9.2879889 6.2807146,9.2607121 7,9.3222656 c 1.4385712,0.123107 3.387144,0.5919496 5.46875,1.3769534 2.081606,0.785003 3.902899,1.740054 5.142578,2.626953 0.61984,0.443449 1.095646,0.872264 1.375,1.228516 0.279353,0.356249 0.326378,0.587564 0.298828,0.693359 -0.02755,0.105795 -0.175878,0.262598 -0.574218,0.363281 -0.242816,0.06137 -1.007389,0.03264 -1.585938,0.0098 -0.16587,0.271812 -0.352953,0.528429 -0.558594,0.769531 0.788474,0.05519 1.896167,0.100399 2.332032,-0.0098 0.508753,-0.128592 0.937605,-0.382329 1.066406,-0.876953 0.128801,-0.494625 -0.104151,-0.996172 -0.460938,-1.451172 C 19.147118,13.597735 18.628125,13.138305 17.970703,12.667969 16.655861,11.727283 14.793224,10.756063 12.664062,9.953125 10.534898,9.150188 8.5433721,8.6676809 7.0175781,8.5371094 6.8268541,8.5207894 6.6444818,8.5092212 6.46875,8.5039062 6.3369509,8.4999175 6.2090338,8.4994325 6.0859375,8.5019531 Z"/> + <path style="fill:#59d4f1" d="M 6.0859375 8.0019531 C 5.7166486 8.009515 5.3857845 8.0468072 5.0996094 8.1191406 C 4.5908542 8.2477316 4.16591 8.5014688 4.0371094 8.9960938 C 3.9083084 9.4907183 4.1373532 9.9922661 4.4941406 10.447266 C 4.7722382 10.801914 5.4997487 11.332068 6.0078125 11.716797 C 6.0214896 11.421995 6.0566018 11.13375 6.1113281 10.851562 C 5.751879 10.566543 5.1825448 10.160671 5.0136719 9.9453125 C 4.7343179 9.589062 4.6872945 9.3577481 4.7148438 9.2519531 C 4.7423928 9.1461586 4.8907222 8.9893549 5.2890625 8.8886719 C 5.6874019 8.7879889 6.2807146 8.7607121 7 8.8222656 C 8.4385712 8.9453726 10.387144 9.4142152 12.46875 10.199219 C 14.550356 10.984222 16.371649 11.939273 17.611328 12.826172 C 18.231168 13.269621 18.706974 13.698436 18.986328 14.054688 C 19.265681 14.410937 19.312706 14.642252 19.285156 14.748047 C 19.257606 14.853842 19.109278 15.010645 18.710938 15.111328 C 18.468122 15.172698 17.703549 15.14397 17.125 15.121094 C 16.95913 15.392906 16.772047 15.649523 16.566406 15.890625 C 17.35488 15.94582 18.462573 15.991024 18.898438 15.880859 C 19.407191 15.752267 19.836043 15.49853 19.964844 15.003906 C 20.093645 14.509281 19.860693 14.007734 19.503906 13.552734 C 19.147118 13.097735 18.628125 12.638305 17.970703 12.167969 C 16.655861 11.227283 14.793224 10.256063 12.664062 9.453125 C 10.534898 8.650188 8.5433721 8.1676809 7.0175781 8.0371094 C 6.8268541 8.0207894 6.6444818 8.0092212 6.46875 8.0039062 C 6.3369509 7.9999175 6.2090338 7.9994325 6.0859375 8.0019531 z"/> + <circle style="opacity:0.2" cx="12.5" cy="10.5" r="1"/> + <circle style="fill:#ffffff" cx="12.5" cy="10" r="1"/> +</svg> 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 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" version="1.1"> + <circle style="opacity:0.2" cx="16" cy="17" r="14"/> + <circle style="fill:#4f4f4f" cx="16" cy="16" r="14"/> + <path style="opacity:0.2" d="m 12.623047,13 -1.523438,9 h 1 5.263672 0.15625 l 3.681641,-9 H 20.099609 L 17,20.582031 v -4.703125 c -0.156609,0.07489 -0.325175,0.115235 -0.5,0.115235 -0.174825,0 -0.343391,-0.04035 -0.5,-0.115235 V 21 h -3.730469 l 1.353516,-8 z"/> + <path style="opacity:0.2" d="m 16,8 a 9,9 0 0 0 -9,9 9,9 0 0 0 9,9 9,9 0 0 0 9,-9 9,9 0 0 0 -9,-9 z m 0,1 a 7.9999999,7.9999999 0 0 1 8,8 7.9999999,7.9999999 0 0 1 -8,8 7.9999999,7.9999999 0 0 1 -8,-8 7.9999999,7.9999999 0 0 1 8,-8 z"/> + <path style="fill:#ffffff" d="m 12.623876,12 h 1.000062 l -1.523876,9 H 11.1 Z"/> + <path style="fill:#ffffff" d="m 17.36295,20 v 1 H 11.100001 L 11.52,20 Z"/> + <path style="fill:#6f6fee" d="M 16 7 A 9 9 0 0 0 7 16 A 9 9 0 0 0 16 25 A 9 9 0 0 0 25 16 A 9 9 0 0 0 16 7 z M 16 8 A 7.9999999 7.9999999 0 0 1 24 16 A 7.9999999 7.9999999 0 0 1 16 24 A 7.9999999 7.9999999 0 0 1 8 16 A 7.9999999 7.9999999 0 0 1 16 8 z"/> + <path style="fill:#ffffff" d="M 16,14.878 V 21 h 1 v -6.122 c -0.156609,0.07489 -0.325175,0.116001 -0.5,0.116001 -0.174825,0 -0.343391,-0.04112 -0.5,-0.116001 z"/> + <path style="fill:#ffffff" d="m 20.100529,12 h 1.099735 l -3.680529,9 H 16.42 Z"/> + <path style="opacity:0.2" d="m 7.8671875,11.001953 c -0.5077723,0.0104 -0.9600248,0.06265 -1.3535156,0.162109 -0.6995383,0.176815 -1.2877432,0.524962 -1.4648438,1.205079 -0.1771015,0.680116 0.1383235,1.370461 0.6289063,1.996093 0.3535818,0.450916 0.8387175,0.906463 1.4140625,1.367188 0.054036,-0.383267 0.1297372,-0.758831 0.2304687,-1.125 C 6.936014,14.274886 6.6151218,13.957096 6.3945312,13.675781 6.0104195,13.18593 5.9445418,12.868126 5.9824219,12.722656 c 0.03788,-0.145468 0.2432978,-0.361559 0.7910156,-0.5 0.5477168,-0.13844 1.3625452,-0.176431 2.3515625,-0.0918 1.978035,0.169274 4.657324,0.813185 7.519531,1.892579 2.862208,1.07939 5.367708,2.391827 7.072266,3.611328 0.85228,0.609749 1.50456,1.199602 1.888672,1.689453 0.38411,0.489849 0.449988,0.807655 0.412109,0.953125 -0.03788,0.14547 -0.243297,0.361559 -0.791016,0.5 -0.297281,0.07514 -0.678568,0.117262 -1.11914,0.128906 -0.181389,0.375764 -0.385371,0.737546 -0.615234,1.082031 0.77116,0.03049 1.443228,-0.01309 1.99414,-0.152343 0.699539,-0.176816 1.287743,-0.526914 1.464844,-1.207032 0.177101,-0.680117 -0.14223,-1.370461 -0.632813,-1.996094 -0.490583,-0.62563 -1.20542,-1.257576 -2.109375,-1.904296 -1.807909,-1.29344 -4.369276,-2.628372 -7.296875,-3.732422 -2.9276,-1.104052 -5.665705,-1.767727 -7.7636715,-1.947266 -0.2622456,-0.02244 -0.5142281,-0.03566 -0.7558594,-0.04297 -0.1812237,-0.0055 -0.3561332,-0.0074 -0.5253906,-0.0039 z"/> + <path style="fill:#59d4f1" d="M 7.8671875 10.001953 C 7.3594152 10.01235 6.9071627 10.064605 6.5136719 10.164062 C 5.8141336 10.340877 5.2259287 10.689024 5.0488281 11.369141 C 4.8717266 12.049257 5.1871516 12.739602 5.6777344 13.365234 C 6.0313162 13.81615 6.5164519 14.271697 7.0917969 14.732422 C 7.1458329 14.349155 7.2215341 13.973591 7.3222656 13.607422 C 6.936014 13.274886 6.6151218 12.957096 6.3945312 12.675781 C 6.0104195 12.18593 5.9445418 11.868126 5.9824219 11.722656 C 6.0203019 11.577188 6.2257197 11.361097 6.7734375 11.222656 C 7.3211543 11.084216 8.1359827 11.046225 9.125 11.130859 C 11.103035 11.300133 13.782324 11.944044 16.644531 13.023438 C 19.506739 14.102828 22.012239 15.415265 23.716797 16.634766 C 24.569077 17.244515 25.221357 17.834368 25.605469 18.324219 C 25.989579 18.814068 26.055457 19.131874 26.017578 19.277344 C 25.979698 19.422814 25.774281 19.638903 25.226562 19.777344 C 24.929281 19.852484 24.547994 19.894606 24.107422 19.90625 C 23.926033 20.282014 23.722051 20.643796 23.492188 20.988281 C 24.263348 21.018773 24.935416 20.975188 25.486328 20.835938 C 26.185867 20.659122 26.774071 20.309024 26.951172 19.628906 C 27.128273 18.948789 26.808942 18.258445 26.318359 17.632812 C 25.827776 17.007182 25.112939 16.375236 24.208984 15.728516 C 22.401075 14.435076 19.839708 13.100144 16.912109 11.996094 C 13.984509 10.892042 11.246404 10.228367 9.1484375 10.048828 C 8.8861919 10.026388 8.6342094 10.013169 8.3925781 10.005859 C 8.2113544 10.000372 8.0364449 9.9984875 7.8671875 10.001953 z"/> + <circle style="opacity:0.2" cx="16.5" cy="13.5" r="1.5"/> + <circle style="fill:#ffffff" cx="16.5" cy="12.5" r="1.5"/> + <path style="fill:#ffffff;opacity:0.1" d="M 16 2 A 14 14 0 0 0 2 16 A 14 14 0 0 0 2.0351562 16.5 A 14 14 0 0 1 16 3 A 14 14 0 0 1 29.980469 16.279297 A 14 14 0 0 0 30 16 A 14 14 0 0 0 16 2 z"/> +</svg> 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 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" version="1.1"> + <circle style="opacity:0.2" cx="24" cy="25" r="20"/> + <circle style="fill:#4f4f4f" cx="24" cy="24" r="20"/> + <path style="opacity:0.2" d="M 19.177734,19 17,32 H 19 25.947266 26 26.599609 l 5.257813,-13 h -2 L 26,28.537109 V 22.826172 C 25.686781,22.938378 25.34965,23 25,23 24.65035,23 24.313219,22.938378 24,22.826172 V 30 h -4.664062 l 1.841796,-11 z"/> + <path style="opacity:0.2" d="M 24,12 A 13,13 0 0 0 11,25 13,13 0 0 0 24,38 13,13 0 0 0 37,25 13,13 0 0 0 24,12 Z m 0,2 A 11,11 0 0 1 35,25 11,11 0 0 1 24,36 11,11 0 0 1 13,25 11,11 0 0 1 24,14 Z"/> + <path style="fill:#ffffff" d="m 19.176965,18 h 2 L 19,31 h -2 z"/> + <path style="opacity:0.1;fill:#ffffff" d="M 24,4 A 20,20 0 0 0 4,24 20,20 0 0 0 4.0215,24.582 20,20 0 0 1 24,5 20,20 0 0 1 43.979,24.418 20,20 0 0 0 44,24 20,20 0 0 0 24,4 Z"/> + <path style="fill:#ffffff" transform="rotate(90)" d="m 29,-25.947071 h 2 v 8.94707 L 29,-17.6 Z"/> + <path style="fill:#6f6fee" d="M 24 11 A 13 13 0 0 0 11 24 A 13 13 0 0 0 24 37 A 13 13 0 0 0 37 24 A 13 13 0 0 0 24 11 z M 24 13 A 11 11 0 0 1 35 24 A 11 11 0 0 1 24 35 A 11 11 0 0 1 13 24 A 11 11 0 0 1 24 13 z"/> + <path style="fill:#ffffff" d="M 24 21.826172 L 24 31 L 26 31 L 26 21.826172 C 25.686781 21.938378 25.34965 22 25 22 C 24.65035 22 24.313219 21.938378 24 21.826172 z"/> + <path style="fill:#ffffff" d="m 29.857899,18 h 2 L 26.6,31 h -2 z"/> + <path style="opacity:0.2" d="m 12.589844,17.007812 c -1.087361,-0.03191 -2.033318,0.03758 -2.8203128,0.230469 -1.0493252,0.257182 -1.9296569,0.764657 -2.1953124,1.753907 -0.2656566,0.989249 0.2074728,1.994297 0.9433593,2.904296 0.6108665,0.755397 1.467085,1.517943 2.5117189,2.292969 C 11.065328,23.604184 11.13905,23.030537 11.25,22.46875 10.545728,21.903038 9.9733934,21.364462 9.5917969,20.892578 9.0156194,20.180077 8.9177885,19.717449 8.9746094,19.505859 9.0314304,19.29427 9.3385655,18.97871 10.160156,18.777344 c 0.821589,-0.201366 2.043793,-0.253967 3.527344,-0.13086 2.967103,0.246214 6.985914,1.181947 11.279297,2.751954 4.293384,1.570005 8.050542,3.478156 10.607422,5.251953 1.278442,0.886898 2.257807,1.744529 2.833984,2.457031 0.576176,0.7125 0.674009,1.17513 0.617188,1.386719 -0.05682,0.21159 -0.363957,0.527149 -1.185547,0.728515 -0.628279,0.153987 -1.494373,0.21928 -2.529297,0.1875 -0.30129,0.530516 -0.637404,1.038934 -1.007813,1.519532 1.561087,0.127738 2.882793,0.08766 3.925782,-0.167969 1.049325,-0.257183 1.931608,-0.766611 2.197265,-1.75586 0.265656,-0.98925 -0.211379,-1.992344 -0.947265,-2.902343 -0.735888,-0.909998 -1.808108,-1.82886 -3.164063,-2.769532 -2.711908,-1.881345 -6.553839,-3.823812 -10.945312,-5.429687 -4.391472,-1.605874 -8.499482,-2.570888 -11.646485,-2.832031 -0.393375,-0.03264 -0.770359,-0.05382 -1.132812,-0.06445 z"/> + <path style="fill:#59d4f1" d="M 12.589844 16.007812 C 11.502483 15.975907 10.556526 16.045394 9.7695312 16.238281 C 8.720206 16.495463 7.8398743 17.002938 7.5742188 17.992188 C 7.3085622 18.981437 7.7816916 19.986485 8.5175781 20.896484 C 9.1284446 21.651881 9.9846631 22.414427 11.029297 23.189453 C 11.065328 22.604184 11.13905 22.030537 11.25 21.46875 C 10.545728 20.903038 9.9733934 20.364462 9.5917969 19.892578 C 9.0156194 19.180077 8.9177885 18.717449 8.9746094 18.505859 C 9.0314304 18.29427 9.3385655 17.97871 10.160156 17.777344 C 10.981745 17.575978 12.203949 17.523377 13.6875 17.646484 C 16.654603 17.892698 20.673414 18.828431 24.966797 20.398438 C 29.260181 21.968443 33.017339 23.876594 35.574219 25.650391 C 36.852661 26.537289 37.832026 27.39492 38.408203 28.107422 C 38.984379 28.819922 39.082212 29.282552 39.025391 29.494141 C 38.968571 29.705731 38.661434 30.02129 37.839844 30.222656 C 37.211565 30.376643 36.345471 30.441936 35.310547 30.410156 C 35.009257 30.940672 34.673143 31.44909 34.302734 31.929688 C 35.863821 32.057426 37.185527 32.017349 38.228516 31.761719 C 39.277841 31.504536 40.160124 30.995108 40.425781 30.005859 C 40.691437 29.016609 40.214402 28.013515 39.478516 27.103516 C 38.742628 26.193518 37.670408 25.274656 36.314453 24.333984 C 33.602545 22.452639 29.760614 20.510172 25.369141 18.904297 C 20.977669 17.298423 16.869659 16.333409 13.722656 16.072266 C 13.329281 16.039623 12.952297 16.018448 12.589844 16.007812 z"/> + <circle style="opacity:0.2" cx="25" cy="20" r="2"/> + <circle style="fill:#ffffff" cx="25" cy="19" r="2"/> +</svg> 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 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" version="1.1"> + <circle style="opacity:0.2" cx="32" cy="33" r="28"/> + <circle style="fill:#4f4f4f" cx="32" cy="32" r="28"/> + <path style="opacity:0.2" d="M 25.248047,25 22.199219,43 H 25 34.726562 35.640625 L 43.001953,25 H 40.201172 L 35,37.71875 v -7.761719 c -0.469829,0.157088 -0.975524,0.242188 -1.5,0.242188 -0.524476,0 -1.030171,-0.0851 -1.5,-0.242188 V 40 h -6.492188 l 2.539063,-15 z"/> + <path style="opacity:0.2" d="M 32,15 A 18,18 0 0 0 14,33 18,18 0 0 0 32,51 18,18 0 0 0 50,33 18,18 0 0 0 32,15 Z m 0,3 A 15,15 0 0 1 47,33 15,15 0 0 1 32,48 15,15 0 0 1 17,33 15,15 0 0 1 32,18 Z"/> + <path style="fill:#ffffff" d="m 25.247751,24 h 2.8 L 25,42 h -2.8 z"/> + <path style="fill:#ffffff" d="m 34.725899,39 v 3 H 22.200001 L 23.04,39 Z"/> + <path style="fill:#6f6fee" d="M 32 14 A 18 18 0 0 0 14 32 A 18 18 0 0 0 32 50 A 18 18 0 0 0 50 32 A 18 18 0 0 0 32 14 z M 32 17 A 15 15 0 0 1 47 32 A 15 15 0 0 1 32 47 A 15 15 0 0 1 17 32 A 15 15 0 0 1 32 17 z"/> + <path style="fill:#ffffff" d="M 32,28.956641 V 41.8 h 3 V 28.956641 C 34.530171,29.113729 34.024476,29.2 33.5,29.2 32.975524,29.2 32.469829,29.11373 32,28.956641 Z"/> + <path style="fill:#ffffff" d="m 40.201059,24 h 2.8 L 35.64,42 h -2.8 z"/> + <path style="opacity:0.2" d="m 14.996094,22.003906 c -1.061706,0.02079 -2.009278,0.123345 -2.832032,0.322266 -1.462671,0.353629 -2.690245,1.051874 -3.0605464,2.412109 -0.3703029,1.360234 0.2906429,2.742877 1.3164064,3.994141 0.835691,1.019402 2.194435,2.048482 3.621094,3.09375 0.05184,-0.804762 0.15637,-1.594664 0.310546,-2.367188 -0.955946,-0.755084 -1.917855,-1.475923 -2.435546,-2.107422 -0.803143,-0.9797 -0.938579,-1.615311 -0.859375,-1.90625 0.0792,-0.290939 0.507115,-0.725071 1.652343,-1.001953 1.145226,-0.276882 2.848071,-0.348962 4.916016,-0.179687 4.135892,0.338547 9.738042,1.624417 15.722656,3.783203 5.984616,2.158783 11.22108,4.783657 14.785156,7.222656 1.782041,1.2195 3.148029,2.397251 3.951172,3.376953 0.803141,0.979699 0.940533,1.617265 0.861328,1.908204 -0.07921,0.290939 -0.509069,0.725072 -1.654296,1.001953 -0.849354,0.205348 -2.199135,0.292392 -3.595704,0.257812 -0.412148,0.732269 -0.875734,1.431516 -1.382812,2.095703 2.118497,0.160889 4.101812,0.104952 5.521484,-0.238281 1.462671,-0.353632 2.692197,-1.05383 3.0625,-2.414063 0.370302,-1.360236 -0.294548,-2.73897 -1.320312,-3.990234 -1.025766,-1.251262 -2.520069,-2.515155 -4.410156,-3.808594 -3.780171,-2.58688 -9.136469,-5.258694 -15.257813,-7.466796 -6.121342,-2.208104 -11.847717,-3.533503 -16.234375,-3.892579 -0.548332,-0.04488 -1.072896,-0.07522 -1.578125,-0.08984 -0.378922,-0.01097 -0.745707,-0.01279 -1.099609,-0.0059 z"/> + <path style="fill:#59d4f1" d="M 14.996094 21.003906 C 13.934388 21.0247 12.986816 21.127251 12.164062 21.326172 C 10.701391 21.679801 9.473817 22.378046 9.1035156 23.738281 C 8.7332127 25.098515 9.3941585 26.481158 10.419922 27.732422 C 11.255613 28.751824 12.614357 29.780904 14.041016 30.826172 C 14.09286 30.02141 14.197386 29.231508 14.351562 28.458984 C 13.395616 27.7039 12.433707 26.983061 11.916016 26.351562 C 11.112873 25.371862 10.977437 24.736251 11.056641 24.445312 C 11.135841 24.154373 11.563756 23.720241 12.708984 23.443359 C 13.85421 23.166477 15.557055 23.094397 17.625 23.263672 C 21.760892 23.602219 27.363042 24.888089 33.347656 27.046875 C 39.332272 29.205658 44.568736 31.830532 48.132812 34.269531 C 49.914853 35.489031 51.280841 36.666782 52.083984 37.646484 C 52.887125 38.626183 53.024517 39.263749 52.945312 39.554688 C 52.866102 39.845627 52.436243 40.27976 51.291016 40.556641 C 50.441662 40.761989 49.091881 40.849033 47.695312 40.814453 C 47.283164 41.546722 46.819578 42.245969 46.3125 42.910156 C 48.430997 43.071045 50.414312 43.015108 51.833984 42.671875 C 53.296655 42.318243 54.526181 41.618045 54.896484 40.257812 C 55.266786 38.897576 54.601936 37.518842 53.576172 36.267578 C 52.550406 35.016316 51.056103 33.752423 49.166016 32.458984 C 45.385845 29.872104 40.029547 27.20029 33.908203 24.992188 C 27.786861 22.784084 22.060486 21.458685 17.673828 21.099609 C 17.125496 21.054729 16.600932 21.024386 16.095703 21.009766 C 15.716781 20.998796 15.349996 20.996975 14.996094 21.003906 z"/> + <circle style="opacity:0.2" cx="33.5" cy="26.5" r="2.5"/> + <circle style="fill:#ffffff" cx="33.5" cy="25.5" r="2.5"/> + <path style="fill:#ffffff;opacity:0.1" d="M 32 4 A 28 28 0 0 0 4 32 A 28 28 0 0 0 4.0351562 32.5 A 28 28 0 0 1 32 5 A 28 28 0 0 1 59.982422 32.251953 A 28 28 0 0 0 60 32 A 28 28 0 0 0 32 4 z"/> +</svg> 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 <Path to this file> <Path to Lunarvim basedir> -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 [<options>]" + 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 [<options>]" + 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 "$@" |
