mirror of
https://github.com/artizirk/dotfiles.git
synced 2024-11-22 16:30:59 +02:00
Organize .zshrc
This commit is contained in:
parent
1140de52af
commit
065db40854
98
.zshrc
98
.zshrc
@ -84,39 +84,19 @@ function chpwd_auto_python_venv() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
chpwd_functions+=(chpwd_auto_python_venv)
|
chpwd_functions+=(chpwd_auto_python_venv)
|
||||||
|
chpwd_auto_python_venv # Try to enter venv on shell startup
|
||||||
|
|
||||||
# https://github.com/Tarrasch/zsh-autoenv
|
# https://github.com/Tarrasch/zsh-autoenv
|
||||||
xsource ~/.config/zsh/zsh-autoenv/autoenv.zsh
|
xsource ~/.config/zsh/zsh-autoenv/autoenv.zsh
|
||||||
|
# Set gnome-terminal and other vte terminal title to current dir
|
||||||
|
xsource /etc/profile.d/vte.sh
|
||||||
|
# gitflow-zshcompletion-avh
|
||||||
|
xsource /usr/share/zsh/site-functions/git-flow-completion.zsh
|
||||||
|
#pkg not found
|
||||||
|
xsource /usr/share/doc/pkgfile/command-not-found.zsh
|
||||||
|
|
||||||
if [[ -f /etc/profile.d/vte.sh ]]; then
|
|
||||||
source /etc/profile.d/vte.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
function new-scratch {
|
|
||||||
cur_dir="$HOME/scratch"
|
|
||||||
new_dir="$HOME/tmp/scratch-`date +'%s'`"
|
|
||||||
mkdir -p $new_dir
|
|
||||||
ln -nfs $new_dir $cur_dir
|
|
||||||
cd $cur_dir
|
|
||||||
echo "New scratch dir ready for grinding ;>"
|
|
||||||
}
|
|
||||||
|
|
||||||
histsearch() { fc -lim "*$@*" 1 }
|
|
||||||
|
|
||||||
alias pacman="sudo pacman"
|
|
||||||
alias py="python"
|
|
||||||
alias py2="python2"
|
|
||||||
alias ll="ls -lh"
|
|
||||||
alias la="ls -a"
|
|
||||||
alias dmesg="dmesg -L"
|
|
||||||
alias disapprove="firefox 'data:text/html;base64,PGRpdiBzdHlsZT0idGV4dC1hbGlnbjpjZW50ZXI7Zm9udC1zaXplOjU1dm1pbiI+JiMzMjMyO18mIzMyMzI7PC9kaXY+Cg=='"
|
|
||||||
alias ipy="ipython"
|
|
||||||
alias htop="htop -d 10"
|
|
||||||
alias ip="ip -color=auto"
|
|
||||||
alias cp="cp --reflink=auto"
|
|
||||||
alias cal="cal -w3"
|
|
||||||
alias gitg="LANG=en_US.UTF-8 gitg"
|
|
||||||
|
|
||||||
|
# fzf history search with support for Ctrl+E history edit like with zaw widget before
|
||||||
if [[ -f /usr/share/fzf/key-bindings.zsh && -f /usr/share/fzf/completion.zsh ]]; then
|
if [[ -f /usr/share/fzf/key-bindings.zsh && -f /usr/share/fzf/completion.zsh ]]; then
|
||||||
source /usr/share/fzf/key-bindings.zsh
|
source /usr/share/fzf/key-bindings.zsh
|
||||||
source /usr/share/fzf/completion.zsh
|
source /usr/share/fzf/completion.zsh
|
||||||
@ -152,18 +132,53 @@ if [[ -f /usr/share/fzf/key-bindings.zsh && -f /usr/share/fzf/completion.zsh ]];
|
|||||||
bindkey '^R' fzf-history-widget
|
bindkey '^R' fzf-history-widget
|
||||||
fi
|
fi
|
||||||
|
|
||||||
EDITOR=nvim
|
|
||||||
VISUAL=nvim
|
# Paste handling
|
||||||
|
autoload -Uz bracketed-paste-magic
|
||||||
|
zle -N bracketed-paste bracketed-paste-magic
|
||||||
|
|
||||||
|
autoload -Uz bracketed-paste-url-magic
|
||||||
|
zle -N bracketed-paste bracketed-paste-url-magic
|
||||||
|
|
||||||
|
# Reverse `cd -<TAB>` history menu
|
||||||
|
setopt pushdminus
|
||||||
|
#
|
||||||
|
# Utility functions
|
||||||
|
|
||||||
|
function new-scratch {
|
||||||
|
cur_dir="$HOME/scratch"
|
||||||
|
new_dir="$HOME/tmp/scratch-`date +'%s'`"
|
||||||
|
mkdir -p $new_dir
|
||||||
|
ln -nfs $new_dir $cur_dir
|
||||||
|
cd $cur_dir
|
||||||
|
echo "New scratch dir ready for grinding ;>"
|
||||||
|
}
|
||||||
|
|
||||||
|
histsearch() { fc -lim "*$@*" 1 }
|
||||||
|
|
||||||
|
alias pacman="sudo pacman"
|
||||||
|
alias py="python"
|
||||||
|
alias py2="python2"
|
||||||
|
alias ll="ls -lh"
|
||||||
|
alias la="ls -a"
|
||||||
|
alias dmesg="dmesg -L"
|
||||||
|
alias disapprove="firefox 'data:text/html;base64,PGRpdiBzdHlsZT0idGV4dC1hbGlnbjpjZW50ZXI7Zm9udC1zaXplOjU1dm1pbiI+JiMzMjMyO18mIzMyMzI7PC9kaXY+Cg=='"
|
||||||
|
alias ipy="ipython"
|
||||||
|
alias htop="htop -d 10"
|
||||||
|
alias ip="ip -color=auto"
|
||||||
|
alias cp="cp --reflink=auto"
|
||||||
|
alias cal="cal -w3"
|
||||||
|
alias gitg="LANG=en_US.UTF-8 gitg"
|
||||||
|
|
||||||
|
|
||||||
|
export EDITOR=nvim
|
||||||
|
export VISUAL=nvim
|
||||||
MAILCHECK=0
|
MAILCHECK=0
|
||||||
MAIL=~/Mail
|
MAIL=~/Mail
|
||||||
|
|
||||||
# iostat colors
|
# iostat colors
|
||||||
export S_COLORS=auto
|
export S_COLORS=auto
|
||||||
|
|
||||||
if [[ -f /usr/share/zsh/site-functions/git-flow-completion.zsh ]];then
|
|
||||||
source /usr/share/zsh/site-functions/git-flow-completion.zsh
|
|
||||||
fi
|
|
||||||
|
|
||||||
if command -v ruby > /dev/null; then
|
if command -v ruby > /dev/null; then
|
||||||
ruby_gem_user_dir="$(ruby -e 'print Gem.user_dir')"
|
ruby_gem_user_dir="$(ruby -e 'print Gem.user_dir')"
|
||||||
else
|
else
|
||||||
@ -189,11 +204,6 @@ unsetopt share_history
|
|||||||
setopt INC_APPEND_HISTORY_TIME
|
setopt INC_APPEND_HISTORY_TIME
|
||||||
|
|
||||||
|
|
||||||
#pkg not found
|
|
||||||
if [ -f /usr/share/doc/pkgfile/command-not-found.zsh ]; then
|
|
||||||
source /usr/share/doc/pkgfile/command-not-found.zsh
|
|
||||||
fi
|
|
||||||
|
|
||||||
function gedit {
|
function gedit {
|
||||||
local REAL_PATH=$PATH;
|
local REAL_PATH=$PATH;
|
||||||
if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
|
if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
|
||||||
@ -215,13 +225,3 @@ export JOBS=8
|
|||||||
function vless {
|
function vless {
|
||||||
/usr/share/nvim/runtime/macros/less.sh $@
|
/usr/share/nvim/runtime/macros/less.sh $@
|
||||||
}
|
}
|
||||||
|
|
||||||
# Paste handling
|
|
||||||
autoload -Uz bracketed-paste-magic
|
|
||||||
zle -N bracketed-paste bracketed-paste-magic
|
|
||||||
|
|
||||||
autoload -Uz bracketed-paste-url-magic
|
|
||||||
zle -N bracketed-paste bracketed-paste-url-magic
|
|
||||||
|
|
||||||
# Reverse `cd -<TAB>` history menu
|
|
||||||
setopt pushdminus
|
|
||||||
|
Loading…
Reference in New Issue
Block a user