2021-11-29 00:12:46 +01:00
|
|
|
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
|
|
|
# Initialization code that may require console input (password prompts, [y/n]
|
|
|
|
# confirmations, etc.) must go above this block; everything else may go below.
|
|
|
|
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
|
|
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If you come from bash you might have to change your $PATH.
|
|
|
|
# export PATH=$HOME/bin:/usr/local/bin:$PATH
|
|
|
|
|
|
|
|
# Path to your oh-my-zsh installation.
|
2021-12-03 12:11:11 +01:00
|
|
|
export ZSH="$HOME/.dotfiles/zsh-settings/.oh-my-zsh"
|
2021-11-29 00:12:46 +01:00
|
|
|
|
|
|
|
# Set name of the theme to load --- if set to "random", it will
|
|
|
|
# load a random theme each time oh-my-zsh is loaded, in which case,
|
|
|
|
# to know which specific one was loaded, run: echo $RANDOM_THEME
|
|
|
|
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
|
2021-11-29 11:50:53 +01:00
|
|
|
#ZSH_THEME="powerlevel10k/powerlevel10k"
|
2021-11-30 19:36:15 +01:00
|
|
|
#Powerlevel10k Theme
|
2021-12-03 12:11:11 +01:00
|
|
|
source ~/.dotfiles/zsh-settings/themes/powerlevel10k/powerlevel10k.zsh-theme
|
2021-11-30 19:36:15 +01:00
|
|
|
#Starship Theme
|
|
|
|
#eval "$(starship init zsh)"
|
2021-11-29 00:12:46 +01:00
|
|
|
|
|
|
|
# Set list of themes to pick from when loading at random
|
|
|
|
# Setting this variable when ZSH_THEME=random will cause zsh to load
|
|
|
|
# a theme from this variable instead of looking in $ZSH/themes/
|
|
|
|
# If set to an empty array, this variable will have no effect.
|
|
|
|
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
|
2021-11-29 12:14:14 +01:00
|
|
|
# Uncomment the following line to disable bi-ollowing line if pasting URLs and other text is messed up.
|
2021-11-29 00:12:46 +01:00
|
|
|
# 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.
|
|
|
|
# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work)
|
|
|
|
# See https://github.com/ohmyzsh/ohmyzsh/issues/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"
|
|
|
|
|
2021-12-09 08:04:46 +01:00
|
|
|
# Long history and no double entries, share history between all open sessions,
|
|
|
|
## Histfile is always loaded into ram, so to big might occupy a lot of ram
|
|
|
|
export HISTFILESIZE=100000 # max would be 1000000000
|
|
|
|
export HISTSIZE=100000 # max would be 1000000000
|
|
|
|
setopt SHARE_HISTORY # Share history between all sessions.
|
|
|
|
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
|
|
|
|
setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
|
2021-12-09 08:08:30 +01:00
|
|
|
#setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
|
2021-12-09 08:04:46 +01:00
|
|
|
setopt HIST_VERIFY # Don't execute immediately upon history expansion.
|
|
|
|
|
2021-11-29 00:12:46 +01:00
|
|
|
# Would you like to use another custom folder than $ZSH/custom?
|
|
|
|
# ZSH_CUSTOM=/path/to/new-custom-folder
|
2021-12-03 12:11:11 +01:00
|
|
|
ZSH_CUSTOM=~/.dotfiles/zsh-settings
|
2021-11-29 00:12:46 +01:00
|
|
|
# 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=(
|
2021-12-01 11:56:10 +01:00
|
|
|
adb
|
|
|
|
aliases
|
|
|
|
archlinux
|
|
|
|
battery
|
|
|
|
colored-man-pages
|
|
|
|
colorize
|
|
|
|
copybuffer
|
|
|
|
copydir
|
|
|
|
copyfile
|
|
|
|
dirhistory
|
|
|
|
emacs
|
|
|
|
emoji
|
|
|
|
extract
|
|
|
|
fzf
|
|
|
|
git
|
2021-11-29 15:19:03 +01:00
|
|
|
git-lfs
|
|
|
|
git-prompt
|
2021-12-01 11:56:10 +01:00
|
|
|
isodate
|
2021-11-29 11:29:02 +01:00
|
|
|
jump
|
2021-11-29 15:19:03 +01:00
|
|
|
kate
|
2021-12-01 11:56:10 +01:00
|
|
|
macos
|
|
|
|
npm
|
|
|
|
pip
|
|
|
|
pylint
|
|
|
|
python
|
|
|
|
rsync
|
2021-11-29 15:19:03 +01:00
|
|
|
sudo
|
2021-12-01 11:56:10 +01:00
|
|
|
supervisor
|
|
|
|
systemadmin
|
|
|
|
systemd
|
|
|
|
ubuntu
|
|
|
|
vscode
|
2021-11-30 12:34:11 +01:00
|
|
|
web-search
|
2021-12-01 11:56:10 +01:00
|
|
|
zsh-autosuggestions
|
|
|
|
zsh-syntax-highlighting
|
2021-11-29 15:19:03 +01:00
|
|
|
)
|
2021-11-29 00:12:46 +01:00
|
|
|
|
|
|
|
source $ZSH/oh-my-zsh.sh
|
|
|
|
|
|
|
|
# User configuration
|
|
|
|
|
|
|
|
# export MANPATH="/usr/local/man:$MANPATH"
|
|
|
|
|
|
|
|
# You may need to manually set your language environment
|
|
|
|
# export LANG=en_US.UTF-8
|
|
|
|
|
|
|
|
# Preferred editor for local and remote sessions
|
|
|
|
# if [[ -n $SSH_CONNECTION ]]; then
|
|
|
|
# export EDITOR='vim'
|
|
|
|
# else
|
|
|
|
# export EDITOR='mvim'
|
|
|
|
# fi
|
|
|
|
|
|
|
|
# Compilation flags
|
|
|
|
# export ARCHFLAGS="-arch x86_64"
|
|
|
|
|
|
|
|
# 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 the ZSH_CUSTOM folder.
|
|
|
|
# For a full list of active aliases, run `alias`.
|
|
|
|
#
|
|
|
|
# Example aliases
|
|
|
|
# alias zshconfig="mate ~/.zshrc"
|
|
|
|
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
|
|
|
|
|
|
|
# Move standard ls
|
|
|
|
alias ols="ls"
|
|
|
|
# Base formats
|
|
|
|
alias ls="colorls -A" # short, multi-line
|
|
|
|
#alias ll="colorls -1A" # list, 1 per line
|
|
|
|
alias ld="ll" # ^^^, NOTE: Trying to move to this for alternate hand commands
|
|
|
|
alias la="colorls -lA" # list w/ info
|
|
|
|
# [d] Sort output with directories first
|
|
|
|
alias lsd="ls --sort-dirs"
|
|
|
|
alias lld="ll --sort-dirs"
|
|
|
|
alias ldd="ld --sort-dirs"
|
|
|
|
alias lad="la --sort-dirs"
|
|
|
|
# [t] Sort output with recent modified first
|
|
|
|
alias lst="ls -t"
|
|
|
|
alias llt="ll -t"
|
|
|
|
alias ldt="ld -t"
|
|
|
|
alias lat="la -t"
|
|
|
|
# [g] Add git status of each item in output
|
|
|
|
alias lsg="ls --git-status"
|
|
|
|
alias llg="ll --git-status"
|
|
|
|
alias ldg="ld --git-status"
|
|
|
|
alias lag="la --git-status"
|
|
|
|
|
|
|
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
|
|
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
|
|
|
|
|
|
|
source $(dirname $(gem which colorls))/tab_complete.sh
|
|
|
|
|
|
|
|
#by es
|
|
|
|
## Size of all folders in the current dir
|
|
|
|
alias dud='du -h --max-depth=1 | sort -h'
|
|
|
|
## cd shorter
|
|
|
|
alias cd..="cd .."
|
|
|
|
alias ..="cd .."
|
|
|
|
## grep proc with "psg procname"
|
|
|
|
alias psg="ps aux | grep -v grep | grep -i -e VSZ -e"
|
|
|
|
## always make parent dir if needed (and verbose)
|
|
|
|
alias mkdir="mkdir -pv"
|
|
|
|
## make wget to use continue as default
|
|
|
|
alias wget="wget -c"
|
|
|
|
## get external IP
|
|
|
|
alias myip="curl http://ipecho.net/plain; echo"
|
|
|
|
## vim as default editor
|
|
|
|
export EDITOR=vim
|
2021-12-04 14:56:30 +01:00
|
|
|
##replace htop with bpytop
|
|
|
|
alias htop="bpytop"
|
2021-11-29 00:12:46 +01:00
|
|
|
##Civili Change between repo and play
|
2021-11-29 11:29:02 +01:00
|
|
|
alias civrepo="rm -f ~/.local/share/Steam/steamapps/common/Sid\ Meier\'s\ Civilization\ IV\ Beyond\ the\ Sword/Beyond\ the\ Sword/Mods/Better\ Choices && ln -s /home/elmar/.local/share/Steam/steamapps/common/Sid\ Meier\'s\ Civilization\ IV\ Beyond\ the\ Sword/Beyond\ the\ Sword/Mods/Better\ Choices_repo /home/elmar/.local/share/Steam/steamapps/common/Sid\ Meier\'s\ Civilization\ IV\ Beyond\ the\ Sword/Beyond\ the\ Sword/Mods/Better\ Choices"
|
|
|
|
alias civplay="rm -f ~/.local/share/Steam/steamapps/common/Sid\ Meier\'s\ Civilization\ IV\ Beyond\ the\ Sword/Beyond\ the\ Sword/Mods/Better\ Choices && ln -s /home/elmar/.local/share/Steam/steamapps/common/Sid\ Meier\'s\ Civilization\ IV\ Beyond\ the\ Sword/Beyond\ the\ Sword/Mods/Better\ Choices_play /home/elmar/.local/share/Steam/steamapps/common/Sid\ Meier\'s\ Civilization\ IV\ Beyond\ the\ Sword/Beyond\ the\ Sword/Mods/Better\ Choices"
|
2021-11-29 00:12:46 +01:00
|
|
|
## sshuttle to ssh.geo (root all traffic but local and ssh.geo itself)
|
|
|
|
alias geossh="sshuttle --dns -r ssh -x 192.189.78.0/23 -x 192.168.178.0/23 -x 128.131.74.216 0/0"
|
|
|
|
alias geoes="sshuttle --dns -r es -x 192.189.78.0/23 -x 192.168.178.0/23 -x 128.131.74.216 -x 128.131.72.92 -x 128.131.72.55 0/0"
|
2021-12-09 08:04:46 +01:00
|
|
|
##Librewolf diff profiles
|
|
|
|
alias lwmain="librewolf -p main"
|
|
|
|
alias lwwiss="librewolf -p wiss"
|
2021-11-30 14:50:16 +01:00
|
|
|
#### Show OS Info on startup
|
|
|
|
#if [ -f /usr/bin/screenfetch ]; then screenfetch; fi
|
2021-11-29 00:12:46 +01:00
|
|
|
|
2021-12-05 12:29:18 +01:00
|
|
|
### to prevent accidental shudown, add confirm dialog to commands:
|
|
|
|
askreboot() {
|
|
|
|
autoload colors; colors
|
|
|
|
read -q "answ?Server: $fg[red]$HOST$reset_color - Continue (y/N)?"
|
|
|
|
if [[ "$answ" =~ ^[Yy]$ ]]
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "OK - Rebooting..."
|
|
|
|
sleep 2
|
|
|
|
reboot
|
|
|
|
else
|
|
|
|
echo
|
|
|
|
echo "Canceling..."
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
askshutdown() {
|
|
|
|
read -q "answ?Server: $fg[red]$HOST$reset_color - Continue (y/N)?"
|
|
|
|
if [[ "$answ" =~ ^[Yy]$ ]]
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "OK - Shutting down..."
|
|
|
|
sleep 2
|
|
|
|
shutdown
|
|
|
|
else
|
|
|
|
echo
|
|
|
|
echo "Canceling..."
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
askpoweroff() {
|
|
|
|
read -q "answ?Server: $fg[red]$HOST$reset_color - Continue (y/N)?"
|
|
|
|
if [[ "$answ" =~ ^[Yy]$ ]]
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "OK - Powering down..."
|
|
|
|
sleep 2
|
|
|
|
poweroff
|
|
|
|
else
|
|
|
|
echo
|
|
|
|
echo "Canceling..."
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
alias reboot="askreboot"
|
|
|
|
alias shutdown="askshutdown"
|
|
|
|
alias poweroff="askpoweroff"
|
|
|
|
|
|
|
|
|