Add remote sourcing

This commit is contained in:
Tobias Reisinger 2022-09-13 22:19:08 +02:00
parent 59f56831ee
commit 59c323b383
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
2 changed files with 15 additions and 3 deletions

11
.bin/source-remote-file Executable file
View file

@ -0,0 +1,11 @@
base_path="$HOME/.cache/remote-sources"
mkdir -p "$base_path"
file_path="$base_path/$1"
if [ ! -f "$file_path" ]
then
echo "Installing file $1"
curl -Ls -o "$file_path" "$2"
fi
source $file_path
# vim: ft=bash

View file

@ -77,7 +77,6 @@ function omz_install_custom_plugin() {
git clone "$2" "$plugin_path" >/dev/null 2>&1 git clone "$2" "$plugin_path" >/dev/null 2>&1
fi fi
} }
omz_install_custom_plugin "zsh-syntax-highlighting" "https://github.com/zsh-users/zsh-syntax-highlighting.git" omz_install_custom_plugin "zsh-syntax-highlighting" "https://github.com/zsh-users/zsh-syntax-highlighting.git"
@ -105,13 +104,13 @@ plugins=(
'zsh-syntax-highlighting' 'zsh-syntax-highlighting'
) )
source $ZSH/oh-my-zsh.sh source "$ZSH/oh-my-zsh.sh"
# User configuration # User configuration
source "$HOME/.config/environment" source "$HOME/.config/environment"
source "$HOME/.config/completionsrc" source "$HOME/.config/completionsrc"
[ -f "$HOME/.config/aliasrc" ] && source $HOME/.config/aliasrc source "$HOME/.config/aliasrc"
[ -x "$(command -v thefuck)" ] && eval $(thefuck --alias) [ -x "$(command -v thefuck)" ] && eval $(thefuck --alias)
export MARKPATH="$HOME/.config/zsh/jump_marks" export MARKPATH="$HOME/.config/zsh/jump_marks"
@ -121,4 +120,6 @@ export SAVEHIST=1000000
export HISTSIZE=1000000 export HISTSIZE=1000000
export HISTFILE="$HOME/.cache/zsh_history" export HISTFILE="$HOME/.cache/zsh_history"
source source-remote-file "dracula-syntax-highlighting" "https://raw.githubusercontent.com/dracula/zsh-syntax-highlighting/master/zsh-syntax-highlighting.sh"
[ -x "$(command -v starship)" ] && eval "$(starship init zsh)" [ -x "$(command -v starship)" ] && eval "$(starship init zsh)"