commit 76df139b7b02a83c941c9e48d125aae0f687332d
parent 7a3c993259fe2ac5262b563472a7fe46d9eecf22
Author: finwo <finwo@pm.me>
Date: Tue, 30 Jun 2020 11:57:09 +0200
ZSH: Add linuxbrew support, Add nativescript support
Diffstat:
| M | zsh/home/.zshrc | | | 76 | ++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------ |
1 file changed, 52 insertions(+), 24 deletions(-)
diff --git a/zsh/home/.zshrc b/zsh/home/.zshrc
@@ -1,5 +1,12 @@
# vim:fdm=marker:fdl=0
+# Homebrew {{{
+
+if [ -d /home/linuxbrew/.linuxbrew ]; then
+ eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
+fi
+
+# }}}
# OSX coreutils {{{
if command -v brew &>/dev/null; then
@@ -23,27 +30,6 @@ bindkey -v
# }}}
# Custom commands {{{
-function getComposer {
- curl https://getcomposer.org/installer | php
-}
-
-function composer {
- for p in $(echo $PATH | tr ':' '\n'); do
- for i in $(echo composer{.phar,}); do
- [ -f "$p/$i" ] || continue
- php "$p/$i" "$@"
- return $?
- done
- done
- for i in $(echo {,\~/,{/usr,/opt}{/local,}/bin/}composer{.phar,}); do
- [ -f "$i" ] || continue
- php "$i" "$@"
- return $?
- done
- echo "composer is not installed on this system"
- return 1
-}
-
# https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
function version() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
@@ -124,18 +110,24 @@ PROMPT_COMMAND=
# }}}
# Titles {{{
-[[ -e ~/src/finwo/zsh-titles/titles.plugin.zsh ]] && source ~/src/finwo/zsh-titles/titles.plugin.zsh
+[[ -e ~/src/jreese/zsh-titles/titles.plugin.zsh ]] && source ~/src/jreese/zsh-titles/titles.plugin.zsh
# }}}
# FuzzyFinder {{{
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# }}}
# Google Cloud SDK {{{
+
# The next line updates PATH for the Google Cloud SDK.
-if [ -f "${HOME}/google-cloud-sdk/path.zsh.inc" ]; then . "${HOME}/google-cloud-sdk/path.zsh.inc"; fi
+if [ -f '/home/finwo/google-cloud-sdk/path.zsh.inc' ]; then
+ . '/home/finwo/google-cloud-sdk/path.zsh.inc'
+fi
# The next line enables shell command completion for gcloud.
-if [ -f "${HOME}/google-cloud-sdk/completion.zsh.inc" ]; then . "${HOME}/google-cloud-sdk/completion.zsh.inc"; fi
+if [ -f '/home/finwo/google-cloud-sdk/completion.zsh.inc' ]; then
+ . '/home/finwo/google-cloud-sdk/completion.zsh.inc'
+fi
+
# }}}
# Go binaries {{{
if [ -d "${HOME}/go/bin" ]; then
@@ -152,6 +144,37 @@ if [ -d "${HOME}/.cargo/bin" ]; then
export PATH="${HOME}/.cargo/bin:${PATH}"
fi
# }}}
+# Global composer {{{
+
+# Simple composer fetcher
+function getComposer {
+ curl https://getcomposer.org/installer | php
+}
+
+# Auto-detects where composer(.phar) is installed
+function composer {
+ for p in $(echo $PATH | tr ':' '\n'); do
+ for i in $(echo composer{.phar,}); do
+ [ -f "$p/$i" ] || continue
+ php "$p/$i" "$@"
+ return $?
+ done
+ done
+ for i in $(echo {,\~/,{/usr,/opt}{/local,}/bin/}composer{.phar,}); do
+ [ -f "$i" ] || continue
+ php "$i" "$@"
+ return $?
+ done
+ echo "composer is not installed on this system"
+ return 1
+}
+
+# Use composer-installed binaries
+if [ -d "${HOME}/.config/composer/vendor/bin" ]; then
+ export PATH="${HOME}/.config/composer/vendor/bin:${PATH}"
+fi
+
+# }}}
# Node Version Manager {{{
if [ -d "${HOME}/.nvm" ]; then
export NVM_DIR="$HOME/.nvm"
@@ -197,3 +220,8 @@ EOF
}
# }}}
+# nativescript {{{
+if [ -f /home/finwo/.tnsrc ]; then
+ source /home/finwo/.tnsrc
+fi
+# }}}