diff options
Diffstat (limited to '')
-rw-r--r-- | home/nipsy/common/core/zsh/default.nix | 35 | ||||
-rw-r--r-- | home/nipsy/common/core/zsh/zshrc | 78 |
2 files changed, 44 insertions, 69 deletions
diff --git a/home/nipsy/common/core/zsh/default.nix b/home/nipsy/common/core/zsh/default.nix index 4bb5856..77d4b75 100644 --- a/home/nipsy/common/core/zsh/default.nix +++ b/home/nipsy/common/core/zsh/default.nix @@ -1,10 +1,45 @@ { programs.zsh = { enable = true; + envExtra = '' +export PATH=~/bin:''${PATH} + +#export PS1="%B%n%b@%U%m%u/%l:%~> " +export PAGER=less +export EDITOR=vim +export BROWSER=firefox + +export LC_COLLATE="C" +export QUOTING_STYLE="literal" + +export IRCNICK="nipsy" +export IRCNAME="Mark Nipper" + +export NNTPSERVER="news.giganews.com" + +#export COLORTERM=truecolor +export COLORFGBG="green;blue" + +# fix stupid broken Java shit +export _JAVA_AWT_WM_NONREPARENTING=1 + +# enable pass extensions +export PASSWORD_STORE_ENABLE_EXTENSIONS=true + ''; + history = { + save = 100000; + size = 100000; + }; initExtra = (builtins.readFile ./zshrc); shellAliases = { + fixkeyboard = "setxkbmap -layout us -option caps:super -option compose:ralt"; + grep = "grep --color=auto"; + ip = "ip -c=auto"; la = "ls -aFh --color=auto"; ll = "ls -alF --color=auto"; + lock = "xscreensaver-command -lock"; + steam-no-beta = "steam -clearbeta"; + zgrep = "zgrep --color=auto"; }; }; } diff --git a/home/nipsy/common/core/zsh/zshrc b/home/nipsy/common/core/zsh/zshrc index 9e43d1d..cd857e3 100644 --- a/home/nipsy/common/core/zsh/zshrc +++ b/home/nipsy/common/core/zsh/zshrc @@ -1,39 +1,6 @@ umask 022 -#export GOROOT="''${HOME}/.local/go" -#export GOPATH="''${HOME}/go" - -#export PATH="$HOME/bin:$GOROOT/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/games:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin" -#export PATH="$HOME/bin:$GOROOT/bin:/usr/bin:/usr/sbin:/usr/games:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin" -#export PATH=~/bin::~/.local/rust/cargo/bin:/usr/bin:/usr/sbin:/usr/games:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin -export PATH=~/bin:''${PATH} - -#export PS1="%B%n%b@%U%m%u/%l:%~> " -export PAGER=less -export EDITOR=vim -export BROWSER=firefox - -export LC_COLLATE="C" eval $(dircolors) -export QUOTING_STYLE="literal" - -export IRCNICK="nipsy" -export IRCNAME="Mark Nipper" - -export NNTPSERVER="news.giganews.com" - -#export HISTFILE="$HOME/.zsh_hist" -export HISTSIZE=100000 -export SAVEHIST=''${HISTSIZE} - -#export COLORTERM=truecolor -export COLORFGBG="green;blue" - -# fix stupid broken Java shit -export _JAVA_AWT_WM_NONREPARENTING=1 - -# enable pass extensions -export PASSWORD_STORE_ENABLE_EXTENSIONS=true # set SWAYSOCK correctly if pgrep -U nipsy -x sway >/dev/null; then @@ -41,7 +8,7 @@ if pgrep -U nipsy -x sway >/dev/null; then fi # start sway by default if logging into tty1 -if [[ -z "''${DISPLAY}" ]] && [[ $(tty) == "/dev/tty1" ]]; then +if [[ -z "${DISPLAY}" ]] && [[ $(tty) == "/dev/tty1" ]]; then export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) @@ -57,7 +24,7 @@ if [[ -z "''${DISPLAY}" ]] && [[ $(tty) == "/dev/tty1" ]]; then fi # if already in Wayland, update the GPG TTY so ssh-askpass will work correctly -if [[ -n "''${WAYLAND_DISPLAY}" ]]; then +if [[ -n "${WAYLAND_DISPLAY}" ]]; then gpg-connect-agent updatestartuptty /bye >/dev/null fi @@ -74,24 +41,6 @@ setopt LONG_LIST_JOBS NO_HUP # zle options setopt NO_BEEP -lsopt='--color=auto' -#alias ll="ls -alFh $lsopt" -#alias la="ls -aF $lsopt" -alias cal="ncal -b" -#alias grep='grep --color=always' # cannot do this as it breaks shell pipelines -alias talk='gnutalk --curses' -alias manage="tmux new-window ssh root@darkstar\; split-window -d ssh root@king\; new-window ssh root@black-sheep\; split-window -d ssh root@treebeard\; new-window ssh root@casey\; split-window -d ssh root@homer\; new-window ssh root@lilnasx\; split-window -d ssh root@trent" -alias manage-mac="tmux new-session \; source ~/.tmux/manage-mac" -alias win7="xfreerdp -x l -g 1680x1050 -u nipsy -d la-its841279wd kaitain" -alias win7-la="xfreerdp -x l -g 1680x1050 -u la-mrn447 -d austin kaitain" -#alias kubectl="~/k3s/k3s kubectl" -#alias helm="~/k3s/linux-amd64/helm" -alias lock="xscreensaver-command -lock" -alias fixkeyboard="setxkbmap -layout us -option caps:super -option compose:ralt" -alias zigup="zigup --install-dir ~/.local/zig --path-link ~/bin/zig" - -#autoload -U compinit -#compinit zstyle ':completion:*' menu select=5 bindkey -v @@ -101,15 +50,6 @@ autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd v edit-command-line -# nix -#if [ -e /home/nipsy/.nix-profile/etc/profile.d/nix.sh ]; then . /home/nipsy/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer - -# The next line updates PATH for the Google Cloud SDK. -#source /home/nipsy/google-cloud-sdk/path.zsh.inc - -# The next line enables bash completion for gcloud. -#source /home/nipsy/google-cloud-sdk/completion.zsh.inc - # always open tmux if interactive [[ $- != *i* ]] && return #[[ -z "$TMUX" ]] && (tmux -2 new-session -t default \; new-window || tmux -2 new-session -s default) @@ -118,13 +58,13 @@ bindkey -M vicmd v edit-command-line # prompt/theme shit function precmd { - local RC=''${?} - #local RC=''${(%)RC-%?} + local RC=${?} + #local RC=${(%)RC-%?} print -nP '\n' # current user - if [[ ''${EUID} -eq 0 ]]; then + if [[ ${EUID} -eq 0 ]]; then print -nP '%{%S%F{red}%}%n%{%f%s%}' else print -nP '%{%F{magenta}%}%n%{%f%}' @@ -147,18 +87,18 @@ function precmd { # job count JOBCOUNT='%j' - if [[ ''${(%)JOBCOUNT} -gt 0 ]]; then + if [[ ${(%)JOBCOUNT} -gt 0 ]]; then print -nP 'j=%{%F{yellow}%}%j%{%f%} ' fi # previous return code - if [[ ''${RC} -ne 0 ]]; then + if [[ ${RC} -ne 0 ]]; then print -nP 'rc=%{%F{red}%}' - echo -n "''${RC}" + echo -n "${RC}" print -nP '%{%f%} ' else print -nP 'rc=%{%F{green}%}' - echo -n "''${RC}" + echo -n "${RC}" print -nP '%{%f%} ' fi |