quick push
This commit is contained in:
parent
0b80b80e2d
commit
a7c8aaa93d
12 changed files with 6 additions and 448 deletions
|
@ -3,9 +3,15 @@
|
|||
|
||||
# Clone Prezto
|
||||
git clone --recursive https://github.com/steveokard/prezto.git "${ZDOTDIR:-$HOME}/stevset/prezto/.zprezto"
|
||||
|
||||
#Remove old stuff
|
||||
rm -rf ~/.zshrc ~/.zsh
|
||||
|
||||
#Make Environment Links, per github readme
|
||||
setopt EXTENDED_GLOB
|
||||
for rcfile in "${ZDOTDIR:-$HOME}"/stevset/prezto/.zprezto/runcoms/^README.md(.N); do
|
||||
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
|
||||
done
|
||||
|
||||
#Fix History
|
||||
cat ~/.zsh_history > ~/.zhistory
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
#Readability aliases
|
||||
alias lss='ls -alh --color=auto'
|
||||
alias mount='mount |column -t'
|
||||
alias df='df -H'
|
||||
#Shell Function aliases
|
||||
alias dirs="dirs -v"
|
||||
alias h='history'
|
||||
alias j='jobs -l'
|
||||
#shortcuts aliases
|
||||
alias please="sudo !!"
|
||||
alias ping='ping -c 5'
|
||||
alias ax="chmod a+x"
|
||||
alias wmip="curl icanhazip.com"
|
||||
#git aliases
|
||||
alias gitS='git status'
|
||||
alias gitL='git log'
|
||||
alias gitD='git diff'
|
||||
alias gitC='git commit -a'
|
||||
#Apt aliases
|
||||
alias aptup="sudo apt update && sudo apt upgrade"
|
||||
alias aptrm="sudo apt autoremove && sudo apt autoclean"
|
||||
#Combo aliases
|
||||
mcd() { mkdir -p "$1"; cd "$1";} #make a directory and cd into it
|
||||
cls() { cd "$1"; ls;} #cd into directory and list contents
|
||||
md5check() { md5sum "$1" | grep "$2";} #md5sum file, compare to md5sum as second parameter
|
||||
#ssh aliases
|
||||
alias sagent="eval `ssh-agent`"
|
||||
|
||||
#Command Replacement aliases
|
||||
alias less='less -imJMW'
|
|
@ -1,161 +0,0 @@
|
|||
#
|
||||
# Sets completion options.
|
||||
#
|
||||
# Authors:
|
||||
# Robby Russell <robby@planetargon.com>
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# Return if requirements are not found.
|
||||
if [[ "$TERM" == 'dumb' ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Add zsh-completions to $fpath.
|
||||
fpath=("${0:h}/external/src" $fpath)
|
||||
|
||||
#
|
||||
# Options
|
||||
#
|
||||
|
||||
setopt COMPLETE_IN_WORD # Complete from both ends of a word.
|
||||
setopt ALWAYS_TO_END # Move cursor to the end of a completed word.
|
||||
setopt PATH_DIRS # Perform path search even on command names with slashes.
|
||||
setopt AUTO_MENU # Show completion menu on a successive tab press.
|
||||
setopt AUTO_LIST # Automatically list choices on ambiguous completion.
|
||||
setopt AUTO_PARAM_SLASH # If completed parameter is a directory, add a trailing slash.
|
||||
setopt EXTENDED_GLOB # Needed for file modification glob modifiers with compinit
|
||||
unsetopt MENU_COMPLETE # Do not autoselect the first completion entry.
|
||||
unsetopt FLOW_CONTROL # Disable start/stop characters in shell editor.
|
||||
|
||||
# Load and initialize the completion system ignoring insecure directories with a
|
||||
# cache time of 20 hours, so it should almost always regenerate the first time a
|
||||
# shell is opened each day.
|
||||
autoload -Uz compinit
|
||||
_comp_files=(${ZDOTDIR:-$HOME}/.zcompdump(Nm-20))
|
||||
if (( $#_comp_files )); then
|
||||
compinit -i -C
|
||||
else
|
||||
compinit -i
|
||||
fi
|
||||
unset _comp_files
|
||||
|
||||
#
|
||||
# Styles
|
||||
#
|
||||
|
||||
# Use caching to make completion for commands such as dpkg and apt usable.
|
||||
zstyle ':completion::complete:*' use-cache on
|
||||
zstyle ':completion::complete:*' cache-path "${ZDOTDIR:-$HOME}/.zcompcache"
|
||||
|
||||
# Case-insensitive (all), partial-word, and then substring completion.
|
||||
if zstyle -t ':prezto:module:completion:*' case-sensitive; then
|
||||
zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
||||
setopt CASE_GLOB
|
||||
else
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
||||
unsetopt CASE_GLOB
|
||||
fi
|
||||
|
||||
# Group matches and describe.
|
||||
zstyle ':completion:*:*:*:*:*' menu select
|
||||
zstyle ':completion:*:matches' group 'yes'
|
||||
zstyle ':completion:*:options' description 'yes'
|
||||
zstyle ':completion:*:options' auto-description '%d'
|
||||
zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f'
|
||||
zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f'
|
||||
zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f'
|
||||
zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f'
|
||||
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
|
||||
zstyle ':completion:*' format ' %F{yellow}-- %d --%f'
|
||||
zstyle ':completion:*' group-name ''
|
||||
zstyle ':completion:*' verbose yes
|
||||
|
||||
# Fuzzy match mistyped completions.
|
||||
zstyle ':completion:*' completer _complete _match _approximate
|
||||
zstyle ':completion:*:match:*' original only
|
||||
zstyle ':completion:*:approximate:*' max-errors 1 numeric
|
||||
|
||||
# Increase the number of errors based on the length of the typed word. But make
|
||||
# sure to cap (at 7) the max-errors to avoid hanging.
|
||||
zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3>7?7:($#PREFIX+$#SUFFIX)/3))numeric)'
|
||||
|
||||
# Don't complete unavailable commands.
|
||||
zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))'
|
||||
|
||||
# Array completion element sorting.
|
||||
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
|
||||
|
||||
# Directories
|
||||
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
||||
zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories
|
||||
zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
|
||||
zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand'
|
||||
zstyle ':completion:*' squeeze-slashes true
|
||||
|
||||
# History
|
||||
zstyle ':completion:*:history-words' stop yes
|
||||
zstyle ':completion:*:history-words' remove-all-dups yes
|
||||
zstyle ':completion:*:history-words' list false
|
||||
zstyle ':completion:*:history-words' menu yes
|
||||
|
||||
# Environmental Variables
|
||||
zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-}
|
||||
|
||||
# Populate hostname completion. But allow ignoring custom entries from static
|
||||
# */etc/hosts* which might be uninteresting.
|
||||
zstyle -a ':prezto:module:completion:*:hosts' etc-host-ignores '_etc_host_ignores'
|
||||
|
||||
zstyle -e ':completion:*:hosts' hosts 'reply=(
|
||||
${=${=${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2> /dev/null)"}%%[#| ]*}//\]:[0-9]*/ }//,/ }//\[/ }
|
||||
${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2> /dev/null))"}%%(\#${_etc_host_ignores:+|${(j:|:)~_etc_host_ignores}})*}
|
||||
${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2> /dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}}
|
||||
)'
|
||||
|
||||
# Don't complete uninteresting users...
|
||||
zstyle ':completion:*:*:*:users' ignored-patterns \
|
||||
adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
|
||||
dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
|
||||
hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
|
||||
mailman mailnull mldonkey mysql nagios \
|
||||
named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
|
||||
operator pcap postfix postgres privoxy pulse pvm quagga radvd \
|
||||
rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs '_*'
|
||||
|
||||
# ... unless we really want to.
|
||||
zstyle '*' single-ignored show
|
||||
|
||||
# Ignore multiple entries.
|
||||
zstyle ':completion:*:(rm|kill|diff):*' ignore-line other
|
||||
zstyle ':completion:*:rm:*' file-patterns '*:all-files'
|
||||
|
||||
# Kill
|
||||
zstyle ':completion:*:*:*:*:processes' command 'ps -u $LOGNAME -o pid,user,command -w'
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;36=0=01'
|
||||
zstyle ':completion:*:*:kill:*' menu yes select
|
||||
zstyle ':completion:*:*:kill:*' force-list always
|
||||
zstyle ':completion:*:*:kill:*' insert-ids single
|
||||
|
||||
# Man
|
||||
zstyle ':completion:*:manuals' separate-sections true
|
||||
zstyle ':completion:*:manuals.(^1*)' insert-sections true
|
||||
|
||||
# Media Players
|
||||
zstyle ':completion:*:*:mpg123:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories'
|
||||
zstyle ':completion:*:*:mpg321:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories'
|
||||
zstyle ':completion:*:*:ogg123:*' file-patterns '*.(ogg|OGG|flac):ogg\ files *(-/):directories'
|
||||
zstyle ':completion:*:*:mocp:*' file-patterns '*.(wav|WAV|mp3|MP3|ogg|OGG|flac):ogg\ files *(-/):directories'
|
||||
|
||||
# Mutt
|
||||
if [[ -s "$HOME/.mutt/aliases" ]]; then
|
||||
zstyle ':completion:*:*:mutt:*' menu yes select
|
||||
zstyle ':completion:*:mutt:*' users ${${${(f)"$(<"$HOME/.mutt/aliases")"}#alias[[:space:]]}%%[[:space:]]*}
|
||||
fi
|
||||
|
||||
# SSH/SCP/RSYNC
|
||||
zstyle ':completion:*:(ssh|scp|rsync):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
|
||||
zstyle ':completion:*:(scp|rsync):*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
|
||||
zstyle ':completion:*:ssh:*' group-order users hosts-domain hosts-host users hosts-ipaddr
|
||||
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost
|
||||
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*'
|
||||
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'
|
|
@ -1,33 +0,0 @@
|
|||
# Changing/making/removing directory
|
||||
setopt auto_pushd
|
||||
setopt pushd_ignore_dups
|
||||
setopt pushdminus
|
||||
|
||||
alias -g ...='../..'
|
||||
alias -g ....='../../..'
|
||||
alias -g .....='../../../..'
|
||||
alias -g ......='../../../../..'
|
||||
|
||||
alias -- -='cd -'
|
||||
alias 1='cd -'
|
||||
alias 2='cd -2'
|
||||
alias 3='cd -3'
|
||||
alias 4='cd -4'
|
||||
alias 5='cd -5'
|
||||
alias 6='cd -6'
|
||||
alias 7='cd -7'
|
||||
alias 8='cd -8'
|
||||
alias 9='cd -9'
|
||||
|
||||
alias md='mkdir -p'
|
||||
alias rd=rmdir
|
||||
|
||||
# List directory contents
|
||||
alias lsa='ls -lah'
|
||||
alias l='ls -lah'
|
||||
alias ll='ls -lh'
|
||||
alias la='ls -lAh'
|
||||
|
||||
# Push and pop directories on directory stack
|
||||
alias pu='pushd'
|
||||
alias po='popd'
|
|
@ -1,20 +0,0 @@
|
|||
extract() {
|
||||
if [ -f $1 ] ; then
|
||||
case $1 in
|
||||
*.tar.bz2) tar xjf $1 ;;
|
||||
*.tar.gz) tar xzf $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.rar) unrar e $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xf $1 ;;
|
||||
*.tbz2) tar xjf $1 ;;
|
||||
*.tgz) tar xzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*) echo "'$1' cannot be extracted via extract()" ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file"
|
||||
fi
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
# Find a file with a pattern in name:
|
||||
#--------------------------------------------------------------------
|
||||
function ff() { find . -type f -iname '*'"$*"'*' -ls ; }
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
## Command history configuration
|
||||
if [ -z "$HISTFILE" ]; then
|
||||
HISTFILE=$HOME/.zsh_history
|
||||
fi
|
||||
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
|
||||
# Show history
|
||||
case $HIST_STAMPS in
|
||||
"mm/dd/yyyy") alias history='fc -fl 1' ;;
|
||||
"dd.mm.yyyy") alias history='fc -El 1' ;;
|
||||
"yyyy-mm-dd") alias history='fc -il 1' ;;
|
||||
*) alias history='fc -l 1' ;;
|
||||
esac
|
||||
|
||||
setopt append_history
|
||||
setopt extended_history
|
||||
setopt hist_expire_dups_first
|
||||
setopt hist_ignore_dups # ignore duplication command history list
|
||||
setopt hist_ignore_space
|
||||
setopt hist_verify
|
||||
setopt inc_append_history
|
||||
setopt share_history # share command history data
|
|
@ -1,14 +0,0 @@
|
|||
# ls colors
|
||||
autoload -U colors && colors
|
||||
|
||||
# # Enable ls colors
|
||||
export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||
|
||||
# Take advantage of $LS_COLORS for completion as well.
|
||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
|
||||
### super user alias
|
||||
alias _='sudo'
|
||||
|
||||
# recognize comments
|
||||
setopt interactivecomments
|
|
@ -1,30 +0,0 @@
|
|||
#
|
||||
# Defines systemctl aliases.
|
||||
#
|
||||
# Authors:
|
||||
# Augusto Rocha Elesbão <aelesbao@gmail.com>
|
||||
#
|
||||
|
||||
# Return if requirements are not found.
|
||||
if (( ! $+commands[systemctl] )); then
|
||||
return 1
|
||||
fi
|
||||
|
||||
user_commands=(
|
||||
list-units is-active status show help list-unit-files
|
||||
is-enabled list-jobs show-environment
|
||||
)
|
||||
|
||||
for c in $user_commands; do; alias sc-$c="systemctl $c"; done
|
||||
|
||||
unset user_commands
|
||||
|
||||
sudo_commands=(
|
||||
start stop reload restart try-restart isolate kill
|
||||
reset-failed enable disable reenable preset mask unmask
|
||||
link load cancel set-environment unset-environment
|
||||
)
|
||||
|
||||
for c in $sudo_commands; do; alias sc-$c="sudo systemctl $c"; done
|
||||
|
||||
unset sudo_commands
|
|
@ -1,51 +0,0 @@
|
|||
# Updates editor information when the keymap changes.
|
||||
function zle-keymap-select() {
|
||||
zle reset-prompt
|
||||
zle -R
|
||||
}
|
||||
|
||||
# Ensure that the prompt is redrawn when the terminal size changes.
|
||||
TRAPWINCH() {
|
||||
zle && zle -R
|
||||
}
|
||||
|
||||
zle -N zle-keymap-select
|
||||
zle -N edit-command-line
|
||||
|
||||
|
||||
bindkey -v
|
||||
|
||||
# allow v to edit the command line (standard behaviour)
|
||||
autoload -Uz edit-command-line
|
||||
bindkey -M vicmd 'v' edit-command-line
|
||||
|
||||
# allow ctrl-p, ctrl-n for navigate history (standard behaviour)
|
||||
bindkey '^P' up-history
|
||||
bindkey '^N' down-history
|
||||
|
||||
# allow ctrl-h, ctrl-w, ctrl-? for char and word deletion (standard behaviour)
|
||||
bindkey '^?' backward-delete-char
|
||||
bindkey '^h' backward-delete-char
|
||||
bindkey '^w' backward-kill-word
|
||||
|
||||
# allow ctrl-r to perform backward search in history
|
||||
#bindkey '^r' history-incremental-search-backward
|
||||
|
||||
# allow ctrl-a and ctrl-e to move to beginning/end of line
|
||||
bindkey '^a' beginning-of-line
|
||||
bindkey '^e' end-of-line
|
||||
|
||||
# if mode indicator wasn't setup by theme, define default
|
||||
if [[ "$MODE_INDICATOR" == "" ]]; then
|
||||
MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
|
||||
fi
|
||||
|
||||
function vi_mode_prompt_info() {
|
||||
echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}"
|
||||
}
|
||||
|
||||
# define right prompt, if it wasn't defined by a theme
|
||||
if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then
|
||||
RPS1='$(vi_mode_prompt_info)'
|
||||
fi
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
# From http://dotfiles.org/~_why/.zshrc
|
||||
# Sets the window title nicely no matter where you are
|
||||
function title() {
|
||||
# escape '%' chars in $1, make nonprintables visible
|
||||
a=${(V)1//\%/\%\%}
|
||||
|
||||
# Truncate command, and join lines.
|
||||
a=$(print -Pn "%40>...>$a" | tr -d "\n")
|
||||
|
||||
case $TERM in
|
||||
screen)
|
||||
print -Pn "\ek$a:$3\e\\" # screen title (in ^A")
|
||||
;;
|
||||
xterm*|rxvt)
|
||||
print -Pn "\e]2;$2\a" # plain xterm title ($3 for pwd)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
61
zsh/.zshrc
61
zsh/.zshrc
|
@ -1,61 +0,0 @@
|
|||
export TERM="xterm-256color"
|
||||
#zsh options
|
||||
setopt auto_cd
|
||||
setopt complete_aliases
|
||||
setopt extended_glob
|
||||
setopt list_types
|
||||
setopt mark_dirs
|
||||
setopt path_dirs
|
||||
setopt prompt_subst
|
||||
setopt nonomatch
|
||||
setopt automenu
|
||||
|
||||
#Load libraries
|
||||
for f in ~/.zsh/*.zsh; do
|
||||
source $f
|
||||
done
|
||||
|
||||
#alias/prefs
|
||||
export VISUAL="/usr/bin/vim"
|
||||
export EDITOR="$VISUAL"
|
||||
#alias tmux="tmux -2"
|
||||
autoload -U compinit && compinit
|
||||
zstyle ':completion:*' menu select
|
||||
|
||||
#init powerline
|
||||
. /usr/share/powerline/bindings/zsh/powerline.zsh
|
||||
POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND='teal'
|
||||
#POWERLEVEL9K_PROMPT_ON_NEWLINE=true
|
||||
#POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
|
||||
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs )
|
||||
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(vi_mode root_indicator dir_writable background_jobs context)
|
||||
POWERLEVEL9K_VI_INSERT_MODE_STRING="MODE"
|
||||
POWERLEVEL9K_VI_MODE_INSERT_BACKGROUND='green'
|
||||
POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND='white'
|
||||
POWERLEVEL9K_VI_NORMAL_MODE_STRING="MODE"
|
||||
POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND='red'
|
||||
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle"
|
||||
|
||||
#Antibody Init
|
||||
source <(antibody init)
|
||||
#antibody bundles
|
||||
antibody bundle bhilburn/powerlevel9k
|
||||
antibody bundle chrissicool/zsh-256color
|
||||
antibody bundle zlsun/solarized-man
|
||||
antibody bundle zdharma/history-search-multi-word
|
||||
antibody bundle clvv/fasd
|
||||
|
||||
antibody bundle zsh-users/zsh-autosuggestions
|
||||
antibody bundle zsh-users/zsh-syntax-highlighting
|
||||
|
||||
#Plugin Settings
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=3'
|
||||
eval "$(fasd --init auto)"
|
||||
|
||||
#Better History https://coderwall.com/p/jpj_6q/zsh-better-history-searching-with-arrow-keys
|
||||
#autoload -U up-line-or-beginning-search
|
||||
#autoload -U down-line-or-beginning-search
|
||||
#zle -N up-line-or-beginning-search
|
||||
#zle -N down-line-or-beginning-search
|
||||
#bindkey "^[[A" up-line-or-beginning-search # Up
|
||||
#bindkey "^[[B" down-line-or-beginning-search # Down
|
Loading…
Add table
Add a link
Reference in a new issue