diff options
author | Freya Murphy <freya@freyacat.org> | 2025-06-17 21:57:53 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-06-17 21:57:53 -0400 |
commit | e0f2eb724245e02cb247b644f0947261d8665318 (patch) | |
tree | 13f929df40059d37165cbe46be95a6404a1bbecb /programs/zsh | |
parent | refactor styles to new color scheme basis (diff) | |
download | dotfiles-nix-e0f2eb724245e02cb247b644f0947261d8665318.tar.gz dotfiles-nix-e0f2eb724245e02cb247b644f0947261d8665318.tar.bz2 dotfiles-nix-e0f2eb724245e02cb247b644f0947261d8665318.zip |
remove nix dir and move out all sub modules
Diffstat (limited to 'programs/zsh')
-rw-r--r-- | programs/zsh/default.nix | 19 | ||||
-rw-r--r-- | programs/zsh/zprofile | 11 | ||||
-rw-r--r-- | programs/zsh/zshrc | 73 |
3 files changed, 103 insertions, 0 deletions
diff --git a/programs/zsh/default.nix b/programs/zsh/default.nix new file mode 100644 index 0000000..e0dce57 --- /dev/null +++ b/programs/zsh/default.nix @@ -0,0 +1,19 @@ +{ config, ... }: + +{ + programs.zsh = { + enable = true; + enableCompletion = true; + enableGlobalCompInit = false; + autosuggestions.enable = true; + syntaxHighlighting.enable = true; + histSize = 10000; + }; + + home-manager.users.${config.user} = { + home.file = { + ".zshrc".source = ./zshrc; + ".zprofile".source = ./zprofile; + }; + }; +} diff --git a/programs/zsh/zprofile b/programs/zsh/zprofile new file mode 100644 index 0000000..4815b36 --- /dev/null +++ b/programs/zsh/zprofile @@ -0,0 +1,11 @@ +# dont attempt to launch a graphical +# env in tmux +if [ -n "$TMUX" ]; then + return +fi + +# only launch hyprland on tty 1 +if [ -z "${WAYLAND_DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then + export XDG_CURRENT_DESKTOP=Hyprland + exec dbus-run-session Hyprland +fi diff --git a/programs/zsh/zshrc b/programs/zsh/zshrc new file mode 100644 index 0000000..b1c61a2 --- /dev/null +++ b/programs/zsh/zshrc @@ -0,0 +1,73 @@ +# zsh 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 + +# update PATH +PATH=$PATH:$HOME/.local/bin +PATH=$PATH:$HOME/.cargo/bin + +# vim mode >:) +# no ryan i am not copying you +set -o vi +set show-mode-in-prompt on + +# Set shell prompt using starship +if command -v "starship" > /dev/null; then + eval "$(starship init zsh)" +else + export PS1="$$USER: " +fi + +# aliases +alias rf="rm -fr" # remove le french hon hon hon +alias ls="ls --color=auto" +alias ip="ip --color=auto" +alias grep="grep --color=auto" +alias diff="diff --color=auto" +alias vim="nvim" +alias ssh='TERM=xterm-256color ssh' # xterm-kitty bad + +# nix rebuild +alias rs="sudo nixos-rebuild switch --flake ~/.config/nix#$(hostname)" +alias rh="home-manager switch --flake ~/.config/nix#$(hostname)" + +# manpages +export LESS_TERMCAP_md=$'\e[1;36m' +export LESS_TERMCAP_me=$'\e[0m' +export LESS_TERMCAP_se=$'\e[0m' +export LESS_TERMCAP_so=$'\e[1;92m' +export LESS_TERMCAP_ue=$'\e[0m' +export LESS_TERMCAP_us=$'\e[1;35m' +export GROFF_NO_SGR=1 + +# compinit +autoload compinit && compinit + +# 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 +export GPG_TTY=$(tty) +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + +# ricing +pfetch |