Remove needless env variables and path folders

main
Ensar Sarajčić 2022-05-15 15:32:26 +02:00
parent 28dea1a5bb
commit 52d1d4b356
8 changed files with 47 additions and 177 deletions

View File

@ -178,6 +178,8 @@ VERSION="${POSITIONAL[2]}"
echov "Detected server: $SERVER" echov "Detected server: $SERVER"
echov "Detected version: $VERSION" echov "Detected version: $VERSION"
LSP_HOME="$HOME/.local/opt"
declare -A SUPPORTED_SERVERS=( declare -A SUPPORTED_SERVERS=(
["java"]="jdtls" ["java"]="jdtls"
["dotnet"]="omnisharp" ["dotnet"]="omnisharp"
@ -189,12 +191,12 @@ declare -A SUPPORTED_SERVERS=(
["zig"]="zls" ["zig"]="zls"
) )
declare -A LINK_SOURCES=( declare -A LINK_SOURCES=(
["omnisharp"]="$HOME/lsp/dotnet/omnisharp/run" ["omnisharp"]="$LSP_HOME/dotnet/omnisharp/run"
["solang"]="$HOME/lsp/solidity/solang/solang" ["solang"]="$LSP_HOME/solidity/solang/solang"
["lemminx"]="$HOME/lsp/xml/lemminx/lemminx" ["lemminx"]="$LSP_HOME/xml/lemminx/lemminx"
["kotlin-language-server"]="$HOME/lsp/kotlin/kotlin-language-server/bin/kotlin-language-server" ["kotlin-language-server"]="$LSP_HOME/kotlin/kotlin-language-server/bin/kotlin-language-server"
["rust-analyzer"]="$HOME/lsp/rust/rust-analyzer/rust-analyzer" ["rust-analyzer"]="$LSP_HOME/rust/rust-analyzer/rust-analyzer"
["zls"]="$HOME/lsp/zig/zls/zls" ["zls"]="$LSP_HOME/zig/zls/zls"
) )
declare -A LINK_TARGETS=( declare -A LINK_TARGETS=(
["omnisharp"]="$HOME/.local/bin/omnisharp" ["omnisharp"]="$HOME/.local/bin/omnisharp"
@ -255,8 +257,8 @@ link_server () {
exit 0 exit 0
;; ;;
hls) hls)
SOURCE_TO_CHECK="$HOME/lsp/haskell/hls/haskell-language-server-wrapper" SOURCE_TO_CHECK="$LSP_HOME/haskell/hls/haskell-language-server-wrapper"
SOURCE="$HOME/lsp/haskell/hls/*" SOURCE="$LSP_HOME/haskell/hls/*"
TARGET="$HOME/.local/bin" TARGET="$HOME/.local/bin"
;; ;;
*) *)
@ -301,8 +303,8 @@ install () {
fi fi
FILE_NAME=$(curl https://download.eclipse.org/jdtls/milestones/$VERSION/latest.txt) FILE_NAME=$(curl https://download.eclipse.org/jdtls/milestones/$VERSION/latest.txt)
wget -O - https://download.eclipse.org/jdtls/milestones/$VERSION/$FILE_NAME > /tmp/jdtls.tar.gz wget -O - https://download.eclipse.org/jdtls/milestones/$VERSION/$FILE_NAME > /tmp/jdtls.tar.gz
mkdir -p $HOME/lsp/java/jdtls mkdir -p $LSP_HOME/java/jdtls
tar -xf /tmp/jdtls.tar.gz -C $HOME/lsp/java/jdtls tar -xf /tmp/jdtls.tar.gz -C $LSP_HOME/java/jdtls
;; ;;
omnisharp) omnisharp)
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
@ -317,8 +319,8 @@ install () {
;; ;;
esac esac
wget -O - https://github.com/OmniSharp/omnisharp-roslyn/releases/download/$VERSION/$FILE_NAME > /tmp/omnisharp.tar.gz wget -O - https://github.com/OmniSharp/omnisharp-roslyn/releases/download/$VERSION/$FILE_NAME > /tmp/omnisharp.tar.gz
mkdir -p $HOME/lsp/dotnet/omnisharp mkdir -p $LSP_HOME/dotnet/omnisharp
tar -xf /tmp/omnisharp.tar.gz -C $HOME/lsp/dotnet/omnisharp tar -xf /tmp/omnisharp.tar.gz -C $LSP_HOME/dotnet/omnisharp
;; ;;
hls) hls)
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
@ -333,9 +335,9 @@ install () {
;; ;;
esac esac
wget -O - https://github.com/haskell/haskell-language-server/releases/download/$VERSION/$FILE_NAME > /tmp/hls.tar.gz wget -O - https://github.com/haskell/haskell-language-server/releases/download/$VERSION/$FILE_NAME > /tmp/hls.tar.gz
mkdir -p $HOME/lsp/haskell/hls mkdir -p $LSP_HOME/haskell/hls
tar -xf /tmp/hls.tar.gz -C $HOME/lsp/haskell/hls tar -xf /tmp/hls.tar.gz -C $LSP_HOME/haskell/hls
chmod +x $HOME/lsp/haskell/hls/* chmod +x $LSP_HOME/haskell/hls/*
;; ;;
solang) solang)
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
@ -352,9 +354,9 @@ install () {
FILE_NAME="solang-mac-intel" FILE_NAME="solang-mac-intel"
;; ;;
esac esac
mkdir -p $HOME/lsp/solidity/solang mkdir -p $LSP_HOME/solidity/solang
wget -O - https://github.com/hyperledger-labs/solang/releases/download/$VERSION/$FILE_NAME > $HOME/lsp/solidity/solang/solang wget -O - https://github.com/hyperledger-labs/solang/releases/download/$VERSION/$FILE_NAME > $LSP_HOME/solidity/solang/solang
chmod +x $HOME/lsp/solidity/solang/solang chmod +x $LSP_HOME/solidity/solang/solang
;; ;;
lemminx) lemminx)
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
@ -371,11 +373,11 @@ install () {
FILE_NAME="lemminx-osx-x86_64.zip" FILE_NAME="lemminx-osx-x86_64.zip"
;; ;;
esac esac
mkdir -p $HOME/lsp/xml/lemminx mkdir -p $LSP_HOME/xml/lemminx
wget -O - https://download.jboss.org/jbosstools/vscode/stable/lemminx-binary/$VERSION/$FILE_NAME > /tmp/lemminx-download.zip wget -O - https://download.jboss.org/jbosstools/vscode/stable/lemminx-binary/$VERSION/$FILE_NAME > /tmp/lemminx-download.zip
unzip -p /tmp/lemminx-download.zip > $HOME/lsp/xml/lemminx/lemminx unzip -p /tmp/lemminx-download.zip > $LSP_HOME/xml/lemminx/lemminx
chmod +x $HOME/lsp/xml/lemminx/lemminx chmod +x $LSP_HOME/xml/lemminx/lemminx
;; ;;
kotlin-language-server) kotlin-language-server)
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
@ -383,9 +385,9 @@ install () {
fi fi
FILE_NAME="server.zip" FILE_NAME="server.zip"
wget -O - https://github.com/fwcd/kotlin-language-server/releases/download/$VERSION/$FILE_NAME > /tmp/kotlin-language-server.zip wget -O - https://github.com/fwcd/kotlin-language-server/releases/download/$VERSION/$FILE_NAME > /tmp/kotlin-language-server.zip
mkdir -p $HOME/lsp/kotlin mkdir -p $LSP_HOME/kotlin
unzip /tmp/kotlin-language-server.zip -d /tmp/kotlin-language-server unzip /tmp/kotlin-language-server.zip -d /tmp/kotlin-language-server
mv /tmp/kotlin-language-server/server $HOME/lsp/kotlin/kotlin-language-server mv /tmp/kotlin-language-server/server $LSP_HOME/kotlin/kotlin-language-server
;; ;;
rust-analyzer) rust-analyzer)
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
@ -404,9 +406,9 @@ install () {
;; ;;
esac esac
wget -O - https://github.com/rust-analyzer/rust-analyzer/releases/download/$VERSION/$FILE_NAME > /tmp/rust-analyzer.gz wget -O - https://github.com/rust-analyzer/rust-analyzer/releases/download/$VERSION/$FILE_NAME > /tmp/rust-analyzer.gz
mkdir -p $HOME/lsp/rust/rust-analyzer mkdir -p $LSP_HOME/rust/rust-analyzer
gunzip /tmp/rust-analyzer.gz -c > $HOME/lsp/rust/rust-analyzer/rust-analyzer gunzip /tmp/rust-analyzer.gz -c > $LSP_HOME/rust/rust-analyzer/rust-analyzer
chmod +x $HOME/lsp/rust/rust-analyzer/rust-analyzer chmod +x $LSP_HOME/rust/rust-analyzer/rust-analyzer
;; ;;
zls) zls)
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
@ -424,9 +426,9 @@ install () {
;; ;;
esac esac
wget -O - https://github.com/zigtools/zls/releases/download/$VERSION/$FILE_NAME > /tmp/zls.xz wget -O - https://github.com/zigtools/zls/releases/download/$VERSION/$FILE_NAME > /tmp/zls.xz
mkdir -p $HOME/lsp/zig/zls mkdir -p $LSP_HOME/zig/zls
tar -xJf /tmp/zls.xz --strip-components=1 -C $HOME/lsp/zig/zls tar -xJf /tmp/zls.xz --strip-components=1 -C $LSP_HOME/zig/zls
chmod +x $HOME/lsp/zig/zls/zls chmod +x $LSP_HOME/zig/zls/zls
;; ;;
*) *)
echo "Unknown server: $SERVER" echo "Unknown server: $SERVER"
@ -449,28 +451,28 @@ uninstall () {
SERVER=$1 SERVER=$1
case $SERVER in case $SERVER in
jdtls) jdtls)
rm -rf $HOME/lsp/java/jdtls rm -rf $LSP_HOME/java/jdtls
;; ;;
omnisharp) omnisharp)
rm -rf $HOME/lsp/dotnet/omnisharp rm -rf $LSP_HOME/dotnet/omnisharp
;; ;;
hls) hls)
rm -rf $HOME/lsp/haskell/hls rm -rf $LSP_HOME/haskell/hls
;; ;;
solang) solang)
rm -rf $HOME/lsp/solidity/solang rm -rf $LSP_HOME/solidity/solang
;; ;;
lemminx) lemminx)
rm -rf $HOME/lsp/xml/lemminx rm -rf $LSP_HOME/xml/lemminx
;; ;;
kotlin-language-server) kotlin-language-server)
rm -rf $HOME/lsp/kotlin/kotlin-language-server rm -rf $LSP_HOME/kotlin/kotlin-language-server
;; ;;
rust-analyzer) rust-analyzer)
rm -rf $HOME/lsp/rust/rust-analyzer rm -rf $LSP_HOME/rust/rust-analyzer
;; ;;
zls) zls)
rm -rf $HOME/lsp/zig/zls rm -rf $LSP_HOME/zig/zls
;; ;;
*) *)
echo "Unknown server: $SERVER" echo "Unknown server: $SERVER"
@ -490,7 +492,7 @@ status () {
ERRORSTART="\033[91m" ERRORSTART="\033[91m"
INFOSTART="\033[34m" INFOSTART="\033[34m"
MODEND="\033[0m" MODEND="\033[0m"
LANGUAGES=$(ls $HOME/lsp) LANGUAGES=$(ls $LSP_HOME)
echov "Found languages: $LANGUAGES" echov "Found languages: $LANGUAGES"
if [ $ALL -eq 1 ]; then if [ $ALL -eq 1 ]; then
echov "Adding all supported languages" echov "Adding all supported languages"
@ -508,8 +510,8 @@ status () {
fi fi
echov "" echov ""
for lang in $LANGUAGES; do for lang in $LANGUAGES; do
if [ -d "$HOME/lsp/$lang" ]; then if [ -d "$LSP_HOME/$lang" ]; then
INSTALLED_SERVERS=$(ls $HOME/lsp/$lang) INSTALLED_SERVERS=$(ls $LSP_HOME/$lang)
else else
INSTALLED_SERVERS="" INSTALLED_SERVERS=""
fi fi
@ -561,9 +563,9 @@ status () {
fi fi
echo -e " Installed: ${INFOSTART}true${MODEND}" echo -e " Installed: ${INFOSTART}true${MODEND}"
echo " Version: $VERSION" echo " Version: $VERSION"
echo " Location: $HOME/lsp/$lang/$server" echo " Location: $LSP_HOME/$lang/$server"
LINKED=$(is_linked $server) LINKED=$(is_linked $server)
if [[ ":$PATH:" == *":$HOME/lsp/$lang/$server:"* ]]; then if [[ ":$PATH:" == *":$LSP_HOME/$lang/$server:"* ]]; then
echo -e " On path: ${INFOSTART}true${MODEND}" echo -e " On path: ${INFOSTART}true${MODEND}"
elif [ $LINKED -eq 1 ]; then elif [ $LINKED -eq 1 ]; then
echo -e " On path: ${INFOSTART}${BOLDSTART}linked${MODEND}${MODEND}" echo -e " On path: ${INFOSTART}${BOLDSTART}linked${MODEND}${MODEND}"
@ -584,7 +586,7 @@ status () {
if [ $HAD_UNKNOWN -eq 1 ]; then if [ $HAD_UNKNOWN -eq 1 ]; then
if [ $KNOWN_ONLY -eq 0 ]; then if [ $KNOWN_ONLY -eq 0 ]; then
echov "Found unknown servers." echov "Found unknown servers."
echov "Make sure $HOME/lsp contains only LSP servers and similar tools." echov "Make sure $HOME/.local/opt contains only LSP servers and similar tools."
fi fi
fi fi
} }

View File

@ -1 +0,0 @@
set -gx PATH $PATH $HOME/lsp/haskell/hls

View File

@ -1 +0,0 @@
set -gx PATH $PATH $HOME/lsp/solidity/solang

View File

@ -1 +0,0 @@
set -gx PATH $PATH $HOME/lsp/xml/lemminx

View File

@ -1,105 +1,4 @@
[gd_resource type="EditorSettings" load_steps=20 format=2] [gd_resource type="EditorSettings" format=2]
[sub_resource type="InputEventKey" id=1]
control = true
command = true
scancode = 78
unicode = 78
[sub_resource type="InputEventKey" id=2]
scancode = 16777224
unicode = 16777224
[sub_resource type="InputEventKey" id=3]
control = true
command = true
scancode = 68
unicode = 68
[sub_resource type="InputEventKey" id=4]
alt = true
scancode = 16777231
unicode = 16777231
[sub_resource type="InputEventKey" id=5]
alt = true
scancode = 16777233
unicode = 16777233
[sub_resource type="InputEventKey" id=6]
alt = true
scancode = 16777232
unicode = 16777232
[sub_resource type="InputEventKey" id=7]
control = true
command = true
scancode = 16777234
unicode = 16777234
[sub_resource type="InputEventKey" id=8]
control = true
command = true
scancode = 16777232
unicode = 16777232
[sub_resource type="InputEventKey" id=9]
scancode = 16777248
unicode = 16777248
[sub_resource type="InputEventKey" id=10]
alt = true
scancode = 70
unicode = 70
[sub_resource type="InputEventKey" id=11]
control = true
command = true
scancode = 72
unicode = 72
[sub_resource type="InputEventKey" id=12]
alt = true
scancode = 86
unicode = 86
[sub_resource type="InputEventKey" id=13]
control = true
command = true
scancode = 69
unicode = 69
[sub_resource type="InputEventKey" id=14]
control = true
command = true
scancode = 73
unicode = 73
[sub_resource type="InputEventKey" id=15]
control = true
command = true
scancode = 78
unicode = 78
[sub_resource type="InputEventKey" id=16]
scancode = 16777224
unicode = 16777224
[sub_resource type="InputEventKey" id=17]
scancode = 16777245
unicode = 16777245
[sub_resource type="InputEventKey" id=18]
control = true
command = true
scancode = 82
unicode = 82
[sub_resource type="InputEventKey" id=19]
control = true
command = true
scancode = 83
unicode = 83
[resource] [resource]
text_editor/highlighting/symbol_color = Color( 0.67, 0.785, 1, 1 ) text_editor/highlighting/symbol_color = Color( 0.67, 0.785, 1, 1 )

View File

@ -18,9 +18,7 @@
# fi # fi
# set PATH so it includes user's private bin directories # set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/bin-loc:$HOME/.local/bin:$PATH" export PATH="$PATH:$HOME/bin:$HOME/.local/bin"
export PATH="$HOME/.cargo/bin:$PATH"
export LC_ALL=en_US.UTF-8 export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
@ -33,8 +31,6 @@ export MY_CONFIG_CACHE_DIR=$HOME/.local/share/script_cache
export MY_PROJECTS_HOME=$HOME/Projects export MY_PROJECTS_HOME=$HOME/Projects
export MY_DOCUMENTS_HOME=$HOME/Documents export MY_DOCUMENTS_HOME=$HOME/Documents
export NVM_DIR="$HOME/.nvm"
export EDITOR=nvim export EDITOR=nvim
export VISUAL=nvim export VISUAL=nvim
export ELIXIR_EDITOR="nvim" export ELIXIR_EDITOR="nvim"

View File

@ -5,9 +5,6 @@ export MACHINE_TYPE='linux'
export AUR_INSTALL_HOME=~/.local/share/aurfetch export AUR_INSTALL_HOME=~/.local/share/aurfetch
export GRIM_DEFAULT_DIR=~/Pictures/Screenshots export GRIM_DEFAULT_DIR=~/Pictures/Screenshots
export PATH="$PATH:$HOME/Android/sdk/platform-tools/"
export PATH="$PATH:$HOME/Android/sdk/tools/bin"
# Local aliases and variables # Local aliases and variables
if [ -f "$HOME/.profile.local" ]; then if [ -f "$HOME/.profile.local" ]; then
source $HOME/.profile.local source $HOME/.profile.local

View File

@ -2,32 +2,11 @@ source ~/.dotfiles/symlinks/profile.common
export MACHINE_TYPE='mac' export MACHINE_TYPE='mac'
# PATHS
export PATH="$PATH:$HOME/Library/Android/sdk/platform-tools/"
export PATH="$PATH:$HOME/Library/Android/sdk/tools/bin"
# HomeBrew
export PATH=~/homebrew/bin:$PATH
# dotnet
export PATH=$PATH:/usr/local/share/dotnet
# latexindent
export PATH="~/LaTeX/latexindent:$PATH"
export PATH="~/Latex/lindent:$PATH"
PATH="~/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="~/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; PERL5LIB="~/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="~/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; PERL_LOCAL_LIB_ROOT="~/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"~/perl5\""; export PERL_MB_OPT; PERL_MB_OPT="--install_base \"~/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=~/perl5"; export PERL_MM_OPT; PERL_MM_OPT="INSTALL_BASE=~/perl5"; export PERL_MM_OPT;
# Flutter
export PATH="~/Applications/flutter/bin:$PATH"
export PATH="$PATH:/usr/local/opt/llvm/bin"
# Local aliases and variables # Local aliases and variables
if [ -f "$HOME/.profile.local" ]; then if [ -f "$HOME/.profile.local" ]; then
source $HOME/.profile.local source $HOME/.profile.local