From f300d599a826cb79561a1c780e3a6aaa7392334e Mon Sep 17 00:00:00 2001 From: Toan Nguyen Date: Sun, 19 Mar 2017 16:44:14 +0700 Subject: [PATCH] Remove compdef function and added bash env to all plugins --- plugins/bashmarks/bashmarks.plugin.sh | 2 ++ plugins/core/core.plugin.sh | 2 ++ plugins/git/git.plugin.sh | 34 ++++++++++++++------------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/plugins/bashmarks/bashmarks.plugin.sh b/plugins/bashmarks/bashmarks.plugin.sh index 5b2b76d..0058fe2 100644 --- a/plugins/bashmarks/bashmarks.plugin.sh +++ b/plugins/bashmarks/bashmarks.plugin.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # Copyright (c) 2014, NNToan - http://about.me/nntoan # All rights reserved. # diff --git a/plugins/core/core.plugin.sh b/plugins/core/core.plugin.sh index 18cba13..eac40d3 100644 --- a/plugins/core/core.plugin.sh +++ b/plugins/core/core.plugin.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # --------------------------------------------------------------------------- # # Description: This file holds all my BASH configurations and aliases diff --git a/plugins/git/git.plugin.sh b/plugins/git/git.plugin.sh index a071459..98d9278 100644 --- a/plugins/git/git.plugin.sh +++ b/plugins/git/git.plugin.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # # Functions # @@ -73,7 +75,7 @@ alias gcd='git checkout develop' alias gcmsg='git commit -m' alias gco='git checkout' alias gcount='git shortlog -sn' -compdef _git gcount +#compdef _git gcount alias gcp='git cherry-pick' alias gcpa='git cherry-pick --abort' alias gcpc='git cherry-pick --continue' @@ -86,14 +88,14 @@ alias gdt='git diff-tree --no-commit-id --name-only -r' alias gdw='git diff --word-diff' gdv() { git diff -w "$@" | view - } -compdef _git gdv=git-diff +#compdef _git gdv=git-diff alias gf='git fetch' alias gfa='git fetch --all --prune' alias gfo='git fetch origin' function gfg() { git ls-files | grep $@ } -compdef _grep gfg +#compdef _grep gfg alias gg='git gui citool' alias gga='git gui citool --amend' @@ -102,7 +104,7 @@ ggf() { [[ "$#" != 1 ]] && local b="$(git_current_branch)" git push --force origin "${b:=$1}" } -compdef _git ggf=git-checkout +#compdef _git ggf=git-checkout ggl() { if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then @@ -112,7 +114,7 @@ ggl() { git pull origin "${b:=$1}" fi } -compdef _git ggl=git-checkout +#compdef _git ggl=git-checkout ggp() { if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then @@ -122,7 +124,7 @@ ggp() { git push origin "${b:=$1}" fi } -compdef _git ggp=git-checkout +#compdef _git ggp=git-checkout ggpnp() { if [[ "$#" == 0 ]]; then @@ -131,22 +133,22 @@ ggpnp() { ggl "${*}" && ggp "${*}" fi } -compdef _git ggpnp=git-checkout +#compdef _git ggpnp=git-checkout ggu() { [[ "$#" != 1 ]] && local b="$(git_current_branch)" git pull --rebase origin "${b:=$1}" } -compdef _git ggu=git-checkout +#compdef _git ggu=git-checkout alias ggpur='ggu' -compdef _git ggpur=git-checkout +#compdef _git ggpur=git-checkout alias ggpull='git pull origin $(git_current_branch)' -compdef _git ggpull=git-checkout +#compdef _git ggpull=git-checkout alias ggpush='git push origin $(git_current_branch)' -compdef _git ggpush=git-checkout +#compdef _git ggpush=git-checkout alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)' alias gpsup='git push --set-upstream origin $(git_current_branch)' @@ -156,12 +158,12 @@ alias ghh='git help' alias gignore='git update-index --assume-unchanged' alias gignored='git ls-files -v | grep "^[[:lower:]]"' alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' -compdef _git git-svn-dcommit-push=git +#compdef _git git-svn-dcommit-push=git alias gk='\gitk --all --branches' -compdef _git gk='gitk' +#compdef _git gk='gitk' alias gke='\gitk --all $(git log -g --pretty=%h)' -compdef _git gke='gitk' +#compdef _git gke='gitk' alias gl='git pull' alias glg='git log --stat' @@ -175,7 +177,7 @@ alias glola="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %C alias glog='git log --oneline --decorate --graph' alias gloga='git log --oneline --decorate --graph --all' alias glp="_git_log_prettily" -compdef _git glp=git-log +#compdef _git glp=git-log alias gm='git merge' alias gmom='git merge origin/master' @@ -186,7 +188,7 @@ alias gmum='git merge upstream/master' alias gp='git push' alias gpd='git push --dry-run' alias gpoat='git push origin --all && git push origin --tags' -compdef _git gpoat=git-push +#compdef _git gpoat=git-push alias gpu='git push upstream' alias gpv='git push -v'