diff options
Diffstat (limited to 'mac/.config/LunarVim/utils/bin')
| -rwxr-xr-x | mac/.config/LunarVim/utils/bin/jdtls | 62 | ||||
| -rw-r--r-- | mac/.config/LunarVim/utils/bin/lvim.ps1 | 13 | ||||
| -rw-r--r-- | mac/.config/LunarVim/utils/bin/lvim.template | 11 |
3 files changed, 86 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" "$@" |
