diff options
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | plugins/bundler/bundler.plugin.zsh | 15 | ||||
-rw-r--r-- | plugins/extract/extract.plugin.zsh | 2 | ||||
-rw-r--r-- | plugins/forklift/forklift.plugin.zsh | 35 | ||||
-rw-r--r-- | plugins/git/git.plugin.zsh | 4 | ||||
-rw-r--r-- | plugins/gitignore/gitignore.plugin.zsh | 12 | ||||
-rw-r--r-- | plugins/gpg-agent/gpg-agent.plugin.zsh | 3 | ||||
-rw-r--r-- | plugins/sfffe/sfffe.plugin.zsh (renamed from custom/plugins/sfffe/sfffe.plugin.zsh) | 0 | ||||
-rw-r--r-- | plugins/tmux/tmux.plugin.zsh | 8 | ||||
-rw-r--r-- | themes/agnoster.zsh-theme | 2 |
10 files changed, 72 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore index 5db11ce5c..c2b47bba7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ locals.zsh log/.zsh_history projects.zsh -custom/example -custom/example.zsh +-custom/* +-!custom/example +-!custom/example.zsh *.swp !custom/example.zshcache cache/ diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 5bd28cbdc..2e657e5a8 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -4,13 +4,18 @@ alias bp="bundle package" alias bo="bundle open" alias bu="bundle update" -if [[ "$(uname)" == 'Darwin' ]] -then - local cores_num="$(sysctl hw.ncpu | awk '{print $2}')" +bundler_version=`bundle version | cut -d' ' -f3` +if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then + if [[ "$(uname)" == 'Darwin' ]] + then + local cores_num="$(sysctl hw.ncpu | awk '{print $2}')" + else + local cores_num="$(nproc)" + fi + eval "alias bi='bundle install --jobs=$cores_num'" else - local cores_num="$(nproc)" + alias bi='bundle install' fi -eval "alias bi='bundle install --jobs=$cores_num'" # The following is based on https://github.com/gma/bundler-exec diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 23e86c593..7352e5bad 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -52,7 +52,7 @@ function extract() { (*.xz) unxz "$1" ;; (*.lzma) unlzma "$1" ;; (*.Z) uncompress "$1" ;; - (*.zip) unzip "$1" -d $extract_dir ;; + (*.zip|*.war|*.jar) unzip "$1" -d $extract_dir ;; (*.rar) unrar x -ad "$1" ;; (*.7z) 7za x "$1" ;; (*.deb) diff --git a/plugins/forklift/forklift.plugin.zsh b/plugins/forklift/forklift.plugin.zsh index 056069d36..b0e60a434 100644 --- a/plugins/forklift/forklift.plugin.zsh +++ b/plugins/forklift/forklift.plugin.zsh @@ -1,5 +1,6 @@ -# Open folder in ForkLift.app from console +# Open folder in ForkLift.app of ForkLift2.app from console # Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de +# Updated to support ForkLift2 by Johan Kaving # # Usage: # fl [<folder>] @@ -22,9 +23,33 @@ function fl { fi fi osascript 2>&1 1>/dev/null <<END - tell application "ForkLift" - activate - end tell + + try + tell application "Finder" + set appName to name of application file id "com.binarynights.ForkLift2" + end tell + on error err_msg number err_num + tell application "Finder" + set appName to name of application file id "com.binarynights.ForkLift" + end tell + end try + + if application appName is running + tell application appName + activate + end tell + else + tell application appName + activate + end tell + repeat until application appName is running + delay 1 + end repeat + tell application appName + activate + end tell + end if + tell application "System Events" tell application process "ForkLift" try @@ -36,7 +61,7 @@ function fl { keystroke "g" using {command down, shift down} tell sheet 1 of topWindow set value of text field 1 to "$PWD" - keystroke return + keystroke return end tell end tell end tell diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index d8ea3ae0c..c7e98654a 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -85,7 +85,11 @@ compdef _git gm=git-mergetool alias gg='git gui citool' alias gga='git gui citool --amend' alias gk='gitk --all --branches' + alias gsts='git stash show --text' +alias gsta='git stash' +alias gstp='git stash pop' +alias gstd='git stash drop' # Will cd into the top of the current repository # or submodule. diff --git a/plugins/gitignore/gitignore.plugin.zsh b/plugins/gitignore/gitignore.plugin.zsh new file mode 100644 index 000000000..332497cec --- /dev/null +++ b/plugins/gitignore/gitignore.plugin.zsh @@ -0,0 +1,12 @@ +function gi() { curl http://gitignore.io/api/$@ ;} + +_gitignireio_get_command_list() { + curl -s http://gitignore.io/api/list | tr "," "\n" +} + +_gitignireio () { + compset -P '*,' + compadd -S '' `_gitignireio_get_command_list` +} + +compdef _gitignireio gi
\ No newline at end of file diff --git a/plugins/gpg-agent/gpg-agent.plugin.zsh b/plugins/gpg-agent/gpg-agent.plugin.zsh index 4071334cb..3e6a34f42 100644 --- a/plugins/gpg-agent/gpg-agent.plugin.zsh +++ b/plugins/gpg-agent/gpg-agent.plugin.zsh @@ -19,6 +19,9 @@ if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then # source settings of old agent, if applicable if [ -f "${GPG_ENV}" ]; then . ${GPG_ENV} > /dev/null + export GPG_AGENT_INFO + export SSH_AUTH_SOCK + export SSH_AGENT_PID fi # check again if another agent is running using the newly sourced settings diff --git a/custom/plugins/sfffe/sfffe.plugin.zsh b/plugins/sfffe/sfffe.plugin.zsh index a0f034908..a0f034908 100644 --- a/custom/plugins/sfffe/sfffe.plugin.zsh +++ b/plugins/sfffe/sfffe.plugin.zsh diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 96fab80a6..626c41f3d 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -1,3 +1,11 @@ +# +# Aliases +# + +alias ta='tmux attach -t' +alias ts='tmux new-session -s' +alias tl='tmux list-sessions' + # Only run if tmux is actually installed if which tmux &> /dev/null then diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 7df4ec1e8..2db565266 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -137,7 +137,7 @@ prompt_dir() { # Virtualenv: current working virtualenv prompt_virtualenv() { local virtualenv_path="$VIRTUAL_ENV" - if [[ -n $virtualenv_path ]]; then + if [[ -n $virtualenv_path && -z $VIRTUAL_ENV_DISABLE_PROMPT ]]; then prompt_segment blue black "(`basename $virtualenv_path`)" fi } |