mirror of
https://github.com/andwati/dotfiles.git
synced 2026-11-16 08:45:13 +00:00
zsh configs
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
+27
-124
@@ -1,131 +1,34 @@
|
|||||||
# If not running interactively, don't do anything
|
# Use powerline
|
||||||
[[ $- != *i* ]] && return
|
USE_POWERLINE="true"
|
||||||
|
# Has weird character width
|
||||||
HISTFILE=~/.histfile
|
# Example:
|
||||||
HISTSIZE=1000
|
# is not a diamond
|
||||||
SAVEHIST=1000
|
HAS_WIDECHARS="false"
|
||||||
|
# Source manjaro-zsh-configuration
|
||||||
|
if [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then
|
||||||
autoload -Uz bashcompinit && bashcompinit
|
source /usr/share/zsh/manjaro-zsh-config
|
||||||
# Use completions
|
fi
|
||||||
autoload -Uz compinit && compinit
|
# Use manjaro zsh prompt
|
||||||
autoload -Uz bashcompinit && bashcompinit
|
if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
|
||||||
|
source /usr/share/zsh/manjaro-zsh-prompt
|
||||||
|
|
||||||
### SET VI MODE ###
|
|
||||||
# Uncomment this line to enable vi-like key bindings
|
|
||||||
bindkey -v
|
|
||||||
bindkey '^L' clear-screen
|
|
||||||
|
|
||||||
# If you come from bash you might have to change your $PATH.
|
|
||||||
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
|
|
||||||
|
|
||||||
# Path to your Oh My Zsh installation.
|
|
||||||
export ZSH="$HOME/.oh-my-zsh"
|
|
||||||
|
|
||||||
ZSH_THEME="agnoster"
|
|
||||||
|
|
||||||
zstyle ':omz:update' mode reminder # just remind me to update when it's time
|
|
||||||
|
|
||||||
|
|
||||||
HIST_STAMPS="dd.mm.yyyy"
|
|
||||||
|
|
||||||
plugins=(git)
|
|
||||||
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
|
||||||
|
|
||||||
export LANG=en_US.UTF-8
|
|
||||||
|
|
||||||
# Preferred editor for local and remote sessions
|
|
||||||
if [[ -n $SSH_CONNECTION ]]; then
|
|
||||||
export EDITOR='vim'
|
|
||||||
else
|
|
||||||
export EDITOR='nvim'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Compilation flags
|
|
||||||
export ARCHFLAGS="-arch $(uname -m)"
|
|
||||||
|
|
||||||
source /usr/share/nvm/init-nvm.sh
|
|
||||||
export PYENV_ROOT="$HOME/.pyenv"
|
export PYENV_ROOT="$HOME/.pyenv"
|
||||||
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
||||||
eval "$(pyenv init - zsh)"
|
eval "$(pyenv init - zsh)"
|
||||||
|
source /usr/share/nvm/init-nvm.sh
|
||||||
|
|
||||||
|
# >>> conda initialize >>>
|
||||||
# Aliases
|
# !! Contents within this block are managed by 'conda init' !!
|
||||||
# ls alternatives:
|
__conda_setup="$('/home/ian/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
|
||||||
alias ls='eza -al --icons --color=always --group-directories-first'
|
if [ $? -eq 0 ]; then
|
||||||
alias la='ls -a'
|
eval "$__conda_setup"
|
||||||
alias ll='ls -l | less -RF'
|
else
|
||||||
|
if [ -f "/home/ian/anaconda3/etc/profile.d/conda.sh" ]; then
|
||||||
# track ever growing files
|
. "/home/ian/anaconda3/etc/profile.d/conda.sh"
|
||||||
alias freespace="sudo du -h /* --exclude={'proc','run'}| sort -hr | less"
|
else
|
||||||
|
export PATH="/home/ian/anaconda3/bin:$PATH"
|
||||||
# grep
|
fi
|
||||||
alias grep='grep --colour=auto'
|
|
||||||
|
|
||||||
# Aliases for navigation
|
|
||||||
alias ..='cd ..'
|
|
||||||
alias ...='cd ../..'
|
|
||||||
alias .3='cd ../../..'
|
|
||||||
alias .4='cd ../../../..'
|
|
||||||
alias .5='cd ../../../../..'
|
|
||||||
|
|
||||||
# Automatically ls when changing directory
|
|
||||||
cd() {
|
|
||||||
builtin cd "$@" && ls
|
|
||||||
}
|
|
||||||
|
|
||||||
# show all nearby wifi spots
|
|
||||||
alias scan="nmcli dev wifi"
|
|
||||||
|
|
||||||
### "nvim" as manpager
|
|
||||||
export MANPAGER="nvim +Man!"
|
|
||||||
|
|
||||||
|
|
||||||
### SETTING OTHER ENVIRONMENT VARIABLES
|
|
||||||
if [[ -z "$XDG_CONFIG_HOME" ]] ; then
|
|
||||||
export XDG_CONFIG_HOME="$HOME/.config"
|
|
||||||
fi
|
|
||||||
if [[ -z "$XDG_DATA_HOME" ]] ; then
|
|
||||||
export XDG_DATA_HOME="$HOME/.local/share"
|
|
||||||
fi
|
|
||||||
if [[ -z "$XDG_CACHE_HOME" ]] ; then
|
|
||||||
export XDG_CACHE_HOME="$HOME/.cache"
|
|
||||||
fi
|
fi
|
||||||
|
unset __conda_setup
|
||||||
|
# <<< conda initialize <<<
|
||||||
|
|
||||||
### CHANGE TITLE OF TERMINALS
|
|
||||||
case ${TERM} in
|
|
||||||
xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|alacritty|st|konsole|ghostty*)
|
|
||||||
preexec() { print -Pn "\e]0;%n@%m:%~\a" }
|
|
||||||
;;
|
|
||||||
screen*)
|
|
||||||
preexec() { print -Pn "\e_%n@%m:%~\e\\" }
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Function extract for common file formats
|
|
||||||
ex() {
|
|
||||||
if [[ -z "$1" ]]; then
|
|
||||||
echo "Usage: ex <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|...>"
|
|
||||||
else
|
|
||||||
for n in "$@"; do
|
|
||||||
if [[ -f "$n" ]]; then
|
|
||||||
case "${n%,}" in
|
|
||||||
*.tar.bz2|*.tbz2|*.tar.gz|*.tgz|*.tar.xz|*.txz|*.tar)
|
|
||||||
tar xvf "$n" ;;
|
|
||||||
*.gz) gunzip "$n" ;;
|
|
||||||
*.xz) unxz "$n" ;;
|
|
||||||
*.bz2) bunzip2 "$n" ;;
|
|
||||||
*.zip) unzip "$n" ;;
|
|
||||||
*.7z) 7z x "$n" ;;
|
|
||||||
*.rar) unrar x "$n" ;;
|
|
||||||
*)
|
|
||||||
echo "ex: '$n' - unknown archive method" ;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
echo "'$n' - file does not exist"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user