Clean up a bunch of unused stuff in zshrc

This commit is contained in:
xenia 2024-07-26 12:00:20 +02:00
parent e89e30da99
commit d49923436c
2 changed files with 3 additions and 77 deletions

View File

@ -1,83 +1,12 @@
#!/bin/zsh #!/bin/zsh
export PATH="$HOME/.cargo/bin:$PATH" export PATH="$HOME/.cargo/bin:$PATH"
export PATH="/Applications/ARM/bin:$PATH"
alias ls="ls --color=auto" alias ls="ls --color=auto"
alias bashcols="python3 ~/cloud/Projekt/Programmering/Python/BashCols.py"
alias bashcurmov="python3 ~/cloud/Projekt/Programmering/Python/Bashcurmoves.py"
alias objdump="objdump -M intel"
alias atsc="patscc -cleanaft -DATS_MEMALLOC_LIBC"
alias i2="idris2"
alias py="python" alias py="python"
alias ipy="ipython" alias ipy="ipython"
alias c="cargo" alias c="cargo"
alias bqn="rlwrap BQN"
alias nix-zsh="nix-shell --run zsh"
alias z=nix-zsh
_BLUE="\033[38;5;4m" dev() {
_GREEN="\033[38;5;2m" nix develop ".#${1:-default}" -c "$SHELL"
_RED="\033[38;5;1m"
_RESET="\033[0m"
function activate {
(
cd ~/cloud/Projekt
F=$( fd '' -t d -d 4 . | fzf -1 -q "$1" ) || return
LINKEE=$(realpath "$F")
DEFAULT_NAME=$(basename "$LINKEE")
LINK="${2:-${DEFAULT_NAME}}"
cd ~/cloud/A-Aktivta
if [[ -d "$LINK" ]] then
echo "Project ${_BLUE}$LINK${_RESET} already exists!"
else
echo "${_BLUE}$LINK${_RESET} -> ${_BLUE}$LINKEE${_RESET} has been ${_GREEN}activated${_RESET}"
ln -s "$LINKEE" "$LINK"
fi
)
_check_proj_count
} }
function _check_proj_count {
(
cd ~/cloud/A-Aktivta
N_FILES=$(ls | wc -l | tr -d ' ')
if [[ $N_FILES > 4 ]] then
echo "You have $_RED$N_FILES$_RESET active projets. Consider deactivating some"
fi
)
}
function deactivate {
(
cd ~/cloud/A-Aktivta
F=$( fd '' -t l -d 1 . | fzf -1 -q "$1" ) || return
rm "$F"
echo "Deactivated $_BLUE$F$RESET"
)
_check_proj_count
}
function project {
pushd >/dev/null
cd ~/cloud/A-Aktivta
PROJ_NAME=$( fd '' -t l -d 1 . | fzf -1 -q "$1" ) || { popd >/dev/null ; return }
F=$(realpath "$PROJ_NAME")
echo "In $_BLUE${PROJ_NAME}$_RESET"
cd "$F"
_check_proj_count
}
alias p=project
setopt prompt_subst
# export RPROMPT='%(?.%F{green}√.%?%F{red}?)%f'
# tmux stuff
function setwd {
tmux command-prompt -I "attach -c $(pwd)"
}
alias nix-zsh="nix-shell --run zsh"

View File

@ -95,14 +95,11 @@ in rec {
echo -en "%{\033[0m\033[38:5:''${BG}m%}" echo -en "%{\033[0m\033[38:5:''${BG}m%}"
echo -en "%{\033[0m%} "; echo -en "%{\033[0m%} ";
)' )'
setopt prompt_subst
'' ''
+ builtins.readFile ../dotfiles/zshrc; + builtins.readFile ../dotfiles/zshrc;
}; };
home.shellAliases = {
dev = "nix develop -c $SHELL";
};
programs.direnv = { programs.direnv = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;