From c1683c74d2b2f9c9a7412fccd6c9ba50043dff00 Mon Sep 17 00:00:00 2001 From: Rod Treweek Date: Mon, 5 Jun 2017 13:32:24 -0700 Subject: [PATCH 1/9] Update README.md --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b3fa2728..b15c9fbf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ sudo: false script: test/run language: c +<<<<<<< HEAD os: - linux - osx From f873ecb94819a8bba4e0e9d38044ee8fbde7d167 Mon Sep 17 00:00:00 2001 From: Rod Treweek Date: Wed, 7 Jun 2017 03:22:31 -0700 Subject: [PATCH 2/9] Added aliases for vagrant, bash-it, and homesick --- aliases/available/general.aliases.bash | 16 ++++++++++++++++ aliases/available/homesick.aliases.bash | 24 ++++++++++++++++++++++++ aliases/available/vagrant.aliases.bash | 2 ++ 3 files changed, 42 insertions(+) create mode 100644 aliases/available/homesick.aliases.bash diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index 7f3dbd4d..1d045471 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -78,6 +78,22 @@ alias bashit='bash-it' alias bash_it='bash-it' alias bash_ti='bash-it' +# Additional bash-it aliases for help/show +alias shitsha='bash-it show aliases' +alias shitshc='bash-it show completions' +alias shitshp='bash-it show plugs' +alias shitha='bash-it help aliases' +alias shithc='bash-it help completions' +alias shithp='bash-it help plugins' +alias shitsrch="bash-it search $1" +alias shitsrchen="bash-it search $1 --enable" +alias shitenp="bash-it enable plugin" +alias shitena="bash-it enable alias" +alias shitenc="bash-it enable completion" + +# source ~/.bash_profile +alias sprof="source ~/.bash_profile" + # Display whatever file is regular file or folder catt() { for i in "$@"; do diff --git a/aliases/available/homesick.aliases.bash b/aliases/available/homesick.aliases.bash new file mode 100644 index 00000000..548efc3b --- /dev/null +++ b/aliases/available/homesick.aliases.bash @@ -0,0 +1,24 @@ +cite 'about-alias' +about-alias 'homesick aliases' + +# Aliases +alias sikhm="homesick cd dotfiles" +alias sikclone="homesick clone" +alias sikcomt="homesick commit dotfiles" +alias sikdstry="homesick destroy" +alias sikdif="homesick diff dotfiles" +alias sikexec="homesick exec dotfiles" +alias sikexeca="homesick exec_all" +alias sikgen="homesick generate" +alias sikhlp="homesick help" +alias siklnk="homesick link dotfiles" +alias sikls="homesick list" +alias sikopn="homesick open dotfiles" +alias sikpll="homesick pull dotfiles" +alias sikpsh="homesick push dotfiles" +alias sikrc="homesick rc dotfiles" +alias sikpth="homesick show_path dotfiles" +alias sikst="homesick status dotfiles" +alias siktrk="homesick track $1 dotfiles" +alias sikulnk="homesick unlink dotfiles" +alias sikv="homesick version" diff --git a/aliases/available/vagrant.aliases.bash b/aliases/available/vagrant.aliases.bash index cfedb657..70121a0e 100644 --- a/aliases/available/vagrant.aliases.bash +++ b/aliases/available/vagrant.aliases.bash @@ -3,6 +3,8 @@ about-alias 'vagrant aliases' # Aliases alias vup="vagrant up" +alias vupo="vagrant up $1 --provider=openstack" +alias vupv="vagrant up $1 --provider=vsphere" alias vupl="vagrant up 2>&1 | tee vagrant.log" alias vh="vagrant halt" alias vs="vagrant suspend" From b5ee4dec606e74fa9a5f2876bf1408148015eb32 Mon Sep 17 00:00:00 2001 From: Rod Treweek Date: Mon, 19 Jun 2017 20:29:34 -0700 Subject: [PATCH 3/9] added aliases --- aliases/available/general.aliases.bash | 1 + aliases/available/vagrant.aliases.bash | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index 1d045471..abab71ed 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -77,6 +77,7 @@ alias batshit='bash-it' alias bashit='bash-it' alias bash_it='bash-it' alias bash_ti='bash-it' +alias bsh='bash-it' # Additional bash-it aliases for help/show alias shitsha='bash-it show aliases' diff --git a/aliases/available/vagrant.aliases.bash b/aliases/available/vagrant.aliases.bash index 70121a0e..ebbddaf4 100644 --- a/aliases/available/vagrant.aliases.bash +++ b/aliases/available/vagrant.aliases.bash @@ -2,6 +2,10 @@ cite 'about-alias' about-alias 'vagrant aliases' # Aliases +alias vhl='vagrant hosts list' +alias vscp='vaagrant scp' +alias vsl='vagrant snapshot list' +alias vst='vagrant snapshot take' alias vup="vagrant up" alias vupo="vagrant up $1 --provider=openstack" alias vupv="vagrant up $1 --provider=vsphere" @@ -10,7 +14,6 @@ alias vh="vagrant halt" alias vs="vagrant suspend" alias vr="vagrant resume" alias vrl="vagrant reload" -alias vssh="vagrant ssh" alias vst="vagrant status" alias vp="vagrant provision" alias vdstr="vagrant destroy" From 15177a20d4e93099bd1e80860b39fc90c4b846f6 Mon Sep 17 00:00:00 2001 From: Rod Treweek Date: Mon, 26 Jun 2017 10:56:13 -0700 Subject: [PATCH 4/9] Add new feature (#6) * alias additions * Adding powerline-r theme --- aliases/available/general.aliases.bash | 50 +++++++++++----- aliases/available/vagrant.aliases.bash | 5 +- themes/powerline-r/README.md | 59 +++++++++++++++++++ themes/powerline-r/powerline-r.base.bash | 62 ++++++++++++++++++++ themes/powerline-r/powerline-r.theme.bash | 69 +++++++++++++++++++++++ 5 files changed, 229 insertions(+), 16 deletions(-) create mode 100644 themes/powerline-r/README.md create mode 100644 themes/powerline-r/powerline-r.base.bash create mode 100644 themes/powerline-r/powerline-r.theme.bash diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index abab71ed..9cdb8b61 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -18,6 +18,22 @@ alias l1='ls -1' alias _="sudo" +# Shortcuts to edit startup files +alias vigen="vim ~/.bash_it/aliases/available/general.aliases.bash" +alias vbrc="vim ~/.bashrc" +alias vbpf="vim ~/.bash_profile" + +# vmpooler +function vm-grab() { + printf "Hello! You rule. Which vm would you like?: " + read vm_msg + LDAP_USERNAME=rod LDAP_PASSWORD=$(python -c 'import getpass;print(getpass.getpass())') vmpool grab "$vm_msg" +} + +function vm-list() { +LDAP_USERNAME=rod LDAP_PASSWORD=$(python -c 'import getpass;print(getpass.getpass())') vmpool list +} + # colored grep # Need to check an existing file for a pattern that will be found to ensure # that the check works when on an OS that supports the color option @@ -72,29 +88,35 @@ alias md='mkdir -p' alias rd='rmdir' # Common misspellings of bash-it -alias shit='bash-it' -alias batshit='bash-it' -alias bashit='bash-it' +alias bsh='bash-it' +alias batbsh='bash-it' +alias babsh='bash-it' alias bash_it='bash-it' alias bash_ti='bash-it' alias bsh='bash-it' # Additional bash-it aliases for help/show -alias shitsha='bash-it show aliases' -alias shitshc='bash-it show completions' -alias shitshp='bash-it show plugs' -alias shitha='bash-it help aliases' -alias shithc='bash-it help completions' -alias shithp='bash-it help plugins' -alias shitsrch="bash-it search $1" -alias shitsrchen="bash-it search $1 --enable" -alias shitenp="bash-it enable plugin" -alias shitena="bash-it enable alias" -alias shitenc="bash-it enable completion" +alias bshsa='bash-it show aliases' +alias bshsc='bash-it show completions' +alias bshsp='bash-it show plugins' +alias bshha='bash-it help aliases' +alias bshhc='bash-it help completions' +alias bshhp='bash-it help plugins' +alias bshsch="bash-it search $1" +alias bshschen="bash-it search $1 --enable" +alias bshenp="bash-it enable plugin" +alias bshena="bash-it enable alias" +alias bshenc="bash-it enable completion" + +# Shorten extract +alias xt="extract" # source ~/.bash_profile alias sprof="source ~/.bash_profile" +# sudo vim +alias svim="sudo vim" + # Display whatever file is regular file or folder catt() { for i in "$@"; do diff --git a/aliases/available/vagrant.aliases.bash b/aliases/available/vagrant.aliases.bash index ebbddaf4..ee33ada6 100644 --- a/aliases/available/vagrant.aliases.bash +++ b/aliases/available/vagrant.aliases.bash @@ -7,8 +7,8 @@ alias vscp='vaagrant scp' alias vsl='vagrant snapshot list' alias vst='vagrant snapshot take' alias vup="vagrant up" -alias vupo="vagrant up $1 --provider=openstack" -alias vupv="vagrant up $1 --provider=vsphere" +alias vupo="vagrant up $@ --provider=openstack" +alias vupv="vagrant up $@ --provider=vsphere" alias vupl="vagrant up 2>&1 | tee vagrant.log" alias vh="vagrant halt" alias vs="vagrant suspend" @@ -21,3 +21,4 @@ alias vdstr="vagrant destroy" alias vl="vagrant list" # requires vagrant-hostmanager plugin alias vhst="vagrant hostmanager" +alias svop="source openrc.sh && source vsphere-rc.sh" diff --git a/themes/powerline-r/README.md b/themes/powerline-r/README.md new file mode 100644 index 00000000..af84b4e8 --- /dev/null +++ b/themes/powerline-r/README.md @@ -0,0 +1,59 @@ +# Powerline Multiline Theme + +A colorful multiline theme, where the first line shows information about your shell session (divided into two parts, left and right), and the second one is where the shell commands are introduced. + +**IMPORTANT:** This theme requires that [a font with the Powerline symbols](https://github.com/powerline/fonts) needs to be used in your terminal emulator, otherwise the prompt won't be displayed correctly, i.e. some of the additional icons and characters will be missing. Please follow your operating system's instructions to install one of the fonts from the above link and select it in your terminal emulator. + +## Provided Information + +* Current path +* Current username and hostname +* Current time +* An indicator when connected by SSH +* An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this) +* An indicator when the current shell is inside the Vim editor +* Battery charging status (depends on the [../../plugins/available/battery.plugin.bash](battery plugin)) +* SCM Repository status (e.g. Git, SVN) +* The current Python environment (Virtualenv, venv, and Conda are supported) in use +* The current Ruby environment (rvm and rbenv are supported) in use +* Last command exit code (only shown when the exit code is greater than 0) + +## Configuration + +This theme is pretty configurable, all the configuration is done by setting environment variables. + +### User Information + +By default, the username and hostname are shown on the right hand side, but you can change this behavior by setting the value of the following variable: + + POWERLINE_PROMPT_USER_INFO_MODE="sudo" + +For now, the only supported value is `sudo`, which hides the username and hostname, and shows an indicator when `sudo` has the credentials cached. Other values have no effect at this time. + +### Clock Format + +By default, the current time is shown on the right hand side, you can change the format using the following variable: + + THEME_CLOCK_FORMAT="%H:%M:%S" + +The time/date is printed by the `date` command, so refer to its man page to change the format. + +### Segment Order + +The contents of both prompt sides can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are: + +* battery +* clock +* cwd +* in_vim +* python_venv +* ruby +* scm +* user_info + +Two variables can be defined to set the order of the prompt segments: + + POWERLINE_LEFT_PROMPT="scm python_venv ruby cwd" + POWERLINE_RIGHT_PROMPT="in_vim clock battery user_info" + +The example values above are the current default values, but if you want to remove anything from the prompt, simply remove the "string" that represents the segment from the corresponding variable. diff --git a/themes/powerline-r/powerline-r.base.bash b/themes/powerline-r/powerline-r.base.bash new file mode 100644 index 00000000..28c07a62 --- /dev/null +++ b/themes/powerline-r/powerline-r.base.bash @@ -0,0 +1,62 @@ +. "$BASH_IT/themes/powerline/powerline.base.bash" + +function __powerline_last_status_prompt { + [[ "$1" -ne 0 ]] && echo "$(set_color ${LAST_STATUS_THEME_PROMPT_COLOR} -) ${1} ${normal}" +} + +function __powerline_right_segment { + local OLD_IFS="${IFS}"; IFS="|" + local params=( $1 ) + IFS="${OLD_IFS}" + local separator_char="${POWERLINE_RIGHT_SEPARATOR}" + local padding=2 + local separator_color="" + + if [[ "${SEGMENTS_AT_RIGHT}" -eq 0 ]]; then + separator_color="$(set_color ${params[1]} -)" + else + separator_color="$(set_color ${params[1]} ${LAST_SEGMENT_COLOR})" + (( padding += 1 )) + fi + RIGHT_PROMPT+="${separator_color}${separator_char}${normal}$(set_color - ${params[1]}) ${params[0]} ${normal}$(set_color - ${COLOR})${normal}" + RIGHT_PROMPT_LENGTH=$(( ${#params[0]} + RIGHT_PROMPT_LENGTH + padding )) + LAST_SEGMENT_COLOR="${params[1]}" + (( SEGMENTS_AT_RIGHT += 1 )) +} + +function __powerline_prompt_command { + local last_status="$?" ## always the first + local separator_char="${POWERLINE_LEFT_SEPARATOR}" + local move_cursor_rightmost='\033[500C' + + LEFT_PROMPT="" + RIGHT_PROMPT="" + RIGHT_PROMPT_LENGTH=0 + SEGMENTS_AT_LEFT=0 + SEGMENTS_AT_RIGHT=0 + LAST_SEGMENT_COLOR="" + + ## left prompt ## + for segment in $POWERLINE_LEFT_PROMPT; do + local info="$(__powerline_${segment}_prompt)" + [[ -n "${info}" ]] && __powerline_left_segment "${info}" + done + [[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${separator_char}${normal}" + + ## right prompt ## + if [[ -n "${POWERLINE_RIGHT_PROMPT}" ]]; then + LEFT_PROMPT+="${move_cursor_rightmost}" + for segment in $POWERLINE_RIGHT_PROMPT; do + local info="$(__powerline_${segment}_prompt)" + [[ -n "${info}" ]] && __powerline_right_segment "${info}" + done + LEFT_PROMPT+="\033[${RIGHT_PROMPT_LENGTH}D" + fi + + PS1="${LEFT_PROMPT}${RIGHT_PROMPT}\n$(__powerline_last_status_prompt ${last_status})${PROMPT_CHAR} " + + ## cleanup ## + unset LAST_SEGMENT_COLOR \ + LEFT_PROMPT RIGHT_PROMPT RIGHT_PROMPT_LENGTH \ + SEGMENTS_AT_LEFT SEGMENTS_AT_RIGHT +} diff --git a/themes/powerline-r/powerline-r.theme.bash b/themes/powerline-r/powerline-r.theme.bash new file mode 100644 index 00000000..f034235d --- /dev/null +++ b/themes/powerline-r/powerline-r.theme.bash @@ -0,0 +1,69 @@ +#!/usr/bin/env bash +# My powerline-r theme + +. "$BASH_IT/custom/powerline-r/powerline-r.base.bash" + +THEME_PROMPT_SEPARATOR="" + +SHELL_SSH_CHAR=" " +SHELL_THEME_PROMPT_COLOR=39 +SHELL_SSH_THEME_PROMPT_COLOR=214 + +SCM_GIT_BEHIND_CHAR="↓" +SCM_GIT_AHEAD_CHAR="↑" +if [[ -z "$THEME_SCM_TAG_PREFIX" ]]; then +SCM_TAG_PREFIX="tag > " +else +SCM_TAG_PREFIX="$THEME_SCM_TAG_PREFIX" +fi +SCM_THEME_PROMPT_CLEAN="" +SCM_THEME_PROMPT_DIRTY="" +SCM_THEME_PROMPT_COLOR=237 +SCM_THEME_PROMPT_CLEAN_COLOR=230 +SCM_THEME_PROMPT_DIRTY_COLOR=226 +SCM_THEME_PROMPT_STAGED_COLOR=206 +SCM_THEME_PROMPT_UNTRACKED_COLOR=033 + +PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:="❯"} +POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""} +POWERLINE_RIGHT_SEPARATOR=${POWERLINE_RIGHT_SEPARATOR:=""} + +USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:=" "} +USER_INFO_THEME_PROMPT_COLOR=32 +USER_INFO_THEME_PROMPT_COLOR_SUDO=202 + +PYTHON_VENV_CHAR=${POWERLINE_PYTHON_VENV_CHAR:="❲p❳ "} +CONDA_PYTHON_VENV_CHAR=${POWERLINE_CONDA_PYTHON_VENV_CHAR:="❲c❳ "} +PYTHON_VENV_THEME_PROMPT_COLOR=35 + +SCM_NONE_CHAR="" +SCM_GIT_CHAR=${POWERLINE_SCM_GIT_CHAR:=" "} +SCM_THEME_PROMPT_COLOR=${SCM_THEME_PROMPT_CLEAN_COLOR} + +RVM_THEME_PROMPT_PREFIX="" +RVM_THEME_PROMPT_SUFFIX="" +RBENV_THEME_PROMPT_PREFIX="" +RBENV_THEME_PROMPT_SUFFIX="" +RUBY_THEME_PROMPT_COLOR=161 +RUBY_CHAR=${POWERLINE_RUBY_CHAR:="❲r❳ "} + +CWD_THEME_PROMPT_COLOR=240 + +LAST_STATUS_THEME_PROMPT_COLOR=196 + +CLOCK_THEME_PROMPT_COLOR=240 + +BATTERY_AC_CHAR=${BATTERY_AC_CHAR:="⚡"} +BATTERY_STATUS_THEME_PROMPT_GOOD_COLOR=70 +BATTERY_STATUS_THEME_PROMPT_LOW_COLOR=208 +BATTERY_STATUS_THEME_PROMPT_CRITICAL_COLOR=160 + +THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:="%H:%M:%S"} + +IN_VIM_THEME_PROMPT_COLOR=245 +IN_VIM_THEME_PROMPT_TEXT="vim" + +POWERLINE_LEFT_PROMPT=${POWERLINE_LEFT_PROMPT:="scm python_venv ruby cwd"} +POWERLINE_RIGHT_PROMPT=${POWERLINE_RIGHT_PROMPT:="in_vim clock battery user_info"} + +safe_append_prompt_command __powerline_prompt_command From d796390737f531c39f5a86de45023d0d93b820ff Mon Sep 17 00:00:00 2001 From: Rod Treweek Date: Mon, 26 Jun 2017 12:24:51 -0700 Subject: [PATCH 5/9] cleaning up --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b15c9fbf..b3fa2728 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ sudo: false script: test/run language: c -<<<<<<< HEAD os: - linux - osx From 1ff2dd7c59b536d6d0eadabff2bfafa30d16cd1e Mon Sep 17 00:00:00 2001 From: Rod Treweek Date: Mon, 26 Jun 2017 12:39:49 -0700 Subject: [PATCH 6/9] Add stuff (#7) * Added aliases for vagrant, bash-it, and homesick * added aliases * Add new feature (#6) * alias additions * Adding powerline-r theme * Adding Vagrant aliases --- aliases/available/general.aliases.bash | 3 +++ aliases/available/vagrant.aliases.bash | 2 ++ 2 files changed, 5 insertions(+) diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index 9cdb8b61..5db71cda 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -88,6 +88,9 @@ alias md='mkdir -p' alias rd='rmdir' # Common misspellings of bash-it +alias shit='bash-it' +alias batshit='bash-it' +alias bashit='bash-it' alias bsh='bash-it' alias batbsh='bash-it' alias babsh='bash-it' diff --git a/aliases/available/vagrant.aliases.bash b/aliases/available/vagrant.aliases.bash index ee33ada6..e38d10d9 100644 --- a/aliases/available/vagrant.aliases.bash +++ b/aliases/available/vagrant.aliases.bash @@ -14,6 +14,8 @@ alias vh="vagrant halt" alias vs="vagrant suspend" alias vr="vagrant resume" alias vrl="vagrant reload" +alias vssh="vagrant ssh" +alias vsshr="vagrant ssh $1 -- -t 'sudo su -; /bin/bash'" alias vst="vagrant status" alias vp="vagrant provision" alias vdstr="vagrant destroy" From 6eada49d9d6b4bef7b7925bc1096a53cab7e0fe2 Mon Sep 17 00:00:00 2001 From: Rod Treweek Date: Mon, 26 Jun 2017 12:57:44 -0700 Subject: [PATCH 7/9] cleaning things up a bit for merge --- aliases/available/general.aliases.bash | 12 ---- aliases/available/vagrant.aliases.bash | 3 - themes/powerline-r/README.md | 59 ------------------- themes/powerline-r/powerline-r.base.bash | 62 -------------------- themes/powerline-r/powerline-r.theme.bash | 69 ----------------------- 5 files changed, 205 deletions(-) delete mode 100644 themes/powerline-r/README.md delete mode 100644 themes/powerline-r/powerline-r.base.bash delete mode 100644 themes/powerline-r/powerline-r.theme.bash diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index 5db71cda..6ec0c4ff 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -23,17 +23,6 @@ alias vigen="vim ~/.bash_it/aliases/available/general.aliases.bash" alias vbrc="vim ~/.bashrc" alias vbpf="vim ~/.bash_profile" -# vmpooler -function vm-grab() { - printf "Hello! You rule. Which vm would you like?: " - read vm_msg - LDAP_USERNAME=rod LDAP_PASSWORD=$(python -c 'import getpass;print(getpass.getpass())') vmpool grab "$vm_msg" -} - -function vm-list() { -LDAP_USERNAME=rod LDAP_PASSWORD=$(python -c 'import getpass;print(getpass.getpass())') vmpool list -} - # colored grep # Need to check an existing file for a pattern that will be found to ensure # that the check works when on an OS that supports the color option @@ -96,7 +85,6 @@ alias batbsh='bash-it' alias babsh='bash-it' alias bash_it='bash-it' alias bash_ti='bash-it' -alias bsh='bash-it' # Additional bash-it aliases for help/show alias bshsa='bash-it show aliases' diff --git a/aliases/available/vagrant.aliases.bash b/aliases/available/vagrant.aliases.bash index e38d10d9..a32a941c 100644 --- a/aliases/available/vagrant.aliases.bash +++ b/aliases/available/vagrant.aliases.bash @@ -7,8 +7,6 @@ alias vscp='vaagrant scp' alias vsl='vagrant snapshot list' alias vst='vagrant snapshot take' alias vup="vagrant up" -alias vupo="vagrant up $@ --provider=openstack" -alias vupv="vagrant up $@ --provider=vsphere" alias vupl="vagrant up 2>&1 | tee vagrant.log" alias vh="vagrant halt" alias vs="vagrant suspend" @@ -23,4 +21,3 @@ alias vdstr="vagrant destroy" alias vl="vagrant list" # requires vagrant-hostmanager plugin alias vhst="vagrant hostmanager" -alias svop="source openrc.sh && source vsphere-rc.sh" diff --git a/themes/powerline-r/README.md b/themes/powerline-r/README.md deleted file mode 100644 index af84b4e8..00000000 --- a/themes/powerline-r/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Powerline Multiline Theme - -A colorful multiline theme, where the first line shows information about your shell session (divided into two parts, left and right), and the second one is where the shell commands are introduced. - -**IMPORTANT:** This theme requires that [a font with the Powerline symbols](https://github.com/powerline/fonts) needs to be used in your terminal emulator, otherwise the prompt won't be displayed correctly, i.e. some of the additional icons and characters will be missing. Please follow your operating system's instructions to install one of the fonts from the above link and select it in your terminal emulator. - -## Provided Information - -* Current path -* Current username and hostname -* Current time -* An indicator when connected by SSH -* An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this) -* An indicator when the current shell is inside the Vim editor -* Battery charging status (depends on the [../../plugins/available/battery.plugin.bash](battery plugin)) -* SCM Repository status (e.g. Git, SVN) -* The current Python environment (Virtualenv, venv, and Conda are supported) in use -* The current Ruby environment (rvm and rbenv are supported) in use -* Last command exit code (only shown when the exit code is greater than 0) - -## Configuration - -This theme is pretty configurable, all the configuration is done by setting environment variables. - -### User Information - -By default, the username and hostname are shown on the right hand side, but you can change this behavior by setting the value of the following variable: - - POWERLINE_PROMPT_USER_INFO_MODE="sudo" - -For now, the only supported value is `sudo`, which hides the username and hostname, and shows an indicator when `sudo` has the credentials cached. Other values have no effect at this time. - -### Clock Format - -By default, the current time is shown on the right hand side, you can change the format using the following variable: - - THEME_CLOCK_FORMAT="%H:%M:%S" - -The time/date is printed by the `date` command, so refer to its man page to change the format. - -### Segment Order - -The contents of both prompt sides can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are: - -* battery -* clock -* cwd -* in_vim -* python_venv -* ruby -* scm -* user_info - -Two variables can be defined to set the order of the prompt segments: - - POWERLINE_LEFT_PROMPT="scm python_venv ruby cwd" - POWERLINE_RIGHT_PROMPT="in_vim clock battery user_info" - -The example values above are the current default values, but if you want to remove anything from the prompt, simply remove the "string" that represents the segment from the corresponding variable. diff --git a/themes/powerline-r/powerline-r.base.bash b/themes/powerline-r/powerline-r.base.bash deleted file mode 100644 index 28c07a62..00000000 --- a/themes/powerline-r/powerline-r.base.bash +++ /dev/null @@ -1,62 +0,0 @@ -. "$BASH_IT/themes/powerline/powerline.base.bash" - -function __powerline_last_status_prompt { - [[ "$1" -ne 0 ]] && echo "$(set_color ${LAST_STATUS_THEME_PROMPT_COLOR} -) ${1} ${normal}" -} - -function __powerline_right_segment { - local OLD_IFS="${IFS}"; IFS="|" - local params=( $1 ) - IFS="${OLD_IFS}" - local separator_char="${POWERLINE_RIGHT_SEPARATOR}" - local padding=2 - local separator_color="" - - if [[ "${SEGMENTS_AT_RIGHT}" -eq 0 ]]; then - separator_color="$(set_color ${params[1]} -)" - else - separator_color="$(set_color ${params[1]} ${LAST_SEGMENT_COLOR})" - (( padding += 1 )) - fi - RIGHT_PROMPT+="${separator_color}${separator_char}${normal}$(set_color - ${params[1]}) ${params[0]} ${normal}$(set_color - ${COLOR})${normal}" - RIGHT_PROMPT_LENGTH=$(( ${#params[0]} + RIGHT_PROMPT_LENGTH + padding )) - LAST_SEGMENT_COLOR="${params[1]}" - (( SEGMENTS_AT_RIGHT += 1 )) -} - -function __powerline_prompt_command { - local last_status="$?" ## always the first - local separator_char="${POWERLINE_LEFT_SEPARATOR}" - local move_cursor_rightmost='\033[500C' - - LEFT_PROMPT="" - RIGHT_PROMPT="" - RIGHT_PROMPT_LENGTH=0 - SEGMENTS_AT_LEFT=0 - SEGMENTS_AT_RIGHT=0 - LAST_SEGMENT_COLOR="" - - ## left prompt ## - for segment in $POWERLINE_LEFT_PROMPT; do - local info="$(__powerline_${segment}_prompt)" - [[ -n "${info}" ]] && __powerline_left_segment "${info}" - done - [[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${separator_char}${normal}" - - ## right prompt ## - if [[ -n "${POWERLINE_RIGHT_PROMPT}" ]]; then - LEFT_PROMPT+="${move_cursor_rightmost}" - for segment in $POWERLINE_RIGHT_PROMPT; do - local info="$(__powerline_${segment}_prompt)" - [[ -n "${info}" ]] && __powerline_right_segment "${info}" - done - LEFT_PROMPT+="\033[${RIGHT_PROMPT_LENGTH}D" - fi - - PS1="${LEFT_PROMPT}${RIGHT_PROMPT}\n$(__powerline_last_status_prompt ${last_status})${PROMPT_CHAR} " - - ## cleanup ## - unset LAST_SEGMENT_COLOR \ - LEFT_PROMPT RIGHT_PROMPT RIGHT_PROMPT_LENGTH \ - SEGMENTS_AT_LEFT SEGMENTS_AT_RIGHT -} diff --git a/themes/powerline-r/powerline-r.theme.bash b/themes/powerline-r/powerline-r.theme.bash deleted file mode 100644 index f034235d..00000000 --- a/themes/powerline-r/powerline-r.theme.bash +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash -# My powerline-r theme - -. "$BASH_IT/custom/powerline-r/powerline-r.base.bash" - -THEME_PROMPT_SEPARATOR="" - -SHELL_SSH_CHAR=" " -SHELL_THEME_PROMPT_COLOR=39 -SHELL_SSH_THEME_PROMPT_COLOR=214 - -SCM_GIT_BEHIND_CHAR="↓" -SCM_GIT_AHEAD_CHAR="↑" -if [[ -z "$THEME_SCM_TAG_PREFIX" ]]; then -SCM_TAG_PREFIX="tag > " -else -SCM_TAG_PREFIX="$THEME_SCM_TAG_PREFIX" -fi -SCM_THEME_PROMPT_CLEAN="" -SCM_THEME_PROMPT_DIRTY="" -SCM_THEME_PROMPT_COLOR=237 -SCM_THEME_PROMPT_CLEAN_COLOR=230 -SCM_THEME_PROMPT_DIRTY_COLOR=226 -SCM_THEME_PROMPT_STAGED_COLOR=206 -SCM_THEME_PROMPT_UNTRACKED_COLOR=033 - -PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:="❯"} -POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""} -POWERLINE_RIGHT_SEPARATOR=${POWERLINE_RIGHT_SEPARATOR:=""} - -USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:=" "} -USER_INFO_THEME_PROMPT_COLOR=32 -USER_INFO_THEME_PROMPT_COLOR_SUDO=202 - -PYTHON_VENV_CHAR=${POWERLINE_PYTHON_VENV_CHAR:="❲p❳ "} -CONDA_PYTHON_VENV_CHAR=${POWERLINE_CONDA_PYTHON_VENV_CHAR:="❲c❳ "} -PYTHON_VENV_THEME_PROMPT_COLOR=35 - -SCM_NONE_CHAR="" -SCM_GIT_CHAR=${POWERLINE_SCM_GIT_CHAR:=" "} -SCM_THEME_PROMPT_COLOR=${SCM_THEME_PROMPT_CLEAN_COLOR} - -RVM_THEME_PROMPT_PREFIX="" -RVM_THEME_PROMPT_SUFFIX="" -RBENV_THEME_PROMPT_PREFIX="" -RBENV_THEME_PROMPT_SUFFIX="" -RUBY_THEME_PROMPT_COLOR=161 -RUBY_CHAR=${POWERLINE_RUBY_CHAR:="❲r❳ "} - -CWD_THEME_PROMPT_COLOR=240 - -LAST_STATUS_THEME_PROMPT_COLOR=196 - -CLOCK_THEME_PROMPT_COLOR=240 - -BATTERY_AC_CHAR=${BATTERY_AC_CHAR:="⚡"} -BATTERY_STATUS_THEME_PROMPT_GOOD_COLOR=70 -BATTERY_STATUS_THEME_PROMPT_LOW_COLOR=208 -BATTERY_STATUS_THEME_PROMPT_CRITICAL_COLOR=160 - -THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:="%H:%M:%S"} - -IN_VIM_THEME_PROMPT_COLOR=245 -IN_VIM_THEME_PROMPT_TEXT="vim" - -POWERLINE_LEFT_PROMPT=${POWERLINE_LEFT_PROMPT:="scm python_venv ruby cwd"} -POWERLINE_RIGHT_PROMPT=${POWERLINE_RIGHT_PROMPT:="in_vim clock battery user_info"} - -safe_append_prompt_command __powerline_prompt_command From 0e5b8725125d775b8513ee9148299436b3ccbf59 Mon Sep 17 00:00:00 2001 From: Rod Treweek Date: Wed, 28 Jun 2017 14:53:14 -0700 Subject: [PATCH 8/9] Fixing up Vagrant and general alias files --- aliases/available/general.aliases.bash | 7 +------ aliases/available/vagrant.aliases.bash | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index 6ec0c4ff..1e62ef3b 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -80,7 +80,6 @@ alias rd='rmdir' alias shit='bash-it' alias batshit='bash-it' alias bashit='bash-it' -alias bsh='bash-it' alias batbsh='bash-it' alias babsh='bash-it' alias bash_it='bash-it' @@ -93,8 +92,7 @@ alias bshsp='bash-it show plugins' alias bshha='bash-it help aliases' alias bshhc='bash-it help completions' alias bshhp='bash-it help plugins' -alias bshsch="bash-it search $1" -alias bshschen="bash-it search $1 --enable" +alias bshsch="bash-it search" alias bshenp="bash-it enable plugin" alias bshena="bash-it enable alias" alias bshenc="bash-it enable completion" @@ -102,9 +100,6 @@ alias bshenc="bash-it enable completion" # Shorten extract alias xt="extract" -# source ~/.bash_profile -alias sprof="source ~/.bash_profile" - # sudo vim alias svim="sudo vim" diff --git a/aliases/available/vagrant.aliases.bash b/aliases/available/vagrant.aliases.bash index a32a941c..d479fb2b 100644 --- a/aliases/available/vagrant.aliases.bash +++ b/aliases/available/vagrant.aliases.bash @@ -3,7 +3,7 @@ about-alias 'vagrant aliases' # Aliases alias vhl='vagrant hosts list' -alias vscp='vaagrant scp' +alias vscp='vagrant scp' alias vsl='vagrant snapshot list' alias vst='vagrant snapshot take' alias vup="vagrant up" @@ -13,7 +13,6 @@ alias vs="vagrant suspend" alias vr="vagrant resume" alias vrl="vagrant reload" alias vssh="vagrant ssh" -alias vsshr="vagrant ssh $1 -- -t 'sudo su -; /bin/bash'" alias vst="vagrant status" alias vp="vagrant provision" alias vdstr="vagrant destroy" From 7b5c0ec6fdf5ca72fa5e6277545c6065dc93263a Mon Sep 17 00:00:00 2001 From: Rod Treweek Date: Wed, 28 Jun 2017 15:47:28 -0700 Subject: [PATCH 9/9] Removing vigen alias --- aliases/available/general.aliases.bash | 1 - 1 file changed, 1 deletion(-) diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index 1e62ef3b..f0b5f96f 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -19,7 +19,6 @@ alias l1='ls -1' alias _="sudo" # Shortcuts to edit startup files -alias vigen="vim ~/.bash_it/aliases/available/general.aliases.bash" alias vbrc="vim ~/.bashrc" alias vbpf="vim ~/.bash_profile"