mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
Merged latest changes from upstream in
* blessed/master: Revert "Exit early from git plugin if not in git repo." Support dynamically defined Vagrant machines Symfony2 plugin autocomplete for app/console and bin/console Symfony2 plugin look for files only Symfony2 plugin use first console found fix missing add-zsh-hook in pygmalion.zsh-theme Use $OSTYPE instead of uname to speed things up Trust but verify 'scutil' to return ComputerName
This commit is contained in:
commit
c4520bca74
12 changed files with 15 additions and 14 deletions
|
|
@ -38,9 +38,9 @@ for plugin ($plugins); do
|
|||
done
|
||||
|
||||
# Figure out the SHORT hostname
|
||||
if [ -n "$commands[scutil]" ]; then
|
||||
# OS X
|
||||
SHORT_HOST=$(scutil --get ComputerName)
|
||||
if [[ "$OSTYPE" = darwin* ]]; then
|
||||
# OS X's $HOST changes with dhcp, etc. Use ComputerName if possible.
|
||||
SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/}
|
||||
else
|
||||
SHORT_HOST=${HOST/.*/}
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
# Modified to add support for Apple Mac #
|
||||
###########################################
|
||||
|
||||
if [[ $(uname) == "Darwin" ]] ; then
|
||||
if [[ "$OSTYPE" = darwin* ]] ; then
|
||||
|
||||
function battery_pct() {
|
||||
local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ bundle_install() {
|
|||
if _bundler-installed && _within-bundled-project; then
|
||||
local bundler_version=`bundle version | cut -d' ' -f3`
|
||||
if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
|
||||
if [[ "$(uname)" == 'Darwin' ]]
|
||||
if [[ "$OSTYPE" = darwin* ]]
|
||||
then
|
||||
local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
|
||||
else
|
||||
|
|
|
|||
|
|
@ -125,14 +125,12 @@ alias gsd='git svn dcommit'
|
|||
# Usage example: git pull origin $(current_branch)
|
||||
#
|
||||
function current_branch() {
|
||||
if [ ! -d .git ]; then return; fi
|
||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
||||
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
||||
echo ${ref#refs/heads/}
|
||||
}
|
||||
|
||||
function current_repository() {
|
||||
if [ ! -d .git ]; then return; fi
|
||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
||||
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
||||
echo $(git remote -v | cut -d':' -f 2)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
# jira ABC-123 # Opens an existing issue
|
||||
open_jira_issue () {
|
||||
local open_cmd
|
||||
if [[ $(uname -s) == 'Darwin' ]]; then
|
||||
if [[ "$OSTYPE" = darwin* ]]; then
|
||||
open_cmd='open'
|
||||
else
|
||||
open_cmd='xdg-open'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
function node-docs {
|
||||
# get the open command
|
||||
local open_cmd
|
||||
if [[ $(uname -s) == 'Darwin' ]]; then
|
||||
if [[ "$OSTYPE" = darwin* ]]; then
|
||||
open_cmd='open'
|
||||
else
|
||||
open_cmd='xdg-open'
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ _rake_refresh () {
|
|||
_rake_does_task_list_need_generating () {
|
||||
if [ ! -f .rake_tasks ]; then return 0;
|
||||
else
|
||||
if [[ $(uname -s) == 'Darwin' ]]; then
|
||||
if [[ "$OSTYPE" = darwin* ]]; then
|
||||
accurate=$(stat -f%m .rake_tasks)
|
||||
changed=$(stat -f%m Rakefile)
|
||||
else
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ if [[ $('uname') == 'Linux' ]]; then
|
|||
fi
|
||||
done
|
||||
|
||||
elif [[ $('uname') == 'Darwin' ]]; then
|
||||
elif [[ "$OSTYPE" = darwin* ]]; then
|
||||
local _sublime_darwin_paths > /dev/null 2>&1
|
||||
_sublime_darwin_paths=(
|
||||
"/usr/local/bin/subl"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Symfony2 basic command completion
|
||||
|
||||
_symfony_console () {
|
||||
echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console')"
|
||||
echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
|
||||
}
|
||||
|
||||
_symfony2_get_command_list () {
|
||||
|
|
@ -13,6 +13,8 @@ _symfony2 () {
|
|||
}
|
||||
|
||||
compdef _symfony2 '`_symfony_console`'
|
||||
compdef _symfony2 'app/console'
|
||||
compdef _symfony2 'bin/console'
|
||||
compdef _symfony2 sf
|
||||
|
||||
#Alias
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ __box_list ()
|
|||
__vm_list ()
|
||||
{
|
||||
_wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *[:"]\([a-zA-Z0-9_-]\+\)' 2>/dev/null | awk '{print substr($2, 2)}')
|
||||
_wanted application expl 'command' compadd $(command ls .vagrant/machines/ 2>/dev/null)
|
||||
}
|
||||
|
||||
__vagrant-box ()
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
function web_search() {
|
||||
# get the open command
|
||||
local open_cmd
|
||||
if [[ $(uname -s) == 'Darwin' ]]; then
|
||||
if [[ "$OSTYPE" = darwin* ]]; then
|
||||
open_cmd='open'
|
||||
else
|
||||
open_cmd='xdg-open'
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ prompt_setup_pygmalion(){
|
|||
base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
||||
post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
||||
|
||||
add-zsh-hook precmd prompt_pygmalion_precmd
|
||||
precmd_functions+=(prompt_pygmalion_precmd)
|
||||
}
|
||||
|
||||
prompt_pygmalion_precmd(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue