From 4c9a66ced234288c3756fc95958ba32bfdeeeb44 Mon Sep 17 00:00:00 2001 From: Nathan Stilwell Date: Wed, 12 Apr 2017 00:39:38 -0400 Subject: [PATCH] Taking out plugins I might find something later --- oh-my-zsh.sh | 22 ------- plugins/atlas/atlas.plugin.zsh | 75 --------------------- plugins/dock/dock.plugin.zsh | 49 -------------- plugins/gerrit/gerrit.plugin.zsh | 110 ------------------------------- 4 files changed, 256 deletions(-) delete mode 100644 plugins/atlas/atlas.plugin.zsh delete mode 100644 plugins/dock/dock.plugin.zsh delete mode 100644 plugins/gerrit/gerrit.plugin.zsh diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index ceb71dfb0..f2741d1e0 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -9,20 +9,6 @@ for config_file ($ZSH/lib/*.zsh); do source $config_file done -is_plugin() { - local base_dir=$1 - local name=$2 - test -f $base_dir/plugins/$name/$name.plugin.zsh \ - || test -f $base_dir/plugins/$name/_$name -} -# Add all defined plugins to fpath. This must be done -# before running compinit. -for plugin ($plugins); do - if is_plugin $ZSH $plugin; then - fpath=($ZSH/plugins/$plugin $fpath) - fi -done - # Figure out the SHORT hostname if [ -n "$commands[scutil]" ]; then # OS X @@ -38,14 +24,6 @@ ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}" autoload -U compinit compinit -i -d "${ZSH_COMPDUMP}" -# Load all of the plugins that were defined in ~/.zshrc -# for plugin ($plugins); do -# if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then -# source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh -# elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then -# source $ZSH/plugins/$plugin/$plugin.plugin.zsh -# fi -# done # load theme test -f "$ZSH/themes/$THEME" && source "$ZSH/themes/$THEME" diff --git a/plugins/atlas/atlas.plugin.zsh b/plugins/atlas/atlas.plugin.zsh deleted file mode 100644 index 1140e769d..000000000 --- a/plugins/atlas/atlas.plugin.zsh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env bash - -function atlas_usage { - cat <<-USAGE - - usage: atlas command [map name] - - new Create new hosts map file - init Create ~/.hosts to store host maps in - map link /etc/hosts to map supplying map name - list show what host configs exist - show show which config is linked - -USAGE -} - -function atlas_new { - if [ -z "$1" ]; then - echo "need a name of new map"; - else - if [[ -e "/Users/nstilwell/.hosts/template" ]]; then - cp /Users/nstilwell/.hosts/template ~/.hosts/$1; - else - touch ~/.hosts/$1; - fi - echo "Created $1 at ~/.hosts/$1"; - fi -} - -function atlas_init { - if [ ! -d "/Users/nstilwell/.hosts" ]; then - mkdir /Users/nstilwell/.hosts; - fi - - echo "Atlas initialized"; -} - -function atlas_map { - if [ -d "/Users/nstilwell/.hosts" ] && [ -e "/Users/nstilwell/.hosts/$1" ]; then - sudo ln -f /Users/nstilwell/.hosts/$1 /etc/hosts; - echo "mapped ~/.hosts/$1 to /etc/hosts"; - else - echo "$1 doesn't exist at ~/.hosts/$1"; - fi -} - -function atlas_show { - if [ -d "/Users/nstilwell/.hosts" ] && [ -e "/Users/nstilwell/.hosts/" ]; then - head -n 4 /etc/hosts; - else - echo "Atlas not initialized"; - atlas_usage; - fi -} - -function atlas_list { - if [ -d "/Users/nstilwell/.hosts" ] && [ -e "/Users/nstilwell/.hosts/" ]; then - ls -F ~/.hosts | grep -v /$; - else - echo "Atlas not initialized"; - atlas_usage; - fi -} - -function atlas { - if [ -z "$1" ]; then - atlas_usage; - else - [ "$1" = "new" ] && atlas_new "$2"; - [ "$1" = "init" ] && atlas_init; - [ "$1" = "map" ] && atlas_map "$2"; - [ "$1" = "show" ] && atlas_show; - [ "$1" = "list" ] && atlas_list; - fi -} diff --git a/plugins/dock/dock.plugin.zsh b/plugins/dock/dock.plugin.zsh deleted file mode 100644 index d790fad08..000000000 --- a/plugins/dock/dock.plugin.zsh +++ /dev/null @@ -1,49 +0,0 @@ -function dock_usage () { -cat <<-USAGE - - usage: dock - - clean Remove all stopped containers - help show Docker cheat sheet -USAGE -} - -function dock_clean { - docker rm $(docker ps -a -q); - - [ "$1" = "images" ] && docker rmi $(docker images -q); -} - -function dock_help { -cat <<-HELP - # list local images - docker images - - # build a tagged docker image; - docker build -t ; - - # run a docker image as a daemon on a port; - docker run -d --name -p ; - - # run bash in a container; - docker exec -ti bash; - - # remove an image - docker rmi - - # remove a container - docker rm - - # view logs from a container - docker logs -f -HELP -} - -function dock () { - if [ -z "$1" ]; then - dock_usage; - else - [ "$1" = "clean" ] && dock_clean "$2" - [ "$1" = "help" ] && dock_help - fi -} diff --git a/plugins/gerrit/gerrit.plugin.zsh b/plugins/gerrit/gerrit.plugin.zsh deleted file mode 100644 index 3e47db1f0..000000000 --- a/plugins/gerrit/gerrit.plugin.zsh +++ /dev/null @@ -1,110 +0,0 @@ -function gerrit_usage { - echo - echo " usage: gerrit " - echo - echo " try these :"; - echo " push Push changes without going through a review. "; - echo " pull Pull latest changes and rebase ... or something. "; - echo " patch Work with gerrit patchset"; - echo " reset Reset hard to origin/master"; - echo " review Submit changes for review"; - echo " draft Submit changes for review as draft"; - echo " clone Clone a repo from gerrit, requires repo name"; - echo " setup Add gerrit commit hook to a repo"; - echo -} - -function gerrit_patch_usage () { - echo - echo " usage: gerrit patch "; - echo - echo " try these :"; - echo - echo " commit Amend the patchset commit"; - echo " review Submit patchset back to the gerrit for review"; - echo " draft Submit patchset back to the gerrit for review as draft"; - echo " rebase Rebase onto master into patchset"; - echo -} - -function gerrit_push () { - git push origin HEAD:refs/heads/$1; -} - -function gerrit_review () { - git push origin HEAD:refs/for/$1; -} - -function gerrit_draft () { - git push origin HEAD:refs/drafts/$1; -} - -function gerrit_reset { - git reset --hard origin/master; -} - -function gerrit_pull () { - #git pull --rebase origin $1; - git fetch; - git rebase origin/$1 -} - -function gerrit_patch () { - if [ -z "$1" ]; then - gerrit_patch_usage; - else - [ "$1" = "commit" ] && git commit --amend; - [ "$1" = "review" ] && gerrit_review "master"; - [ "$1" = "draft" ] && gerrit_draft "master"; - [ "$1" = "rebase" ] && gerrit_pull "master"; - fi -} - -function gerrit_clone () { - if [ -z "$1" ]; then - echo "$yellow Please supply the name of a repo to clone. $stop" - else - if [[ -n $(which gg-gerrit-clone) ]]; then - gg-gerrit-clone "$1" - else - git clone --recursive ssh://gerrit_host/$1 - fi - fi -} - -function gerrit_setup () { - if [ -d /web/tools/bin/install-hooks ]; then - # install hooks - /web/tools/bin/install-hooks; - - if [[ $? -eq 0 ]]; then - echo "$green Gerrit hook installed. $stop"; - else - echo "$red Couldn't install Gerrit hook. $stop"; - fi - fi -} - -function gerrit () { - gitRemoteUrl=`git config --get remote.origin.url`; - - ref=$(git symbolic-ref HEAD 2> /dev/null); - branch=${ref#refs/heads/}; - - if [ -z "$1" ]; then - gerrit_usage; - else - [ "$1" = "clone" ] && gerrit_clone "$2"; - if [[ $gitRemoteUrl != *"gerrit"* ]]; then - echo "This repository isn't on Gerrit Host."; - return; - fi - [ "$1" = "patch" ] && gerrit_patch "$2" - [ "$1" = "push" ] && gerrit_push "$branch"; - [ "$1" = "review" ] && gerrit_review "$branch"; - [ "$1" = "reset" ] && gerrit_reset; - [ "$1" = "draft" ] && gerrit_draft "$branch"; - [ "$1" = "pull" ] && gerrit_pull "$branch"; - [ "$1" = "setup" ] && gerrit_setup; - fi -}