diff options
author | Tyler Murphy <tylerm@tylerm.dev> | 2023-09-04 23:21:01 -0400 |
---|---|---|
committer | Tyler Murphy <tylerm@tylerm.dev> | 2023-09-04 23:21:01 -0400 |
commit | db49f683129771d95828b01594c69431a717e8e8 (patch) | |
tree | d2cb1c0b865e4d81ce81f9a3176b8ad93a864950 /home-config/zsh/zshrc | |
download | dotfiles-guix-db49f683129771d95828b01594c69431a717e8e8.tar.gz dotfiles-guix-db49f683129771d95828b01594c69431a717e8e8.tar.bz2 dotfiles-guix-db49f683129771d95828b01594c69431a717e8e8.zip |
guix
Diffstat (limited to 'home-config/zsh/zshrc')
-rw-r--r-- | home-config/zsh/zshrc | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/home-config/zsh/zshrc b/home-config/zsh/zshrc new file mode 100644 index 0000000..1428182 --- /dev/null +++ b/home-config/zsh/zshrc @@ -0,0 +1,71 @@ +# Zsh shell initalization file + +# Export 'SHELL' to child processes +export SHELL + +if [[ $- != *i* ]] +then + # We are being invoked from a non-interactive shell. If this + # is an SSH session (as in "ssh host command"), source + # /etc/profile so we get PATH and other essential variables. + [[ -n "$SSH_CLIENT" ]] && source /etc/profile + + # Don't do anything else. + return +fi + +# vim mode >:) +# no ryan i am not copying you +set -o vi +set show-mode-in-prompt on + +# Set shell prompt using starship +eval "$(starship init zsh)" + +# Set guix reconfigure aliases +alias reconfigure-system="sudo -E guix system -L $HOME/.config/guix/modules reconfigure $HOME/.config/guix/$(hostname).scm" +alias reconfigure-user="guix home -L $HOME/.config/guix/modules reconfigure $HOME/.config/guix/home-config/home-configuration.scm && home-manager switch" + +# Set other usefull aliases +alias neo="pfetch" +alias rf="rm -fr" # remove le french hon hon hon +alias config="/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME" +alias ls="ls --color=auto" +alias su="doas -s" + +# Make sure cargo is working with nix packages +alias cargo="CC=$NIX_PROFILE/bin/gcc $NIX_PROFILE/bin/cargo" + +# Have manpages use colors +man() { + env \ + LESS_TERMCAP_md=$'\e[1;36m' \ + LESS_TERMCAP_me=$'\e[0m' \ + LESS_TERMCAP_se=$'\e[0m' \ + LESS_TERMCAP_so=$'\e[1;92m' \ + LESS_TERMCAP_ue=$'\e[0m' \ + LESS_TERMCAP_us=$'\e[1;35m' \ + man "$@" +} + +# Enable zsh auto suggestions +autoload compinit && compinit +source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#696e8a" +ZSH_AUTOSUGGEST_STRATEGY=(completion history) + +# Enable zsh keybinds for home, end, and other movement keybinds +bindkey "\e[1;5D" backward-word +bindkey "\e[1;5C" forward-word +bindkey "\e[3;5~" kill-word +bindkey "\C-_" backward-kill-word +bindkey "\e[3~" delete-char +bindkey "\e[H" beginning-of-line +bindkey "\e[F" end-of-line +bindkey "\e\d" undo + +# GPG SETUP FOR SSH +export GPG_TTY=$(tty) + +# ricing +pfetch |