david/myzsh
david
/
myzsh
Archived
1
0
Fork 0

using default oh-my-zsh config files

This commit is contained in:
david 2013-01-18 11:21:28 +01:00
parent 6191399f9d
commit 4cb1afcfab
4 changed files with 80 additions and 16 deletions

View File

@ -1,21 +1,26 @@
# directory operations
alias ..='cd ..'
# Push and pop directories on directory stack
alias pu='pushd'
alias po='popd'
# Basic directory operations
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias -- -='cd -'
alias md='mkdir -p'
alias rd='rm -r'
# directory listings
alias ll='ls -l'
alias la='ls -la'
alias lh='ls -lh'
alias sl='ls'
# super user
# Super user
alias _='sudo'
alias please='sudo'
# show history
alias history='fc -ln 1'
#alias g='grep -in'
# Show history
alias history='fc -l 1'
# List direcory contents
alias lsa='ls -lah'
alias l='ls -lA1'
alias ll='ls -l'
alias la='ls -lA'
alias sl=ls # often screw this up
alias afind='ack-grep -il'

39
core/directories.zsh Normal file
View File

@ -0,0 +1,39 @@
# Changing/making/removing directory
setopt auto_name_dirs
setopt auto_pushd
setopt pushd_ignore_dups
alias ..='cd ..'
alias cd..='cd ..'
alias cd...='cd ../..'
alias cd....='cd ../../..'
alias cd.....='cd ../../../..'
alias cd/='cd /'
alias 1='cd -'
alias 2='cd +2'
alias 3='cd +3'
alias 4='cd +4'
alias 5='cd +5'
alias 6='cd +6'
alias 7='cd +7'
alias 8='cd +8'
alias 9='cd +9'
cd () {
if [[ "x$*" == "x..." ]]; then
cd ../..
elif [[ "x$*" == "x...." ]]; then
cd ../../..
elif [[ "x$*" == "x....." ]]; then
cd ../../../..
elif [[ "x$*" == "x......" ]]; then
cd ../../../../..
else
builtin cd "$@"
fi
}
alias md='mkdir -p'
alias rd=rmdir
alias d='dirs -v | head -10'

View File

@ -0,0 +1,3 @@
autoload -U edit-command-line
zle -N edit-command-line
bindkey '\C-x\C-e' edit-command-line

17
core/functions.zsh Normal file
View File

@ -0,0 +1,17 @@
function zsh_stats() {
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
}
function uninstall_oh_my_zsh() {
/usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
}
function upgrade_oh_my_zsh() {
/usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
}
function take() {
mkdir -p $1
cd $1
}