updated zsh config
This commit is contained in:
parent
199e7c342d
commit
ccdabc366a
19 changed files with 155 additions and 51 deletions
21
dot.oh-my-zsh/MIT-LICENSE.txt
Normal file
21
dot.oh-my-zsh/MIT-LICENSE.txt
Normal file
|
@ -0,0 +1,21 @@
|
|||
The MIT License
|
||||
|
||||
Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
1
dot.oh-my-zsh/cache/modules-3.6.10-1-ARCH
vendored
1
dot.oh-my-zsh/cache/modules-3.6.10-1-ARCH
vendored
File diff suppressed because one or more lines are too long
|
@ -9,14 +9,10 @@ man-command ()
|
|||
|
||||
sudo-command ()
|
||||
{
|
||||
if [ -n "$BUFFER" ]
|
||||
then
|
||||
local FirstArg=`echo $BUFFER | awk '{print $1}'`
|
||||
if [ "$FirstArg" != "sudo" ]
|
||||
then
|
||||
BUFFER="sudo $BUFFER"
|
||||
zle end-of-line
|
||||
fi
|
||||
if [ -n "$BUFFER" -a "${BUFFER:0:4}" != "sudo" ]
|
||||
then
|
||||
BUFFER="sudo $BUFFER"
|
||||
zle end-of-line
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -42,9 +38,18 @@ move-pointer-after-command ()
|
|||
fi
|
||||
}
|
||||
|
||||
# bmi calculator and it doesn't care if you start width height or width
|
||||
# eg: `bmi 65 1.8` and `bmi 1.8 65` is the same
|
||||
bmi ()
|
||||
{
|
||||
echo $(($1/$2/$2))
|
||||
local w=$1
|
||||
local h=$2
|
||||
if [[ $w -lt $h ]]
|
||||
then
|
||||
h=$1
|
||||
w=$2
|
||||
fi
|
||||
echo $(($w/$h/$h))
|
||||
}
|
||||
|
||||
zle -N man-command # shows the man-page of the written command
|
||||
|
|
|
@ -25,7 +25,9 @@ bindkey -M menuselect '^o' accept-and-infer-next-history
|
|||
|
||||
zstyle ':completion:*:*:*:*:*' menu select
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
||||
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
|
||||
#zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
|
||||
#zstyle ':completion:*:*:kill:*:processes' command "ps -u `whoami` --forest -e -o pid,user,tty,cmd"
|
||||
zstyle ':completion:*:*:kill:*:processes' command "ps xfo pid,user,tty,cmd"
|
||||
|
||||
# disable named-directories autocompletion
|
||||
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
||||
|
|
|
@ -9,13 +9,15 @@ function git_prompt_info() {
|
|||
# Checks if working tree is dirty
|
||||
parse_git_dirty() {
|
||||
local SUBMODULE_SYNTAX=''
|
||||
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
||||
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
|
||||
fi
|
||||
if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then
|
||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||
else
|
||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
|
||||
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
||||
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
|
||||
fi
|
||||
if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then
|
||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||
else
|
||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@ function title {
|
|||
fi
|
||||
if [[ "$TERM" == screen* ]]; then
|
||||
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
|
||||
elif [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then
|
||||
print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
|
||||
elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
|
||||
print -Pn "\e]2;$2:q\a" #set window name
|
||||
print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
|
||||
|
|
|
@ -33,6 +33,7 @@ _run-with-bundler() {
|
|||
|
||||
## Main program
|
||||
for cmd in $bundled_commands; do
|
||||
eval "function unbundled_$cmd () { $cmd \$@ }"
|
||||
eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
|
||||
alias $cmd=bundled_$cmd
|
||||
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
encode64(){ echo -n $1 | base64 }
|
||||
decode64(){ echo -n $1 | base64 -D }
|
||||
decode64(){ echo -n $1 | base64 -D }
|
||||
alias e64=encode64
|
||||
alias d64=decode64
|
||||
|
|
|
@ -5,15 +5,29 @@ function _lein_commands() {
|
|||
case $state in
|
||||
subcommand)
|
||||
subcommands=(
|
||||
"classpath:print the classpath of the current project"
|
||||
"clean:remove compiled files and dependencies from project"
|
||||
"compile:ahead-of-time compile the project"
|
||||
"deploy:build jar and deploy to remote repository"
|
||||
"deps:download and install all dependencies"
|
||||
"help:display a list of tasks or help for a given task"
|
||||
"install:install the project and its dependencies in your local repository"
|
||||
"int:enter an interactive task shell"
|
||||
"interactive:enter an interactive task shell"
|
||||
"jack-in:jack in to a clojure slime session from emacs."
|
||||
"jar:create a jar file containing the compiled .class files"
|
||||
"javac:compile java source files"
|
||||
"new:create a new project skeleton"
|
||||
"plugin:manage user-level plugins"
|
||||
"pom:write a pom.xml file to disk for maven interop"
|
||||
"repl:start a repl session either with the current project or standalone"
|
||||
"retest:run only the test namespaces which failed last time around"
|
||||
"run:run the project's -main function"
|
||||
"search:search remote maven repositories for matching jars"
|
||||
"swank:launch swank server for Emacs to connect"
|
||||
"test:run the project's tests"
|
||||
"test!:run a project's tests after cleaning and fetching dependencies"
|
||||
"trampoline:run a task without nesting the project's JVM inside Leiningen's."
|
||||
"uberjar:Create a jar including the contents of each of deps"
|
||||
"upgrade:upgrade leiningen to the latest stable release"
|
||||
"version:print leiningen's version"
|
||||
|
|
42
dot.oh-my-zsh/plugins/pj/pj.plugin.zsh
Normal file
42
dot.oh-my-zsh/plugins/pj/pj.plugin.zsh
Normal file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/zsh
|
||||
|
||||
#
|
||||
# Original idea by DefV (Jan De Poorter)
|
||||
# Source: https://gist.github.com/pjaspers/368394#comment-1016
|
||||
#
|
||||
# Usage:
|
||||
# - Set `$PROJECT_PATHS` in your ~/.zshrc
|
||||
# e.g.: PROJECT_PATHS=(~/src ~/work)
|
||||
# - In ZSH you now can open a project directory with the command: `pj my-project`
|
||||
# the plugin will locate the `my-project` directory in one of the $PROJECT_PATHS
|
||||
# Also tab completion is supported.
|
||||
# - `pjo my-project` will open the directory in $EDITOR
|
||||
#
|
||||
|
||||
function pj() {
|
||||
cmd="cd"
|
||||
file=$1
|
||||
|
||||
if [[ "open" == "$file" ]] then
|
||||
file=$2
|
||||
cmd=(${(s: :)EDITOR})
|
||||
fi
|
||||
|
||||
for project in $PROJECT_PATHS; do
|
||||
if [[ -d $project/$file ]] then
|
||||
$cmd "$project/$file"
|
||||
unset project # Unset project var
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
echo "No such project $1"
|
||||
}
|
||||
|
||||
alias pjo="pj open"
|
||||
|
||||
function _pj () {
|
||||
compadd `/bin/ls -l $PROJECT_PATHS 2>/dev/null | awk '{ print $9 }'`
|
||||
}
|
||||
|
||||
compdef _pj pj
|
|
@ -32,11 +32,11 @@ for rbenvdir in "${rbenvdirs[@]}" ; do
|
|||
|
||||
function gems {
|
||||
local rbenv_path=$(rbenv prefix)
|
||||
gem list $@ | sed \
|
||||
-Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \
|
||||
-Ee "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \
|
||||
-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
|
||||
-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
|
||||
gem list $@ | sed -E \
|
||||
-e "s/\([0-9a-z, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \
|
||||
-e "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \
|
||||
-e "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
|
||||
-e "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
|
||||
}
|
||||
|
||||
function rbenv_prompt_info() {
|
||||
|
|
|
@ -57,8 +57,6 @@ sprunge() {
|
|||
fi
|
||||
else
|
||||
echo Using input from a pipe or STDIN redirection... >&2
|
||||
while read -r line ; do
|
||||
echo $line
|
||||
done | curl -F 'sprunge=<-' http://sprunge.us
|
||||
curl -F 'sprunge=<-' http://sprunge.us
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -3,18 +3,13 @@
|
|||
function zle-keymap-select zle-line-init zle-line-finish {
|
||||
# The terminal must be in application mode when ZLE is active for $terminfo
|
||||
# values to be valid.
|
||||
if (( $+terminfo[smkx] && $+terminfo[rmkx] )); then
|
||||
case "$0" in
|
||||
(zle-line-init)
|
||||
# Enable terminal application mode.
|
||||
echoti smkx
|
||||
;;
|
||||
(zle-line-finish)
|
||||
# Disable terminal application mode.
|
||||
echoti rmkx
|
||||
;;
|
||||
esac
|
||||
if (( ${+terminfo[smkx]} )); then
|
||||
printf '%s' ${terminfo[smkx]}
|
||||
fi
|
||||
if (( ${+terminfo[rmkx]} )); then
|
||||
printf '%s' ${terminfo[rmkx]}
|
||||
fi
|
||||
|
||||
zle reset-prompt
|
||||
zle -R
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
* `zcu` aliases `zeus cucumber`
|
||||
* `zucumber` aliases `zeus cucumber`
|
||||
|
||||
* `zspec` aliases `zeus rspec`
|
||||
|
||||
* `zt` aliases `zeus test`
|
||||
* `zest` aliases `zeus test`
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
# Always use bundler.
|
||||
# Rails depends on bundler, so we can be pretty sure, that there are no
|
||||
# problems with this command. For all the other aliases I provided an
|
||||
# problems with this command. For all the other aliases I provided an
|
||||
# alternative, in case people have conflicts with other plugins (e.g. suse).
|
||||
alias zeus='bundle exec zeus'
|
||||
|
||||
|
@ -40,6 +40,9 @@ alias zunner='zeus runner'
|
|||
alias zcu='zeus cucumber'
|
||||
alias zucumber='zeus cucumber'
|
||||
|
||||
# Rspec
|
||||
alias zspec='zeus rspec'
|
||||
|
||||
# Test
|
||||
alias zt='zeus test'
|
||||
alias zest='zeus test'
|
||||
|
|
|
@ -95,7 +95,7 @@ prompt_dir() {
|
|||
prompt_status() {
|
||||
local symbols
|
||||
symbols=()
|
||||
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}$RETVAL"
|
||||
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘"
|
||||
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡"
|
||||
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙"
|
||||
|
||||
|
|
|
@ -8,13 +8,23 @@ function _prompt_char() {
|
|||
fi
|
||||
}
|
||||
|
||||
# This theme works with both the "dark" and "light" variants of the
|
||||
# Solarized color schema. Set the SOLARIZED_THEME variable to one of
|
||||
# these two values to choose. If you don't specify, we'll assume you're
|
||||
# using the "dark" variant.
|
||||
|
||||
case ${SOLARIZED_THEME:-dark} in
|
||||
light) bkg=white;;
|
||||
*) bkg=black;;
|
||||
esac
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{%f%k%b%K{black}%B%F{green}%}]"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{%f%k%b%K{${bkg}}%B%F{green}%}]"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{%F{red}%}*%{%f%k%b%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
PROMPT='%{%f%k%b%}
|
||||
%{%K{black}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{%b%F{yellow}%K{black}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%}
|
||||
%{%K{black}%}$(_prompt_char)%{%K{black}%} %#%{%f%k%b%} '
|
||||
%{%K{${bkg}}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{%b%F{yellow}%K{${bkg}}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%}
|
||||
%{%K{${bkg}}%}$(_prompt_char)%{%K{${bkg}}%} %#%{%f%k%b%} '
|
||||
|
||||
RPROMPT='!%{%B%F{cyan}%}%!%{%f%k%b%}'
|
||||
|
|
|
@ -16,13 +16,18 @@ _collapsed_path() {
|
|||
PR_PWDLEN=""
|
||||
PR_GIT="$(git_prompt_info)"
|
||||
|
||||
local pwd=%~
|
||||
local promptsize=${#${(%):-(%n@%m)--}}
|
||||
local pwdsize=${#${(%):-%~}}
|
||||
local gitinfosize=${#${(%):-$PR_GIT}}
|
||||
|
||||
if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then
|
||||
((PR_PWDLEN=$TERMWIDTH - $promptsize - $gitinfosize))
|
||||
fi
|
||||
|
||||
if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then
|
||||
pwd=$(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g")
|
||||
pwdsize=${#${(%):-$pwd}}
|
||||
if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then
|
||||
((PR_PWDLEN=$TERMWIDTH - $promptsize - $gitinfosize))
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "%$PR_PWDLEN<...<%~%<<"
|
||||
}
|
||||
|
|
|
@ -32,13 +32,18 @@ COMPLETION_WAITING_DOTS="true"
|
|||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
||||
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
plugins=(git ruby archlinux bundler coffee compleat encode64 extract gem git-extras npm screen systemd urltools zsh-syntax-highlighting)
|
||||
plugins=(git ruby archlinux bundler coffee compleat encode64 extract gem git-extras npm screen systemd urltools zsh-syntax-highlighting pj)
|
||||
|
||||
# Highlighters
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
|
||||
|
||||
# Project Paths for PJ
|
||||
PROJECT_PATHS=(~/src ~/src/projects)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
source $ZSH/lib/key-bindings.zsh
|
||||
|
||||
# Customize to your needs...
|
||||
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl:/home/nk/.gem/ruby/1.9.1/bin
|
||||
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl:/home/nk/.gem/ruby/1.9.1/bin:/home/nk/.gem/ruby/1.8/bin
|
||||
|
||||
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
|
||||
|
|
Loading…
Reference in a new issue