This commit is contained in:
tavo 2025-01-07 10:17:53 -06:00
parent c21029bdd2
commit f105dd521b
Signed by: tavo
GPG key ID: D490F27B624CECB0
7 changed files with 70 additions and 13 deletions

1
shell/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.zcompdump

54
shell/.zshrc Normal file
View file

@ -0,0 +1,54 @@
if [ -d ~/.config/shell/profile.d ] ; then
for p in ~/.config/shell/profile.d/*.sh; do
[ -f "$p" ] && . "$p"
done
unset p
fi
HISTSIZE=
SAVEHIST=
HISTFILE="$XDG_STATE_HOME/shell/zsh_history"
case $- in
*i*) ;;
*) return;;
esac
autoload -U compinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit
_comp_options+=(globdots)
autoload -U colors && colors
setopt autocd
stty stop undef
setopt interactive_comments
setopt inc_append_history
bindkey -v
export KEYTIMEOUT=1
if [ -n "$HISTFILE" ] && ! [ -d "${HISTFILE%/*}" ] ; then
mkdir -p "${HISTFILE%/*}" && touch "$HISTFILE"
fi
_prompt_git_branch() {
GIT_BRANCH="$(git branch 2>/dev/null | sed '/\*/!d;s/^\*\s*//g;s/\s*$//g')"
[ -n "$GIT_BRANCH" ] && printf '%s ' "$GIT_BRANCH"
}
precmd() {
psvar[1]=$(_prompt_git_branch)
}
PS1=$'\e[0;2m%T\e[0m \e[0;34m%~\e[0m \e[0;35;1m%1v\e[0m%(?.%F{green}.%F{red})>\e[0m '
if [ -f ~/.config/shell/aliases.sh ] ; then
. ~/.config/shell/aliases.sh
fi
if [ -f ~/.config/shell/gui.sh ] ; then
. ~/.config/shell/gui.sh
fi
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh 2>/dev/null

View file

@ -35,6 +35,7 @@ command -v eza >/dev/null 2>&1 &&
command -v trash >/dev/null 2>&1 && alias rm="trash"
alias \
cal="calcurse" \
fzf="fzf --cycle --reverse" \
diff="diff --color=auto" \
grep="grep --color=auto" \
@ -48,4 +49,5 @@ alias \
clip="xsel -ib" \
em="emacsclient -c -a 'emacs' $@" \
wget="wget --hsts-file=$XDG_DATA_HOME/wget/wget-hsts" \
ssh="ssh ${SSH_CONFIG}"
ssh="ssh ${SSH_CONFIG}" \
lg="lazygit"

View file

@ -1,12 +1,18 @@
#!/bin/bash
if test -d ~/.config/shell/profile.d/; then
for profile in ~/.config/shell/profile.d/*.sh; do
test -r "$profile" && . "$profile"
if [ -d ~/.config/shell/profile.d ] ; then
for p in ~/.config/shell/profile.d/*.sh; do
[ -f "$p" ] && . "$p"
done
unset profile
unset p
fi
BASH_ENV="$XDG_CONFIG_HOME/shell/bashrc"
HISTFILE="$XDG_STATE_HOME/shell/bash_history"
HISTCONTROL=ignoreboth
HISTIZE=
HISTFILESIZE=
case $- in
*i*) ;;
*) return;;

View file

@ -1,8 +1,3 @@
export \
HISTCONTROL=ignoreboth \
HISTIZE= \
HISTFILESIZE=
export \
QT_QPA_PLATFORMTHEME="qt5ct" \
CM_SELECTIONS="clipboard" \

View file

@ -5,7 +5,6 @@ export \
XDG_CONFIG_HOME="$HOME/.config"
export \
BASH_ENV="$XDG_CONFIG_HOME/shell/bashrc" \
_JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java" \
MATHEMATICA_USERBASE="$XDG_CONFIG_HOME/mathematica" \
XCURSOR_PATH=/usr/share/icons:$XDG_DATA_HOME/icons \
@ -18,7 +17,6 @@ export \
XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc" \
MBSYNCRC="$XDG_CONFIG_HOME/isync/mbsyncrc" \
XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" \
HISTFILE="$XDG_STATE_HOME/shell/bash_history" \
XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" \
LESSHISTFILE="$XDG_DATA_HOME/lesshst" \
ELECTRUMDIR="$XDG_DATA_HOME/electrum" \
@ -28,4 +26,5 @@ export \
GNUPGHOME="$XDG_DATA_HOME/gnupg" \
GOPATH="$XDG_DATA_HOME/go" \
SSH_CONFIG="-F ${XDG_CONFIG_HOME}/ssh/config" \
GIT_SSH_COMMAND="ssh -F ${XDG_CONFIG_HOME}/ssh/config"
GIT_SSH_COMMAND="ssh -F ${XDG_CONFIG_HOME}/ssh/config" \
ZDOTDIR="$XDG_CONFIG_HOME/shell"