From 871003d23625081d9c149cbd812bd556b0db879a Mon Sep 17 00:00:00 2001 From: hjpotter92 Date: Wed, 6 Jul 2016 01:27:35 +0530 Subject: [PATCH] Add some common aliases for the chmod and ls commands. * Add `lh` which alias to `ls -lh` * Remove the `whereami` alias (Fixes robbyrussell/oh-my-zsh#5208) * Add aliases such that `chmod` and `sudo chmod` commands can be reduced --- plugins/common-aliases/common-aliases.plugin.zsh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index c7aafd8b..b8f5cecd 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -8,6 +8,7 @@ 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 lh='ls -lh' #humane long list alias ldot='ls -ld .*' alias lS='ls -1FSsh' alias lart='ls -1Fcart' @@ -44,12 +45,20 @@ alias p='ps -f' alias sortnr='sort -n -r' alias unexport='unset' -alias whereami=display_info - alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' +# Aliases for setting file permissions +for p (r w x); do + for o (+ -); do + for d (a g o u); do + alias "s$d$o$p"="sudo chmod $d$o$p" + alias "$d$o$p"="chmod $d$o$p" + done + done +done + # zsh is able to auto-do some kungfoo # depends on the SUFFIX :) if is-at-least 4.2.0; then @@ -83,4 +92,3 @@ 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)"}%%[# ]*}//,/ })' -