Last active
June 9, 2025 09:23
-
-
Save Lenzelot/0c4305bb70471299ae5bc1c0cd26ccf1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########################################## | |
| #### File: ~/.zshrc | |
| ########################################## | |
| # | |
| # ███████╗███████╗██╗ ██╗██████╗ ██████╗ | |
| # ╚══███╔╝██╔════╝██║ ██║██╔══██╗██╔════╝ | |
| # ███╔╝ ███████╗███████║██████╔╝██║ | |
| # ███╔╝ ╚════██║██╔══██║██╔══██╗██║ | |
| # ███████╗███████║██║ ██║██║ ██║╚██████╗ | |
| # ╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ | |
| ########################################## | |
| export NCURSES_NO_UTF8_ACS=1 | |
| #export LC_ALL=en_US.utf-8 | |
| test -e ~/.alias.sh && source ~/.alias.sh | |
| if ! [[ $(uname -n) =~ "OpenWrt" ]]; then | |
| # normal machine | |
| autoload -U promptinit | |
| promptinit | |
| prompt zefram | |
| #prompt walters | |
| else | |
| #special case OpenWrt | |
| PS1="%B%(?..[%?] )%b%n@%U%m%u>" | |
| PS2="\`%_>" | |
| PS3="?#" | |
| PS4="+%N:%i:%_>" | |
| fi | |
| # correct behavior when trailing newline is missing | |
| setopt PROMPT_SP | |
| #precmd_functions=('my-timestamp' 'weird') | |
| my-timestamp() { | |
| export NOW=`date "+%Y-%m-%d_%Hh%Mm%Ss"` | |
| } | |
| #test -d ~/bin && export PATH=$HOME/bin:$PATH | |
| #export PATH="$PATH:/usr/lib/aircrack/bin" | |
| #f5# (Mis)use \kbd{vim} as \kbd{less} | |
| viless() { vim --cmd 'let no_plugin_maps = 1' -c "so \$VIMRUNTIME/macros/less.vim" "${@:--}" } | |
| #alias less='viless' | |
| #{{{ History Stuff | |
| # Where it gets saved | |
| HISTFILE=~/.zsh_history | |
| # Remember about a years worth of history (AWESOME) | |
| SAVEHIST=50000 | |
| HISTSIZE=50000 | |
| # Don't overwrite, append! | |
| setopt APPEND_HISTORY | |
| # Write after each command | |
| setopt INC_APPEND_HISTORY | |
| # Killer: share history between multiple shells | |
| setopt SHARE_HISTORY | |
| # If I type cd and then cd again, only save the last one | |
| setopt HIST_IGNORE_DUPS | |
| # Even if there are commands inbetween commands that are the same, still only save the last one | |
| setopt HIST_IGNORE_ALL_DUPS | |
| # Pretty Obvious. Right? | |
| setopt HIST_REDUCE_BLANKS | |
| # If a line starts with a space, don't save it. | |
| setopt HIST_IGNORE_SPACE | |
| setopt HIST_NO_STORE | |
| # When using a hist thing, make a newline show the change before executing it. | |
| setopt HIST_VERIFY | |
| # Save the time and how long a command ran | |
| setopt EXTENDED_HISTORY | |
| setopt HIST_SAVE_NO_DUPS | |
| setopt HIST_EXPIRE_DUPS_FIRST | |
| setopt HIST_FIND_NO_DUPS | |
| #}}} | |
| export GIT_SSL_NO_VERIFY=1 | |
| ## Completions | |
| autoload -U compinit | |
| compinit -C | |
| ## case-insensitive (all),partial-word and then substring completion | |
| zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' \ | |
| 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' | |
| # Sometimes zsh globbing can be annoying, especially when working with [] brackets, but it is necessary to resolve wildcards (* etc) | |
| #setopt no_glob | |
| # NO_HIST_NO_STORE removes commands like history and fc -l from history | |
| #setopt NO_HIST_NO_STORE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment