updated stuff
This commit is contained in:
parent
db8cd85bd2
commit
2efe0bd712
12 changed files with 46 additions and 236 deletions
|
@ -1,37 +1,18 @@
|
|||
# Advanced Aliases.
|
||||
# Use with caution
|
||||
#
|
||||
|
||||
# ls, the common ones I use a lot shortened for rapid fire usage
|
||||
alias l='ls -lFh' #size,show type,human readable
|
||||
alias la='ls -lAFh' #long list,show almost all,show type,human readable
|
||||
alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable
|
||||
alias lt='ls -ltFh' #long list,sorted by date,show type,human readable
|
||||
alias ll='ls -l' #long list
|
||||
alias l='ls -lFh'
|
||||
alias la='ls -lAFh'
|
||||
alias lr='ls -tRFh'
|
||||
alias lt='ls -ltFh'
|
||||
alias ll='ls -l'
|
||||
alias ldot='ls -ld .*'
|
||||
alias lS='ls -1FSsh'
|
||||
alias lart='ls -1Fcart'
|
||||
alias lrt='ls -1Fcrt'
|
||||
|
||||
alias zshrc='${=EDITOR} ~/.zshrc' # Quick access to the ~/.zshrc file
|
||||
|
||||
alias grep='grep --color'
|
||||
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
|
||||
|
||||
alias t='tail -f'
|
||||
|
||||
# Command line head / tail shortcuts
|
||||
alias -g H='| head'
|
||||
alias -g T='| tail'
|
||||
alias -g G='| grep'
|
||||
alias -g L="| less"
|
||||
alias -g M="| most"
|
||||
alias -g LL="2>&1 | less"
|
||||
alias -g CA="2>&1 | cat -A"
|
||||
alias -g NE="2> /dev/null"
|
||||
alias -g NUL="> /dev/null 2>&1"
|
||||
alias -g P="2>&1| pygmentize -l pytb"
|
||||
|
||||
alias dud='du -d 1 -h'
|
||||
alias duf='du -sh *'
|
||||
alias fd='find . -type d -name'
|
||||
|
@ -48,10 +29,7 @@ alias rm='rm -i'
|
|||
alias cp='cp -i'
|
||||
alias mv='mv -i'
|
||||
|
||||
# zsh is able to auto-do some kungfoo
|
||||
# depends on the SUFFIX :)
|
||||
if is-at-least 4.2.0; then
|
||||
# open browser on urls
|
||||
if [[ -n "$BROWSER" ]]; then
|
||||
_browser_fts=(htm html de org net com at cx nl se dk)
|
||||
for ft in $_browser_fts; do alias -s $ft=$BROWSER; done
|
||||
|
@ -68,14 +46,12 @@ if is-at-least 4.2.0; then
|
|||
_media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
|
||||
for ft in $_media_fts; do alias -s $ft=mplayer; done
|
||||
|
||||
#read documents
|
||||
alias -s pdf=acroread
|
||||
alias -s ps=gv
|
||||
alias -s dvi=xdvi
|
||||
alias -s chm=xchm
|
||||
alias -s djvu=djview
|
||||
|
||||
#list whats inside packed file
|
||||
alias -s zip="unzip -l"
|
||||
alias -s rar="unrar l"
|
||||
alias -s tar="tar tf"
|
||||
|
@ -83,5 +59,4 @@ if is-at-least 4.2.0; then
|
|||
alias -s ace="unace l"
|
||||
fi
|
||||
|
||||
# Make zsh know about hosts already accessed by SSH
|
||||
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# Docker
|
||||
_appup_docker () {
|
||||
if hash docker-compose >/dev/null 2>&1; then
|
||||
# Check if docker-machine has been started
|
||||
if hash docker-machine >/dev/null 2>&1; then
|
||||
if docker-machine status | grep -qi "Stopped"; then
|
||||
read -q "REPLY?Docker Machine is not running, would you like to start it? [y/n] "
|
||||
|
@ -16,7 +14,6 @@ _appup_docker () {
|
|||
fi
|
||||
fi
|
||||
|
||||
# Check YAML extension
|
||||
compose_file=''
|
||||
compose_project_file=''
|
||||
|
||||
|
@ -26,7 +23,6 @@ _appup_docker () {
|
|||
compose_file='docker-compose.yaml'
|
||||
fi
|
||||
|
||||
# <cmd> <project name> will look for docker-compose.<project name>.yml
|
||||
if [ -n "$2" ]; then
|
||||
if [ -e "docker-compose.$2.yml" ]; then
|
||||
compose_project_file="docker-compose.$2.yml"
|
||||
|
@ -35,7 +31,6 @@ _appup_docker () {
|
|||
fi
|
||||
|
||||
if [ -n "$compose_project_file" ]; then
|
||||
# Override project name from custom env
|
||||
if [ -e ".env.$2" ]; then
|
||||
project=$(source ".env.$2"; echo $COMPOSE_PROJECT_NAME)
|
||||
|
||||
|
@ -56,7 +51,6 @@ _appup_docker () {
|
|||
fi
|
||||
}
|
||||
|
||||
# Vagrant
|
||||
_appup_vagrant () {
|
||||
if hash vagrant >/dev/null 2>&1; then
|
||||
vagrant $1 "${@:2}"
|
||||
|
|
|
@ -1,14 +1,7 @@
|
|||
# Uses the command-not-found package zsh support
|
||||
# as seen in https://www.porcheron.info/command-not-found-for-zsh/
|
||||
# this is installed in Ubuntu
|
||||
|
||||
[[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found
|
||||
|
||||
# Arch Linux command-not-found support, you must have package pkgfile installed
|
||||
# https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook
|
||||
[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh
|
||||
|
||||
# Fedora command-not-found support
|
||||
if [ -f /usr/libexec/pk-command-not-found ]; then
|
||||
command_not_found_handler () {
|
||||
runcnf=1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue