new layout
This commit is contained in:
parent
005541a96f
commit
1ee7a6234a
17 changed files with 2353 additions and 2 deletions
1935
zsh/.zcompdump
Normal file
1935
zsh/.zcompdump
Normal file
File diff suppressed because it is too large
Load diff
20
zsh/.zshrc
Normal file
20
zsh/.zshrc
Normal file
|
@ -0,0 +1,20 @@
|
|||
source "$ZDOTDIR/export.zsh"
|
||||
source "$ZDOTDIR/history.zsh"
|
||||
source "$ZDOTDIR/zplugin.zsh"
|
||||
source "/usr/share/fzf/completion.zsh"
|
||||
source "/usr/share/fzf/key-bindings.zsh"
|
||||
source "/usr/share/doc/pkgfile/command-not-found.zsh"
|
||||
|
||||
for file in $ZDOTDIR/functions/*.zsh; do source "$file"; done
|
||||
|
||||
# Use lf to switch directories and bind it to ctrl-o
|
||||
lfcd () {
|
||||
tmp="$(mktemp)"
|
||||
lf -last-dir-path="$tmp" "$@"
|
||||
if test -f "$tmp"; then
|
||||
dir="$(cat "$tmp")"
|
||||
rm -f "$tmp"
|
||||
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
|
||||
fi
|
||||
}
|
||||
bindkey -s '^o' 'lfcd\n'
|
2
zsh/dircolor.zsh
Normal file
2
zsh/dircolor.zsh
Normal file
|
@ -0,0 +1,2 @@
|
|||
LS_COLORS='no=00;37:fi=01;34:rs=00;37:di=00;34:ln=00;36:mh=00;37:pi=40;33:so=00;35:do=00;35:bd=40;33;01:cd=40;33;01:or=00;05;37;41:mi=00;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=04;34:st=37;44:ex=00;32:*.cmd=00;33:*.exe=00;33:*.com=00;33:*.btm=00;33:*.bat=00;33:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz=01;31:*.bz2=01;31:*.bzip2=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.apk=01;31:*.gem=01;31:*.jpg=00;35:*.JPG=00;35:*.jpeg=00;35:*.gif=00;35:*.bmp=00;35:*.pbm=00;35:*.pgm=00;35:*.ppm=00;35:*.tga=00;35:*.xbm=00;35:*.xpm=00;35:*.tif=00;35:*.tiff=00;35:*.png=00;35:*.svg=00;35:*.svgz=00;35:*.mng=00;35:*.pcx=00;35:*.dl=00;35:*.xcf=00;35:*.xwd=00;35:*.yuv=00;35:*.cgm=00;35:*.emf=00;35:*.eps=00;35:*.CR2=00;35:*.ico=00;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.html=00;32:*.rst=00;32:*.md=00;32:*.patch=00;32:*.diff=00;32:*.tex=00;32:*.doc=00;32:*.xml=00;32:*.xls=00;32:*.xlsx=00;32:*.doc=00;32:*.docx=00;32:*.ppt=00;32:*.pptx=00;32:*.key=00;32:*.pt=01;32:*.tmpl=01;32:*.in=01;32:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.m4a=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:*.mov=01;36:*.mpg=01;36:*.mpeg=01;36:*.m2v=01;36:*.mkv=01;36:*.ogm=01;36:*.mp4=01;36:*.m4v=01;36:*.mp4v=01;36:*.vob=01;36:*.qt=01;36:*.nuv=01;36:*.wmv=01;36:*.asf=01;36:*.rm=01;36:*.rmvb=01;36:*.flc=01;36:*.avi=01;36:*.fli=01;36:*.flv=01;36:*.gl=01;36:*.m2ts=01;36:*.divx=01;36:*.webm=01;36:*.axv=01;36:*.anx=01;36:*.ogv=01;36:*.ogx=01;36:*.conf=00;36:*.cnf=00;36:*.cfg=00;36:*.ini=00;36:*.properties=00;36:*.yaml=00;36:*.vcl=00;36:*.c=00;33:*.cpp=00;33:*.py=00;33:*.coffesscript=00;33:*.js=00;33:*.rb=00;33:*.sh=00;33:*.zsh=00;33:*.env=00;33:*.bash=00;33:*.php=00;33:*.java=00;33:*.zcml=00;33:*.db=00;32:*.sql=00;32:*.json=00;32:*.plist=00;32:*.fs=00;32:*.tex=01;37:*.rdf=01;37:*.owl=01;37:*.n3=01;37:*.ttl=01;37:*.nt=01;37:*.torrent=01;37:*.xml=01;37:*Makefile=01;37:*Rakefile=01;37:*build.xml=01;37:*rc=01;37:*.nfo=01;37:*README=01;37:*README.txt=01;37:*readme.txt=01;37:*README.markdown=01;37:*README.md=01;37:*.ini=01;37:*.yml=01;37:*.cfg=01;37:*.conf=01;37:*.c=01;37:*.cpp=01;37:*.cc=01;37:*.log=01;30:*.bak=01;30:*.aux=01;30:*.lof=01;30:*.lol=01;30:*.lot=01;30:*.out=01;30:*.toc=01;30:*.bbl=01;30:*.blg=01;30:*~=01;30:*#=01;30:*.part=01;30:*.incomplete=01;30:*.swp=01;30:*.tmp=01;30:*.temp=01;30:*.o=01;30:*.obj=01;30:*.pyc=01;30:*.pyo=01;30:*.class=01;30:*.cache=01;30:*.egg-info=01;30:';
|
||||
export LS_COLORS
|
10
zsh/export.zsh
Normal file
10
zsh/export.zsh
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Local Path Additions
|
||||
export path=($path ${HOME}/.config/dotfiles/bin /opt/phalcon-devtools)
|
||||
export PTOOLSPATH="/opt/phalcon-devtools/"
|
||||
|
||||
# Stuff for Homebrew
|
||||
export path=($path /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/bin)
|
||||
export fpath=($fpath /home/linuxbrew/.linuxbrew/share/zsh/site-functions)
|
||||
export manpath=($manpath /home/linuxbrew/.linuxbrew/share/man)
|
||||
export infopath=($infopath /home/linuxbrew/.linuxbrew/share/info)
|
||||
export XDG_DATA_DIRS=($XDG_DATA_DIRS /home/linuxbrew/.linuxbrew/share)
|
71
zsh/functions/extract.zsh
Normal file
71
zsh/functions/extract.zsh
Normal file
|
@ -0,0 +1,71 @@
|
|||
alias x=extract
|
||||
|
||||
extract() {
|
||||
local remove_archive
|
||||
local success
|
||||
local extract_dir
|
||||
|
||||
if (( $# == 0 )); then
|
||||
cat <<-'EOF' >&2
|
||||
Usage: extract [-option] [file ...]
|
||||
|
||||
Options:
|
||||
-r, --remove Remove archive after unpacking.
|
||||
EOF
|
||||
fi
|
||||
|
||||
remove_archive=1
|
||||
if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
|
||||
remove_archive=0
|
||||
shift
|
||||
fi
|
||||
|
||||
while (( $# > 0 )); do
|
||||
if [[ ! -f "$1" ]]; then
|
||||
echo "extract: '$1' is not a valid file" >&2
|
||||
shift
|
||||
continue
|
||||
fi
|
||||
|
||||
success=0
|
||||
extract_dir="${1:t:r}"
|
||||
case "${1:l}" in
|
||||
(*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;;
|
||||
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
|
||||
(*.tar.xz|*.txz)
|
||||
tar --xz --help &> /dev/null \
|
||||
&& tar --xz -xvf "$1" \
|
||||
|| xzcat "$1" | tar xvf - ;;
|
||||
(*.tar.zma|*.tlz)
|
||||
tar --lzma --help &> /dev/null \
|
||||
&& tar --lzma -xvf "$1" \
|
||||
|| lzcat "$1" | tar xvf - ;;
|
||||
(*.tar) tar xvf "$1" ;;
|
||||
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
|
||||
(*.bz2) bunzip2 "$1" ;;
|
||||
(*.xz) unxz "$1" ;;
|
||||
(*.lzma) unlzma "$1" ;;
|
||||
(*.z) uncompress "$1" ;;
|
||||
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
|
||||
(*.rar) unrar x -ad "$1" ;;
|
||||
(*.7z) 7za x "$1" ;;
|
||||
(*.deb)
|
||||
mkdir -p "$extract_dir/control"
|
||||
mkdir -p "$extract_dir/data"
|
||||
cd "$extract_dir"; ar vx "../${1}" > /dev/null
|
||||
cd control; tar xzvf ../control.tar.gz
|
||||
cd ../data; extract ../data.tar.*
|
||||
cd ..; rm *.tar.* debian-binary
|
||||
cd ..
|
||||
;;
|
||||
(*)
|
||||
echo "extract: '$1' cannot be extracted" >&2
|
||||
success=1
|
||||
;;
|
||||
esac
|
||||
|
||||
(( success = $success > 0 ? $success : $? ))
|
||||
(( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1"
|
||||
shift
|
||||
done
|
||||
}
|
8
zsh/functions/systemctl.zsh
Normal file
8
zsh/functions/systemctl.zsh
Normal file
|
@ -0,0 +1,8 @@
|
|||
cmds=(status show start stop reload restart enable disable daemon-reload)
|
||||
|
||||
for cmd in $cmds; do
|
||||
alias sc-$cmd="sudo systemctl $cmd"
|
||||
done
|
||||
|
||||
alias sc-enablenow="sc-enable --now"
|
||||
alias sc-disablenow="sc-disable --now"
|
40
zsh/history.zsh
Normal file
40
zsh/history.zsh
Normal file
|
@ -0,0 +1,40 @@
|
|||
## History wrapper
|
||||
function omz_history {
|
||||
local clear list
|
||||
zparseopts -E c=clear l=list
|
||||
|
||||
if [[ -n "$clear" ]]; then
|
||||
# if -c provided, clobber the history file
|
||||
echo -n >| "$HISTFILE"
|
||||
echo >&2 History file deleted. Reload the session to see its effects.
|
||||
elif [[ -n "$list" ]]; then
|
||||
# if -l provided, run as if calling `fc' directly
|
||||
builtin fc "$@"
|
||||
else
|
||||
# unless a number is provided, show all history events (starting from 1)
|
||||
[[ ${@[-1]-} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Timestamp format
|
||||
case ${HIST_STAMPS-} in
|
||||
"mm/dd/yyyy") alias history='omz_history -f' ;;
|
||||
"dd.mm.yyyy") alias history='omz_history -E' ;;
|
||||
"yyyy-mm-dd") alias history='omz_history -i' ;;
|
||||
"") alias history='omz_history' ;;
|
||||
*) alias history="omz_history -t '$HIST_STAMPS'" ;;
|
||||
esac
|
||||
|
||||
# History in cache directory:
|
||||
HISTSIZE=50000
|
||||
SAVEHIST=10000
|
||||
HISTFILE=$HOME/.cache/zsh/history
|
||||
|
||||
## History command configuration
|
||||
setopt extended_history # record timestamp of command in HISTFILE
|
||||
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
|
||||
setopt hist_ignore_dups # ignore duplicated commands history list
|
||||
setopt hist_ignore_space # ignore commands that start with space
|
||||
setopt hist_verify # show command with history expansion to user before running it
|
||||
setopt inc_append_history # add commands to HISTFILE in order of execution
|
||||
setopt share_history # share command history data
|
55
zsh/zplugin.zsh
Normal file
55
zsh/zplugin.zsh
Normal file
|
@ -0,0 +1,55 @@
|
|||
declare -A ZPLGM
|
||||
ZPLGM[BIN_DIR]="$HOME/.config/dotfiles/zplugin/bin"
|
||||
ZPLGM[HOME_DIR]="$HOME/.config/dotfiles/zplugin"
|
||||
|
||||
source $HOME/.config/dotfiles/zplugin/bin/zplugin.zsh
|
||||
|
||||
zplugin ice wait blockf atpull'zplugin creinstall -q .' silent
|
||||
zplugin light zsh-users/zsh-completions
|
||||
|
||||
zplugin ice wait atload"_zsh_autosuggest_start" silent
|
||||
zplugin light zsh-users/zsh-autosuggestions
|
||||
|
||||
zplugin ice pick"async.zsh" silent
|
||||
zplugin light mafredri/zsh-async
|
||||
zplugin ice pick"z4rr3t.zsh" silent
|
||||
zplugin light inimicus/z4rr3t
|
||||
|
||||
# lib files
|
||||
zplugin snippet OMZ::lib/clipboard.zsh
|
||||
zplugin snippet OMZ::lib/completion.zsh
|
||||
zplugin snippet OMZ::lib/directories.zsh
|
||||
zplugin snippet OMZ::lib/functions.zsh
|
||||
zplugin snippet OMZ::lib/grep.zsh
|
||||
zplugin snippet OMZ::lib/key-bindings.zsh
|
||||
zplugin snippet OMZ::lib/misc.zsh
|
||||
zplugin snippet OMZ::lib/spectrum.zsh
|
||||
zplugin snippet OMZ::lib/termsupport.zsh
|
||||
|
||||
alias ls="ls --color=tty"
|
||||
setopt auto_cd
|
||||
setopt multios
|
||||
setopt prompt_subst
|
||||
|
||||
zplugin snippet OMZ::plugins/common-aliases/common-aliases.plugin.zsh
|
||||
zplugin ice wait as"completion" silent
|
||||
zplugin snippet OMZ::plugins/pip/_pip
|
||||
zplugin snippet OMZ::plugins/pip/pip.plugin.zsh
|
||||
zplugin snippet OMZ::plugins/python/python.plugin.zsh
|
||||
zplugin snippet OMZ::plugins/gitignore/gitignore.plugin.zsh
|
||||
|
||||
# ls_colors
|
||||
source $ZDOTDIR/dircolor.zsh
|
||||
zstyle ":completion:*" list-colors “${(s.:.)LS_COLORS}
|
||||
|
||||
# syyntax highlighting
|
||||
zplugin ice wait atinit"zpcompinit; zpcdreplay -q" silent
|
||||
zplugin light zsh-users/zsh-syntax-highlighting
|
||||
|
||||
#has - program
|
||||
zplugin ice as"program" pick"has" wait silent
|
||||
zplugin light kdabir/has
|
||||
|
||||
#is - program
|
||||
zplugin ice as"program" atclone"cp is.sh is" atpull"%atclone" pick"is" wait silent
|
||||
zplugin light qzb/is.sh
|
Loading…
Add table
Add a link
Reference in a new issue