summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/battery/battery.plugin.zsh12
-rw-r--r--plugins/bundler/_bundler9
-rw-r--r--plugins/bundler/bundler.plugin.zsh2
-rw-r--r--plugins/git-remote-branch/git-remote-branch.plugin.zsh3
-rw-r--r--plugins/safe-paste/safe-paste.plugin.zsh4
5 files changed, 22 insertions, 8 deletions
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index 95f890632..0c7c9421f 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -10,12 +10,16 @@
if [[ $(uname) == "Darwin" ]] ; then
+ function battery_pct() {
+ typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
+ typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
+ integer i=$(((currentcapacity/maxcapacity) * 100))
+ echo $i
+ }
+
function battery_pct_remaining() {
if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
- typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
- typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
- integer i=$(((currentcapacity/maxcapacity) * 100))
- echo $i
+ battery_pct
else
echo "External Power"
fi
diff --git a/plugins/bundler/_bundler b/plugins/bundler/_bundler
index 5d22cac9a..2ec3a5f9c 100644
--- a/plugins/bundler/_bundler
+++ b/plugins/bundler/_bundler
@@ -23,6 +23,7 @@ case $state in
"viz[Generate a visual representation of your dependencies]" \
"init[Generate a simple Gemfile, placed in the current directory]" \
"gem[Create a simple gem, suitable for development with bundler]" \
+ "clean[Cleans up unused gems in your bundler directory]" \
"help[Describe available tasks or one specific task]"
ret=0
;;
@@ -62,6 +63,14 @@ case $state in
exec)
_normal && ret=0
;;
+ clean)
+ _arguments \
+ '(--force)--force[forces clean even if --path is not set]' \
+ '(--dry-run)--dry-run[only print out changes, do not actually clean gems]' \
+ '(--no-color)--no-color[Disable colorization in output]' \
+ '(--verbose)--verbose[Enable verbose output mode]'
+ ret=0
+ ;;
(open|show)
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
if [[ $_gems != "" ]]; then
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
index bc21da134..a288cffcd 100644
--- a/plugins/bundler/bundler.plugin.zsh
+++ b/plugins/bundler/bundler.plugin.zsh
@@ -6,7 +6,7 @@ alias bu="bundle update"
# The following is based on https://github.com/gma/bundler-exec
-bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma)
+bundled_commands=(annotate cap capify cucumber foreman guard jekyll middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma)
## Functions
diff --git a/plugins/git-remote-branch/git-remote-branch.plugin.zsh b/plugins/git-remote-branch/git-remote-branch.plugin.zsh
index ff98cbf87..6c5ab8f70 100644
--- a/plugins/git-remote-branch/git-remote-branch.plugin.zsh
+++ b/plugins/git-remote-branch/git-remote-branch.plugin.zsh
@@ -6,7 +6,8 @@ _git_remote_branch() {
compadd create publish rename delete track
elif (( CURRENT == 3 )); then
# second arg: remote branch name
- compadd `git branch -r | grep -v HEAD | sed "s/.*\///" | sed "s/ //g"`
+ remotes=`git remote | tr '\n' '|' | sed "s/\|$//g"`
+ compadd `git branch -r | grep -v HEAD | sed "s/$remotes\///" | sed "s/ //g"`
elif (( CURRENT == 4 )); then
# third arg: remote name
compadd `git remote`
diff --git a/plugins/safe-paste/safe-paste.plugin.zsh b/plugins/safe-paste/safe-paste.plugin.zsh
index 0aa97965f..17c212c19 100644
--- a/plugins/safe-paste/safe-paste.plugin.zsh
+++ b/plugins/safe-paste/safe-paste.plugin.zsh
@@ -43,12 +43,12 @@ function _paste_insert() {
function _zle_line_init() {
# Tell terminal to send escape codes around pastes.
- [[ $TERM == rxvt-unicode || $TERM == xterm || $TERM = xterm-256color ]] && printf '\e[?2004h'
+ [[ $TERM == rxvt-unicode || $TERM == xterm || $TERM = xterm-256color || $TERM = screen || $TERM = screen-256color ]] && printf '\e[?2004h'
}
function _zle_line_finish() {
# Tell it to stop when we leave zle, so pasting in other programs
# doesn't get the ^[[200~ codes around the pasted text.
- [[ $TERM == rxvt-unicode || $TERM == xterm || $TERM = xterm-256color ]] && printf '\e[?2004l'
+ [[ $TERM == rxvt-unicode || $TERM == xterm || $TERM = xterm-256color || $TERM = screen || $TERM = screen-256color ]] && printf '\e[?2004l'
}