diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/autojump/autojump.plugin.zsh | 4 | ||||
| -rw-r--r-- | plugins/docker/_docker | 2 | ||||
| -rw-r--r-- | plugins/emoji/emoji-char-definitions.zsh | 9 | ||||
| -rw-r--r-- | plugins/emoji/emoji.plugin.zsh | 7 | ||||
| -rw-r--r-- | plugins/emoji/update_emoji.pl | 2 | ||||
| -rw-r--r-- | plugins/frontend-search/README.md | 2 | ||||
| -rw-r--r-- | plugins/frontend-search/_frontend-search.sh | 4 | ||||
| -rw-r--r-- | plugins/frontend-search/frontend-search.plugin.zsh | 7 | ||||
| -rw-r--r-- | plugins/git-flow/git-flow.plugin.zsh | 2 | ||||
| -rw-r--r-- | plugins/jira/_jira | 21 | ||||
| -rw-r--r-- | plugins/jira/jira.plugin.zsh | 150 | ||||
| -rw-r--r-- | plugins/osx/osx.plugin.zsh | 2 | ||||
| -rw-r--r-- | plugins/rand-quote/rand-quote.plugin.zsh | 2 | ||||
| -rw-r--r-- | plugins/rbenv/rbenv.plugin.zsh | 9 | ||||
| -rw-r--r-- | plugins/rvm/rvm.plugin.zsh | 10 | ||||
| -rw-r--r-- | plugins/symfony2/symfony2.plugin.zsh | 2 | ||||
| -rw-r--r-- | plugins/thefuck/README.md | 9 | ||||
| -rw-r--r-- | plugins/thefuck/thefuck.plugin.zsh | 17 | ||||
| -rw-r--r-- | plugins/ubuntu/ubuntu.plugin.zsh | 3 | 
19 files changed, 178 insertions, 86 deletions
| diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh index 4cf036401..c05c699e1 100644 --- a/plugins/autojump/autojump.plugin.zsh +++ b/plugins/autojump/autojump.plugin.zsh @@ -15,7 +15,7 @@ if [ $commands[autojump] ]; then # check if autojump is installed      . /usr/local/share/autojump/autojump.zsh    elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports      . /opt/local/etc/profile.d/autojump.zsh -  elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew -    . `brew --prefix`/etc/autojump.zsh +  elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.sh ]; then # mac os x with brew +    . `brew --prefix`/etc/autojump.sh    fi  fi diff --git a/plugins/docker/_docker b/plugins/docker/_docker index 25f55beca..a82a31ad3 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -27,7 +27,7 @@ __docker_all_containers() {  # output a selectable list of all docker images  __docker_images() {      declare -a img_cmd -    img_cmd=($(docker images | awk 'NR>1{print $1}')) +    img_cmd=($(docker images | awk 'NR>1{print $1}'| sed 's/:/\\:/g'))      _describe 'images' img_cmd  } diff --git a/plugins/emoji/emoji-char-definitions.zsh b/plugins/emoji/emoji-char-definitions.zsh index 7d110603c..04693da05 100644 --- a/plugins/emoji/emoji-char-definitions.zsh +++ b/plugins/emoji/emoji-char-definitions.zsh @@ -7,8 +7,12 @@  #   $emoji         - which maps character names to Unicode characters  #   $emoji_flags   - maps country names to Unicode flag characters using region indicators  +# Main emoji  typeset -gAH emoji +# National flags  typeset -gAH emoji_flags +# Combining modifiers +typeset -gAH emoji_mod  emoji[copyright_sign]=$'\U00A9'  emoji[registered_sign]=$'\U00AE' @@ -448,10 +452,15 @@ emoji[badminton_racquet_and_shuttlecock]=$'\U1F3F8'  emoji[bow_and_arrow]=$'\U1F3F9'  emoji[amphora]=$'\U1F3FA'  emoji[emoji_modifier_fitzpatrick_type_1_2]=$'\U1F3FB' +emoji_mod[emoji_modifier_fitzpatrick_type_1_2]=$'\U1F3FB'  emoji[emoji_modifier_fitzpatrick_type_3]=$'\U1F3FC' +emoji_mod[emoji_modifier_fitzpatrick_type_3]=$'\U1F3FC'  emoji[emoji_modifier_fitzpatrick_type_4]=$'\U1F3FD' +emoji_mod[emoji_modifier_fitzpatrick_type_4]=$'\U1F3FD'  emoji[emoji_modifier_fitzpatrick_type_5]=$'\U1F3FE' +emoji_mod[emoji_modifier_fitzpatrick_type_5]=$'\U1F3FE'  emoji[emoji_modifier_fitzpatrick_type_6]=$'\U1F3FF' +emoji_mod[emoji_modifier_fitzpatrick_type_6]=$'\U1F3FF'  emoji[rat]=$'\U1F400'  emoji[mouse]=$'\U1F401'  emoji[ox]=$'\U1F402' diff --git a/plugins/emoji/emoji.plugin.zsh b/plugins/emoji/emoji.plugin.zsh index a98d0b714..7876f1c89 100644 --- a/plugins/emoji/emoji.plugin.zsh +++ b/plugins/emoji/emoji.plugin.zsh @@ -76,8 +76,6 @@ emoji_skintone[6]=$'\U1F3FF'  # These are stored in a single associative array, $emoji_groups, to avoid cluttering up the global  # namespace, and to allow adding additional group definitions at run time.  # The keys are the group names, and the values are whitespace-separated lists of emoji character names. -# -# These extra local arrays are used to allow more convenient formatting of the source code.  emoji_groups[fruits]="    tomato @@ -255,9 +253,10 @@ function random_emoji() {    if [[ -z "$group" || "$group" == "all" ]]; then    	names=(${(k)emoji})    else -  	names=(${=emoji_groups[$group_name]}) +	names=(${=emoji_groups[$group]})    fi -  local list_size=$#names +  local list_size=${#names} +  [[ $list_size -eq 0 ]] && return 1    local random_index=$(( ( RANDOM % $list_size ) + 1 ))    local name=${names[$random_index]}    echo ${emoji[$name]} diff --git a/plugins/emoji/update_emoji.pl b/plugins/emoji/update_emoji.pl index d90c6e316..04f3ce8e7 100644 --- a/plugins/emoji/update_emoji.pl +++ b/plugins/emoji/update_emoji.pl @@ -88,7 +88,7 @@ typeset -gAH emoji_mod  			}  			# Modifiers are included in both the main set and their separate map,  			# because they have a standalone representation as a color swatch. -			if ( $modifier_status == "modifier" ) { +			if ( $modifier_status eq "modifier" ) {  				$outfh->print("emoji_mod[$omz_name]=\$'$zsh_code'\n");  			}  		} else { diff --git a/plugins/frontend-search/README.md b/plugins/frontend-search/README.md index 801d450f3..b8e96ea4a 100644 --- a/plugins/frontend-search/README.md +++ b/plugins/frontend-search/README.md @@ -43,6 +43,7 @@ The search content are  * `reactjs <google.com/search?as_q=<search-term>&as_sitesearch=facebook.github.io/react>`  * `emberjs <emberjs.com>`  * `stackoverflow <stackoverflow.com>` +* `npmjs <npmjs.com>`  ## Aliases ## @@ -69,6 +70,7 @@ There are a few aliases presented as well:  * `reactjs` A shorthand for `frontend reactjs`  * `emberjs` A shorthand for `frontend emberjs`  * `stackoverflow` A shorthand for `frontend stackoverflow` +* `npmjs` A shorthand for `frontend npmjs`  ## Author diff --git a/plugins/frontend-search/_frontend-search.sh b/plugins/frontend-search/_frontend-search.sh index 252f21570..b12f829a1 100644 --- a/plugins/frontend-search/_frontend-search.sh +++ b/plugins/frontend-search/_frontend-search.sh @@ -37,6 +37,7 @@ function _frontend() {      'reactjs: Search in React website'      'emberjs: Search in Ember website'      'stackoverflow: Search in StackOverflow website' +    'npmjs: Search in NPMJS website'    )    _arguments -C \ @@ -110,6 +111,9 @@ function _frontend() {          stackoverflow)            _describe -t points "Warp points" frontend_points && ret=0            ;; +        npmjs) +          _describe -t points "Warp points" frontend_points && ret=0 +          ;;        esac        ;;    esac diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh index f7485621b..e47735a60 100644 --- a/plugins/frontend-search/frontend-search.plugin.zsh +++ b/plugins/frontend-search/frontend-search.plugin.zsh @@ -9,7 +9,7 @@ function frontend() {    fi    # check whether the search engine is supported -  if [[ ! $1 =~ '(jquery|mdn|compass|html5please|caniuse|aurajs|dartlang|qunit|fontello|bootsnipp|cssflow|codepen|unheap|bem|smacss|angularjs|reactjs|emberjs|stackoverflow)' ]]; +  if [[ ! $1 =~ '(jquery|mdn|compass|html5please|caniuse|aurajs|dartlang|qunit|fontello|bootsnipp|cssflow|codepen|unheap|bem|smacss|angularjs|reactjs|emberjs|stackoverflow|npmjs)' ]];    then      echo "Search valid search content $1 not supported."      echo "Valid contents: (formats 'frontend <search-content>' or '<search-content>')" @@ -33,6 +33,7 @@ function frontend() {      echo "* reactjs"      echo "* emberjs"      echo "* stackoverflow" +    echo "* npmjs"      echo ""      return 1 @@ -99,6 +100,9 @@ function frontend() {      "stackoverflow")        url="${url}stackoverflow.com"        url="${url}/search?q=$2" ;; +    "npmjs") +      url="${url}www.npmjs.com" +      url="${url}/search?q=$2" ;;      *) echo "INVALID PARAM!"         return ;;    esac @@ -148,3 +152,4 @@ alias emberjs='frontend emberjs'  # search websites  alias stackoverflow='frontend stackoverflow' +alias npmjs='frontend npmjs' diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh index 4357c0895..444440bcb 100644 --- a/plugins/git-flow/git-flow.plugin.zsh +++ b/plugins/git-flow/git-flow.plugin.zsh @@ -21,7 +21,7 @@  #  #Alias -alias gf='git flow' +alias gfl='git flow'  alias gcd='git checkout develop'  alias gch='git checkout hotfix'  alias gcr='git checkout release' diff --git a/plugins/jira/_jira b/plugins/jira/_jira new file mode 100644 index 000000000..b0ea658e2 --- /dev/null +++ b/plugins/jira/_jira @@ -0,0 +1,21 @@ +#compdef jira +#autoload + +local -a _1st_arguments +_1st_arguments=( +  'new:create a new issue' +  'dashboard:open the dashboard' +  'reported:search for issues reported by a user' +  'assigned:search for issues assigned to a user' +) + +_arguments -C \ +  ':command:->command' \ +  '*::options:->options' + +case $state in +  (command) +    _describe -t commands "jira subcommand" _1st_arguments +    return +   ;; +esac diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index 9a8932702..89559767f 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -1,90 +1,118 @@ -# To use: add a .jira-url file in the base of your project -#         You can also set JIRA_URL in your .zshrc or put .jira-url in your home directory -#         .jira-url in the current directory takes precedence +# CLI support for JIRA interaction  # -# If you use Rapid Board, set: -#JIRA_RAPID_BOARD="true" -# in you .zshrc +# Setup:  +#   Add a .jira-url file in the base of your project +#   You can also set $JIRA_URL in your .zshrc or put .jira-url in your home directory +#   A .jira-url in the current directory takes precedence.  +#   The same goes with .jira-prefix and $JIRA_PREFIX.  # -# Setup: cd to/my/project -#        echo "https://name.jira.com" >> .jira-url -# Usage: jira           # opens a new issue -#        jira ABC-123   # Opens an existing issue -open_jira_issue () { -  if [ -f .jira-url ]; then +#   For example: +#     cd to/my/project +#     echo "https://name.jira.com" >> .jira-url +# +# Variables: +#  $JIRA_RAPID_BOARD     - set to "true" if you use Rapid Board +#  $JIRA_DEFAULT_ACTION  - action to do when `jira` is called witn no args +#                          defaults to "new" +#  $JIRA_NAME            - Your JIRA username. Used as default for assigned/reported +#  $JIRA_PREFIX          - Prefix added to issue ID arguments +# +# +# Usage:  +#   jira            # Performs the default action +#   jira new        # opens a new issue +#   jira reported [username] +#   jira assigned [username] +#   jira dashboard +#   jira ABC-123    # Opens an existing issue +#   jira ABC-123 m  # Opens an existing issue for adding a comment + +: ${JIRA_DEFAULT_ACTION:=new} + +function jira() { +  local action=${1:=$JIRA_DEFAULT_ACTION} + +  local jira_url jira_prefix +  if [[ -f .jira-url ]]; then      jira_url=$(cat .jira-url) -  elif [ -f ~/.jira-url ]; then +  elif [[ -f ~/.jira-url ]]; then      jira_url=$(cat ~/.jira-url) -  elif [[ "x$JIRA_URL" != "x" ]]; then -    jira_url=$JIRA_URL +  elif [[ -n "${JIRA_URL}" ]]; then +    jira_url=${JIRA_URL}    else -    echo "JIRA url is not specified anywhere." +    _jira_url_help      return 1    fi -  if [ -f .jira-prefix ]; then +  if [[ -f .jira-prefix ]]; then      jira_prefix=$(cat .jira-prefix) -  elif [ -f ~/.jira-prefix ]; then +  elif [[ -f ~/.jira-prefix ]]; then      jira_prefix=$(cat ~/.jira-prefix) +  elif [[ -n "${JIRA_PREFIX}" ]]; then +    jira_prefix=${JIRA_PREFIX}    else      jira_prefix=""    fi -  if [ -z "$1" ]; then + +  if [[ $action == "new" ]]; then      echo "Opening new issue"      open_command "${jira_url}/secure/CreateIssue!default.jspa" -  elif [[ "$1" = "assigned" || "$1" = "reported" ]]; then -    jira_query $@ -  else  -    local addcomment='' +  elif [[ "$action" == "assigned" || "$action" == "reported" ]]; then +    _jira_query $@ +  elif [[ "$action" == "dashboard" ]]; then +    echo "Opening dashboard" +    open_command "${jira_url}/secure/Dashboard.jspa" +  else +    # Anything that doesn't match a special action is considered an issue name +    local issue_arg=$action +    local issue="${jira_prefix}${issue_arg}" +    local url_fragment=''      if [[ "$2" == "m" ]]; then -      addcomment="#add-comment" -      echo "Add comment to issue #$1" +      url_fragment="#add-comment" +      echo "Add comment to issue #$issue"      else -      echo "Opening issue #$1" +      echo "Opening issue #$issue"      fi -     -    if [[ "x$JIRA_RAPID_BOARD" = "xtrue" ]]; then -      open_command  "$jira_url/issues/$jira_prefix$1$addcomment" +    if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then +      open_command "${jira_url}/issues/${issue}${url_fragment}"      else -      open_command  "$jira_url/browse/$jira_prefix$1$addcomment" +      open_command "${jira_url}/browse/${issue}${url_fragment}"      fi    fi  } -jira_name () { -  if [[ -z "$1" ]]; then -    if [[ "x${JIRA_NAME}" != "x" ]]; then -      jira_name=${JIRA_NAME} -    else -      echo "JIRA_NAME not specified" -      return 1 -    fi +function _jira_url_help() { +  cat << EOF +JIRA url is not specified anywhere. +Valid options, in order of precedence: +  .jira-url file +  \$HOME/.jira-url file +  JIRA_URL environment variable +EOF +} + +function _jira_query() { +  local verb="$1" +  local jira_name lookup preposition query +  if [[ "${verb}" == "reported" ]]; then +    lookup=reporter +    preposition=by +  elif [[ "${verb}" == "assigned" ]]; then +    lookup=assignee +    preposition=to    else -    jira_name=$@ +    echo "not a valid lookup: $verb" >&2 +    return 1 +  fi +  jira_name=${2:=$JIRA_NAME} +  if [[ -z $jira_name ]]; then +    echo "JIRA_NAME not specified" >&2 +    return 1    fi -} -jira_query () { -    verb="$1" -    if [[ "${verb}" = "reported" ]]; then -      lookup=reporter -      preposition=by -    elif [[ "${verb}" = "assigned" ]]; then -      lookup=assignee -      preposition=to -    else -      echo "not a valid lookup $verb" -      return 1 -    fi -    shift 1 -    jira_name $@ -    if [[ $? = 1 ]]; then -        return 1 -    fi -    echo "Browsing issues ${verb} ${preposition} ${jira_name}" -    open_command "${jira_url}/secure/IssueNavigator.jspa?reset=true&jqlQuery=${lookup}+%3D+%22${jira_name}%22+AND+resolution+%3D+unresolved+ORDER+BY+priority+DESC%2C+created+ASC" +  echo "Browsing issues ${verb} ${preposition} ${jira_name}" +  query="${lookup}+%3D+%22${jira_name}%22+AND+resolution+%3D+unresolved+ORDER+BY+priority+DESC%2C+created+ASC" +  open_command "${jira_url}/secure/IssueNavigator.jspa?reset=true&jqlQuery=${query}"  } -alias jira='open_jira_issue' - diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index a6e3a83e6..390960fdc 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -6,7 +6,7 @@  # ------------------------------------------------------------------------------  function tab() { -  local command="cd \\\"$PWD\\\"; clear; " +  local command="cd \\\"$PWD\\\"; clear"    (( $# > 0 )) && command="${command}; $*"    the_app=$( diff --git a/plugins/rand-quote/rand-quote.plugin.zsh b/plugins/rand-quote/rand-quote.plugin.zsh index c3bf6234e..8f345d9aa 100644 --- a/plugins/rand-quote/rand-quote.plugin.zsh +++ b/plugins/rand-quote/rand-quote.plugin.zsh @@ -18,8 +18,6 @@ if [[ -x `which curl` ]]; then          W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g')          if [ "$W" -a "$TXT" ]; then            echo "${WHO_COLOR}${W}${COLON_COLOR}: ${TEXT_COLOR}“${TXT}”${END_COLOR}" -        else -          quote          fi      }      #quote diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index 213e1beb0..ef5106f2d 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -2,14 +2,11 @@ _homebrew-installed() {    type brew &> /dev/null  } -_rbenv-from-homebrew-installed() { -  brew --prefix rbenv &> /dev/null -} -  FOUND_RBENV=0  rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" "/usr/local/opt/rbenv") -if _homebrew-installed && _rbenv-from-homebrew-installed ; then -    rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}") +if _homebrew-installed && rbenv_homebrew_path=$(brew --prefix rbenv 2>/dev/null); then +    rbenvdirs=($rbenv_homebrew_path "${rbenvdirs[@]}") +    unset rbenv_homebrew_path  fi  for rbenvdir in "${rbenvdirs[@]}" ; do diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index 234ac1642..53e809aaf 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -61,11 +61,11 @@ function gems {  	local current_ruby=`rvm-prompt i v p`  	local current_gemset=`rvm-prompt g` -	gem list $@ | sed \ -		-Ee "s/\([0-9, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \ -		-Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \ -		-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ -		-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" +	gem list $@ | sed -E \ +		-e "s/\([0-9, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \ +		-e "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \ +		-e "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ +		-e "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"  }  function _rvm_completion { diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index e94280ed0..98a2321db 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -5,7 +5,7 @@ _symfony_console () {  }  _symfony2_get_command_list () { -   `_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^  ?[a-z]+/ { print $1 }' +   `_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^  ?[^ ]+ / { print $1 }'  }  _symfony2 () { diff --git a/plugins/thefuck/README.md b/plugins/thefuck/README.md new file mode 100644 index 000000000..a9b7550d7 --- /dev/null +++ b/plugins/thefuck/README.md @@ -0,0 +1,9 @@ +# The Fuck + +[The Fuck](https://github.com/nvbn/thefuck) plugin — magnificent app which corrects your previous console command. + +## Usage +Press `ESC` twice to correct previous console command. + +## Notes +`Esc`-`Esc` key binding conflicts with [sudo](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/sudo) plugin. diff --git a/plugins/thefuck/thefuck.plugin.zsh b/plugins/thefuck/thefuck.plugin.zsh new file mode 100644 index 000000000..8b1746e85 --- /dev/null +++ b/plugins/thefuck/thefuck.plugin.zsh @@ -0,0 +1,17 @@ +if [[ -z $commands[thefuck] ]]; then +    echo 'thefuck is not installed, you should "pip install thefuck" first' +    return -1 +fi + +# Register alias +eval "$(thefuck-alias)" + +fuck-command-line() { +    local FUCK="$(THEFUCK_REQUIRE_CONFIRMATION=0 thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)" +    [[ -z $FUCK ]] && echo -n -e "\a" && return +    BUFFER=$FUCK +    zle end-of-line +} +zle -N fuck-command-line +# Defined shortcut keys: [Esc] [Esc] +bindkey "\e\e" fuck-command-line diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh index 0211d3374..a1a5016c7 100644 --- a/plugins/ubuntu/ubuntu.plugin.zsh +++ b/plugins/ubuntu/ubuntu.plugin.zsh @@ -3,6 +3,7 @@  # https://github.com/dbb  # https://github.com/Mappleconfusers  # Nicolas Jonas nextgenthemes.com +# https://github.com/loctauxphilippe  #  # Debian, Ubuntu and friends related zsh aliases and functions for zsh @@ -38,6 +39,7 @@ alias agu='sudo apt-get update'   # ad  alias agud='sudo apt-get update && sudo apt-get dist-upgrade' #adu  alias agug='sudo apt-get upgrade' # ag  alias aguu='sudo apt-get update && sudo apt-get upgrade'      #adg +alias agar='sudo apt-get autoremove'  compdef _ag ag='sudo apt-get'  compdef _aga aga='sudo apt-get autoclean' @@ -51,6 +53,7 @@ compdef _agu agu='sudo apt-get update'  compdef _agud agud='sudo apt-get update && sudo apt-get dist-upgrade'  compdef _agug agug='sudo apt-get upgrade'  compdef _aguu aguu='sudo apt-get update && sudo apt-get upgrade' +compdef _agar agar='sudo apt-get autoremove'  # Remove ALL kernel images and headers EXCEPT the one in use  alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \ | 
