Fix up zshrc
This commit is contained in:
parent
9550ef8a29
commit
c7f6bbfddc
@ -1,37 +0,0 @@
|
|||||||
if command -vq flatpak
|
|
||||||
set -ga fish_user_paths ~/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bin
|
|
||||||
set -gx --path XDG_DATA_DIRS /usr/local/share/ /usr/share/ ~/.local/share/flatpak/exports/share
|
|
||||||
for install_dir in (flatpak --installations)
|
|
||||||
set -gxa XDG_DATA_DIRS $install_dir/exports/share
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
egrep "^export " ~/.bash_profile | while read e
|
|
||||||
set var (echo $e | sed -E "s/^export ([A-Za-z_]+)=(.*)\$/\1/")
|
|
||||||
set value (echo $e | sed -E "s/^export ([A-Za-z_]+)=(.*)\$/\2/")
|
|
||||||
|
|
||||||
# remove surrounding quotes if existing
|
|
||||||
set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/")
|
|
||||||
|
|
||||||
if test $var = "PATH"
|
|
||||||
# replace ":" by spaces. this is how PATH looks for Fish
|
|
||||||
set value (echo $value | sed -E "s/:/ /g")
|
|
||||||
|
|
||||||
# use eval because we need to expand the value
|
|
||||||
eval set -xg $var $value
|
|
||||||
|
|
||||||
continue
|
|
||||||
end
|
|
||||||
|
|
||||||
# evaluate variables. we can use eval because we most likely just used "$var"
|
|
||||||
set value (eval echo $value)
|
|
||||||
|
|
||||||
#echo "set -xg '$var' '$value' (via '$e')"
|
|
||||||
set -xg $var $value
|
|
||||||
end
|
|
||||||
|
|
||||||
if status --is-interactive
|
|
||||||
fastfetch
|
|
||||||
end
|
|
||||||
|
|
||||||
set -U fish_user_paths /usr/local/ubin ~/bin ~/go/bin ~/anaconda3/bin $fish_user_paths
|
|
@ -1,21 +1,23 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
function zsh_add_config() {
|
function zsh_add_config() {
|
||||||
[ -f "$ZSH_CONFIG/$1" ] && ! [ -L "$ZSH_CONFIG/$1" ] && source "$ZSH_CONFIG/$1"
|
[ -f "$ZDOTDIR/$1" ] && ! [ -L "$ZDOTDIR/$1" ] && source "$ZDOTDIR/$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function zsh_add_plugin() {
|
function zsh_add_plugin() {
|
||||||
PLUGIN_NAME=$(echo $1 | cut -d"/" -f2)
|
PLUGIN_NAME=$(echo $1 | cut -d"/" -f2)
|
||||||
if ! [ -d "$ZSH_CONFIG/plugins/$PLUGIN_NAME" ]; then
|
if ! [ -d "$ZDOTDIR/plugins/$PLUGIN_NAME" ]; then
|
||||||
git clone "https://github.com/$1.git" "$ZSH_CONFIG/plugins/$PLUGIN_NAME"
|
git clone "https://github.com/$1.git" "$ZDOTDIR/plugins/$PLUGIN_NAME"
|
||||||
fi
|
fi
|
||||||
zsh_add_config "plugins/$PLUGIN_NAME/$PLUGIN_NAME.plugin.zsh"
|
zsh_add_config "plugins/$PLUGIN_NAME/$PLUGIN_NAME.plugin.zsh"
|
||||||
zsh_add_config "plugins/$PLUGIN_NAME/$PLUGIN_NAME.zsh"
|
zsh_add_config "plugins/$PLUGIN_NAME/$PLUGIN_NAME.zsh"
|
||||||
|
zsh_add_config "plugins/$PLUGIN_NAME/async"
|
||||||
|
zsh_add_config "plugins/$PLUGIN_NAME/nix.plugin.zsh"
|
||||||
}
|
}
|
||||||
|
|
||||||
function zsh_fpath_plugin() {
|
function zsh_fpath_plugin() {
|
||||||
PLUGIN_NAME=$(echo $1 | cut -d"/" -f2)
|
PLUGIN_NAME=$(echo $1 | cut -d"/" -f2)
|
||||||
if ! [ -d "$ZSH_CONFIG/plugins/$PLUGIN_NAME" ]; then
|
if ! [ -d "$ZDOTDIR/plugins/$PLUGIN_NAME" ]; then
|
||||||
git clone "https://github.com/$1.git" "$ZSH_CONFIG/plugins/$PLUGIN_NAME"
|
git clone "https://github.com/$1.git" "$ZDOTDIR/plugins/$PLUGIN_NAME"
|
||||||
fi
|
fi
|
||||||
fpath+=($ZSH_CONFIG/plugins/$PLUGIN_NAME)
|
fpath+=($ZDOTDIR/plugins/$PLUGIN_NAME)
|
||||||
}
|
}
|
||||||
|
@ -1 +0,0 @@
|
|||||||
Subproject commit caa749d030d22168445c4cb97befd406d2828db0
|
|
27
.zshrc
27
.zshrc
@ -1,29 +1,28 @@
|
|||||||
# The following lines were added by compinstall
|
|
||||||
zstyle :compinstall filename "$HOME/.zshrc"
|
|
||||||
|
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
compinit
|
compinit
|
||||||
# End of lines added by compinstall
|
HISTFILE="$HOME/.zsh_history"
|
||||||
# Lines configured by zsh-newuser-install
|
|
||||||
HISTFILE=~/.histfile
|
|
||||||
HISTSIZE=10000
|
HISTSIZE=10000
|
||||||
SAVEHIST=10000
|
SAVEHIST=10000
|
||||||
bindkey -e
|
bindkey -e
|
||||||
# End of lines configured by zsh-newuser-install
|
|
||||||
|
|
||||||
export PATH="/usr/local/ubin:$HOME/bin:$HOME/go/bin:$HOME/.cargo/bin:$HOME/anaconda3/bin:$PATH:/usr/local/cuda/bin"
|
export PATH="/usr/local/ubin:$HOME/bin:$HOME/go/bin:$HOME/.cargo/bin:$PATH"
|
||||||
export EDITOR="vim"
|
export EDITOR="vim"
|
||||||
|
export TERMINAL="konsole"
|
||||||
|
export TERM="konsole"
|
||||||
|
export BROWSER="firefox"
|
||||||
|
export VIDEO="mpv"
|
||||||
|
export OPENER="xdg-open"
|
||||||
|
|
||||||
ZSH_CONFIG="$HOME/.config/zsh"
|
export ZDOTDIR="$HOME/.config/zsh"
|
||||||
source "$ZSH_CONFIG/functions"
|
source "$ZDOTDIR/functions"
|
||||||
|
|
||||||
zsh_add_config keybinds.zsh
|
zsh_add_config keybinds.zsh
|
||||||
|
|
||||||
PURE_PROMPT_SYMBOL="$"
|
export PURE_PROMPT_SYMBOL="$"
|
||||||
if [ "$USER" = "root" ]; then
|
if [ "$USER" = "root" ]; then
|
||||||
PURE_PROMPT_SYMBOL="#"
|
export PURE_PROMPT_SYMBOL="#"
|
||||||
fi
|
fi
|
||||||
PROMPT_PURE_SSH_CONNECTION=YES
|
export PROMPT_PURE_SSH_CONNECTION=YES
|
||||||
zsh_fpath_plugin sindresorhus/pure
|
zsh_fpath_plugin sindresorhus/pure
|
||||||
autoload -U promptinit; promptinit
|
autoload -U promptinit; promptinit
|
||||||
zstyle :prompt:pure:user color cyan
|
zstyle :prompt:pure:user color cyan
|
||||||
@ -31,7 +30,7 @@ zstyle :prompt:pure:host color white
|
|||||||
zstyle ':prompt:pure:prompt:*' color white
|
zstyle ':prompt:pure:prompt:*' color white
|
||||||
prompt pure
|
prompt pure
|
||||||
|
|
||||||
zsh_add_plugin zsh-users/zsh-syntax-highlighting
|
zsh_add_plugin zdharma-continuum/fast-syntax-highlighting
|
||||||
|
|
||||||
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
||||||
zsh_add_plugin zsh-users/zsh-autosuggestions
|
zsh_add_plugin zsh-users/zsh-autosuggestions
|
||||||
|
Loading…
Reference in New Issue
Block a user