Last active
March 5, 2020 17:19
-
-
Save texboy/6498642c82c36f4759ed0b9c2b1f530f to your computer and use it in GitHub Desktop.
My zshrc (Based on LukeSmithxyz zoomer shell config)
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
# Luke's config for the Zoomer Shell | |
#Enabling blur | |
if [[ $(ps --no-header -p $PPID -o comm) =~ '^yakuake|konsole$' ]]; then | |
for wid in $(xdotool search --pid $PPID); do | |
xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $wid; done | |
fi | |
# Enable colors and change prompt: | |
autoload -U colors && colors | |
PS1="%B%{$fg[green]%}%Th%b %B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " | |
# History in cache directory: | |
HISTSIZE=10000 | |
SAVEHIST=10000 | |
HISTFILE=~/.cache/zsh/history | |
# Flush history after every command. This will save any command regardless of which terminal is closed last | |
#export PROMPT_COMMAND='history -a' | |
# Git autocomplete | |
zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash | |
fpath=(~/.zsh $fpath) | |
# Basic auto/tab complete: | |
autoload -U compinit | |
zstyle ':completion:*' menu select | |
zmodload zsh/complist | |
# Enable typing + [Up-Arrow] or [Down-Arror] = fuzzy find history forward or backward | |
if [[ "${terminfo[kcuu1]}" != "" ]]; then | |
autoload -U up-line-or-beginning-search | |
zle -N up-line-or-beginning-search | |
bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search | |
fi | |
if [[ "${terminfo[kcud1]}" != "" ]]; then | |
autoload -U down-line-or-beginning-search | |
zle -N down-line-or-beginning-search | |
bindkey "${terminfo[kcud1]}" down-line-or-beginning-search | |
fi | |
#Enables autosuggestions | |
source ~/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh | |
#Loading alias file | |
ALIASFILE=~/.zsh/alias/.alias | |
source $ALIASFILE | |
#ssh hosts file | |
HOSTFILE=~/.zsh/ssh/.hosts | |
source $HOSTFILE | |
function add_alias() { | |
if [[ -z $1 || -z $2 || $# -gt 2 ]]; then | |
echo usage: | |
echo "\t\$$0 ll 'ls -l'" | |
else | |
echo "alias $1='$2'" >> $ALIASFILE | |
echo "alias ADDED to $ALIASFILE" | |
fi | |
} | |
# Edit line in vim with ctrl-e: | |
autoload edit-command-line; zle -N edit-command-line | |
bindkey '^e' edit-command-line | |
# Load zsh-syntax-highlighting; should be after all other plugins but before the terminal calculator. | |
source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh | |
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor) | |
ZSH_HIGHLIGHT_PATTERNS=('rm -rf *' 'fg=white,bold,bg=red') # To have commands starting with `rm -rf` in red: | |
# BEGIN SNIPPET: Magento Cloud CLI configuration | |
HOME=${HOME:-'/home/victor'} | |
export PATH="$HOME/"'.magento-cloud/bin':"$PATH" | |
if [ -f "$HOME/"'.magento-cloud/shell-config.rc' ]; then . "$HOME/"'.magento-cloud/shell-config.rc'; fi # END SNIPPET | |
eval `dircolors /home/victor/.dir_colors/dircolors` | |
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh | |
export PATH=$PATH:/snap/bin | |
export PATH=$PATH:/sbin | |
#export PATH="$HOME/.rbenv/bin:$PATH" | |
#eval "$(rbenv init -)" | |
#export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment