diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..5409899 --- /dev/null +++ b/.zshrc @@ -0,0 +1,130 @@ +export TERM=xterm-256color +#autoload -Uz vcs_info +#zstyle ':vcs_info:git*' formats "%b" +#precmd() { vcs_info } +#setopt prompt_subst +PS1=$'\n''╭─%F{black}%f%K{black} (%F{green}%n%f@%F{green}%m%f) (%F{red}%~%f)%k%F{black}%f'$'\n''╰─%F{black}%f%K{black} $> %k%F{black}%f' +RPROMPT='%F{black}%f%K{black}%F{cyan} %*  %f%k%F{black}%f' + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +# zstyle ':omz:update' mode disabled # disable automatic updates +zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) +COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=( + git + zsh-autosuggestions + zsh-syntax-highlighting + fast-syntax-highlighting + #zsh-autocomplete +) +# Preferred editor for local and remote sessions +if [[ -n $SSH_CONNECTION ]]; then + export EDITOR='vim' +else + export EDITOR='nvim' +fi + +# Compilation flags +# export ARCHFLAGS="-arch $(uname -m)" + +# Set personal aliases, overriding those provided by Oh My Zsh libs, +# plugins, and themes. Aliases can be placed here, though Oh My Zsh +# users are encouraged to define aliases within a top-level file in +# the $ZSH_CUSTOM folder, with .zsh extension. Examples: +# - $ZSH_CUSTOM/aliases.zsh +# - $ZSH_CUSTOM/macos.zsh +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +# aliases ############################################# +alias vi='vim' +# enable color support of ls and also add handy aliases +eval `dircolors -b` +alias ls='ls --color=auto' +alias dir='ls --color=auto --format=vertical' +alias vdir='ls --color=auto --format=long' + +# some more ls aliases +alias ll='ls -lhX' +alias la='ls -A' +alias ldir='ls -lhA |grep ^d' +alias lfiles='ls -lhA |grep ^-' +#alias l='ls -CF' + +# To see something coming into ls output: lss +alias lss='ls -lrt | grep $1' + +# To check a process is running in a box with a heavy load: pss +alias pss='ps -ef | grep $1' + +# usefull alias to browse your filesystem for heavy usage quickly +alias ducks='ls -A | grep -v -e '\''^\.\.$'\'' |xargs -i du -ks {} |sort -rn |head -16 | awk '\''{print $2}'\'' | xargs -i du -hs {}' + +# cool colors for manpages +alias man="TERMINFO=~/.terminfo TERM=mostlike LESS=C PAGER=less man" + +alias sudos='sudo -s -H' + +source <(fzf --zsh) + +HISTSIZE=20000 +SAVEHIST=20000 +HISTFILE=~/.zsh_history +setopt HIST_IGNORE_DUPS + +if [[ "$USER" != "root" ]]; then + ~/sysinfo.sh +fi \ No newline at end of file