mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Merge 6cd297c91f into f9e2af2bd7
This commit is contained in:
commit
f64d4b5f04
5 changed files with 94 additions and 19 deletions
|
|
@ -10,14 +10,16 @@ function upgrade_oh_my_zsh() {
|
||||||
/bin/sh $ZSH/tools/upgrade.sh
|
/bin/sh $ZSH/tools/upgrade.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
function take() {
|
function logview() {
|
||||||
mkdir -p $1
|
ccze -A < $1 | less -R
|
||||||
cd $1
|
}
|
||||||
|
|
||||||
|
function logtail() {
|
||||||
|
tail -f $1 | ccze
|
||||||
}
|
}
|
||||||
|
|
||||||
function extract() {
|
function extract() {
|
||||||
unset REMOVE_ARCHIVE
|
unset REMOVE_ARCHIVE
|
||||||
|
|
||||||
if test "$1" = "-r"; then
|
if test "$1" = "-r"; then
|
||||||
REMOVE=1
|
REMOVE=1
|
||||||
shift
|
shift
|
||||||
|
|
@ -49,4 +51,3 @@ function extract() {
|
||||||
echo "'$1' is not a valid file"
|
echo "'$1' is not a valid file"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,4 @@ setopt long_list_jobs
|
||||||
|
|
||||||
## pager
|
## pager
|
||||||
export PAGER=less
|
export PAGER=less
|
||||||
export LC_CTYPE=en_US.UTF-8
|
export LC_CTYPE=$LANG
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,14 @@
|
||||||
alias g='git'
|
alias g='git'
|
||||||
compdef g=git
|
compdef g=git
|
||||||
alias gst='git status'
|
alias gst='git status'
|
||||||
compdef _git gst=git-status
|
alias gsts='git status --short'
|
||||||
alias gl='git pull'
|
alias gl='git pull'
|
||||||
compdef _git gl=git-pull
|
compdef _git gl=git-pull
|
||||||
alias gup='git fetch && git rebase'
|
alias gup='git fetch && git rebase'
|
||||||
compdef _git gup=git-fetch
|
compdef _git gup=git-fetch
|
||||||
alias gp='git push'
|
alias gp='git push'
|
||||||
compdef _git gp=git-push
|
compdef _git gp=git-push
|
||||||
gdv() { git-diff -w "$@" | view - }
|
gdv() { git diff -w "$@" | view - }
|
||||||
compdef _git gdv=git-diff
|
compdef _git gdv=git-diff
|
||||||
alias gc='git commit -v'
|
alias gc='git commit -v'
|
||||||
compdef _git gc=git-commit
|
compdef _git gc=git-commit
|
||||||
|
|
@ -41,6 +41,47 @@ function current_branch() {
|
||||||
echo ${ref#refs/heads/}
|
echo ${ref#refs/heads/}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function git-info() {
|
||||||
|
# author: Duane Johnson
|
||||||
|
# email: duane.johnson@gmail.com
|
||||||
|
# date: 2008 Jun 12
|
||||||
|
# license: MIT
|
||||||
|
#
|
||||||
|
# Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496
|
||||||
|
|
||||||
|
pushd . >/dev/null
|
||||||
|
|
||||||
|
# Find base of git directory
|
||||||
|
while [ ! -d .git ] && [ ! `pwd` = "/" ]; do cd ..; done
|
||||||
|
|
||||||
|
# Show various information about this git directory
|
||||||
|
if [ -d .git ]; then
|
||||||
|
echo "== Remote URL: `git remote -v`"
|
||||||
|
|
||||||
|
echo "== Remote Branches: "
|
||||||
|
git branch -r
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "== Local Branches:"
|
||||||
|
git branch
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "== Configuration (.git/config)"
|
||||||
|
cat .git/config
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "== Most Recent Commit"
|
||||||
|
git log --max-count=1
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "Type 'git log' for more commits, or 'git show' for full commit details."
|
||||||
|
else
|
||||||
|
echo "Not a git repository."
|
||||||
|
fi
|
||||||
|
|
||||||
|
popd >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
# these aliases take advantage of the previous function
|
# these aliases take advantage of the previous function
|
||||||
alias ggpull='git pull origin $(current_branch)'
|
alias ggpull='git pull origin $(current_branch)'
|
||||||
compdef ggpull=git
|
compdef ggpull=git
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,18 @@
|
||||||
|
alias scpan='sudo cpan'
|
||||||
|
|
||||||
|
# Find perl file
|
||||||
|
alias pfind='find . -name *.pl | xargs grep -n'
|
||||||
|
|
||||||
|
#Check syntax perl file
|
||||||
|
alias psc='perl -c'
|
||||||
|
|
||||||
|
#French perldoc
|
||||||
|
alias perldoc-fr="perldoc -L FR"
|
||||||
|
|
||||||
|
#Trace query SQL
|
||||||
|
export DBIC_TRACE=1
|
||||||
|
export DBI_TRACE=1
|
||||||
|
|
||||||
# https://github.com/dbbolton
|
# https://github.com/dbbolton
|
||||||
#
|
#
|
||||||
# Below are some useful Perl-related aliases/functions that I use with zsh.
|
# Below are some useful Perl-related aliases/functions that I use with zsh.
|
||||||
|
|
@ -29,22 +44,22 @@ alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/pe
|
||||||
|
|
||||||
# newpl - creates a basic Perl script file and opens it with $EDITOR
|
# newpl - creates a basic Perl script file and opens it with $EDITOR
|
||||||
newpl () {
|
newpl () {
|
||||||
# set $EDITOR to 'vim' if it is undefined
|
# set $EDITOR to 'vim' if it is undefined
|
||||||
[[ -z $EDITOR ]] && EDITOR=vim
|
[[ -z $EDITOR ]] && EDITOR=vim
|
||||||
|
|
||||||
# if the file exists, just open it
|
# if the file exists, just open it
|
||||||
[[ -e $1 ]] && print "$1 exists; not modifying.\n" && $EDITOR $1
|
[[ -e $1 ]] && print "$1 exists; not modifying.\n" && $EDITOR $1
|
||||||
|
|
||||||
# if it doesn't, make it, and open it
|
# if it doesn't, make it, and open it
|
||||||
[[ ! -e $1 ]] && print '#!/usr/bin/perl'"\n"'use strict;'"\n"'use warnings;'\
|
[[ ! -e $1 ]] && print '#!/usr/bin/perl'"\n"'use strict;'"\n"'use warnings;'\
|
||||||
"\n\n" > $1 && $EDITOR $1
|
"\n\n" > $1 && $EDITOR $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# pgs - Perl Global Substitution
|
# pgs - Perl Global Substitution
|
||||||
# find pattern = 1st arg
|
# find pattern = 1st arg
|
||||||
# replace pattern = 2nd arg
|
# replace pattern = 2nd arg
|
||||||
# filename = 3rd arg
|
# filename = 3rd arg
|
||||||
pgs() { # [find] [replace] [filename]
|
pgs() { # [find] [replace] [filename]
|
||||||
perl -i.orig -pe 's/'"$1"'/'"$2"'/g' "$3"
|
perl -i.orig -pe 's/'"$1"'/'"$2"'/g' "$3"
|
||||||
}
|
}
|
||||||
|
|
@ -59,4 +74,3 @@ prep() { # [pattern] [filename unless STDOUT]
|
||||||
say() {
|
say() {
|
||||||
print "$1\n"
|
print "$1\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
19
themes/mahewin.zsh-theme
Normal file
19
themes/mahewin.zsh-theme
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Author: Hobbestigrou
|
||||||
|
# Desc: Based on xiong-chiamiov-plus
|
||||||
|
# last_update: 14/10/2010
|
||||||
|
|
||||||
|
if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="white"; fi
|
||||||
|
|
||||||
|
PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
|
||||||
|
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(git_prompt_info)>%{\e[0m%}%b '
|
||||||
|
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '
|
||||||
|
|
||||||
|
# git theming
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[%{$fg_no_bold[yellow]%}%B"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%}]%{$reset_color%} "
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_no_bold[green]%}●"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_no_bold[red]%}●"
|
||||||
|
|
||||||
|
#ls colors
|
||||||
|
LS_COLORS='rs=0:di=01;37:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:';
|
||||||
|
export LS_COLORS
|
||||||
Loading…
Add table
Add a link
Reference in a new issue