0
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-19 04:01:21 +02:00

Merge pull request #3564 from mcornella/LFDM-cleaning_lib

Repost #2422: cleaning lib
This commit is contained in:
Robby Russell 2015-02-10 11:17:17 -08:00
commit ff823f810b
20 changed files with 56 additions and 106 deletions

View file

@ -1,35 +0,0 @@
# Push and pop directories on directory stack
alias pu='pushd'
alias po='popd'
# Basic directory operations
alias ...='cd ../..'
alias -- -='cd -'
# Super user
alias _='sudo'
alias please='sudo'
#alias g='grep -in'
# Show history
if [ "$HIST_STAMPS" = "mm/dd/yyyy" ]
then
alias history='fc -fl 1'
elif [ "$HIST_STAMPS" = "dd.mm.yyyy" ]
then
alias history='fc -El 1'
elif [ "$HIST_STAMPS" = "yyyy-mm-dd" ]
then
alias history='fc -il 1'
else
alias history='fc -l 1'
fi
# List direcory contents
alias lsa='ls -lah'
alias l='ls -lah'
alias ll='ls -lh'
alias la='ls -lAh'
alias afind='ack-grep -il'

View file

@ -3,12 +3,10 @@ setopt auto_pushd
setopt pushd_ignore_dups setopt pushd_ignore_dups
setopt pushdminus setopt pushdminus
alias ..='cd ..' alias -g ...='../..'
alias cd..='cd ..' alias -g ....='../../..'
alias cd...='cd ../..' alias -g .....='../../../..'
alias cd....='cd ../../..' alias -g ......='../../../../..'
alias cd.....='cd ../../../..'
alias cd/='cd /'
alias 1='cd -' alias 1='cd -'
alias 2='cd -2' alias 2='cd -2'
@ -20,23 +18,16 @@ alias 7='cd -7'
alias 8='cd -8' alias 8='cd -8'
alias 9='cd -9' 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 ../../../../..
elif [ -d ~/.autoenv ]; then
source ~/.autoenv/activate.sh
autoenv_cd "$@"
else
builtin cd "$@"
fi
}
alias md='mkdir -p' alias md='mkdir -p'
alias rd=rmdir alias rd=rmdir
alias d='dirs -v | head -10' alias d='dirs -v | head -10'
# List directory contents
alias lsa='ls -lah'
alias l='ls -la'
alias ll='ls -l'
alias la='ls -lA'
# Push and pop directories on directory stack
alias pu='pushd'
alias po='popd'

View file

@ -6,6 +6,15 @@ fi
HISTSIZE=10000 HISTSIZE=10000
SAVEHIST=10000 SAVEHIST=10000
# Show history
case $HIST_STAMPS in
"mm/dd/yyyy") alias history='fc -fl 1' ;;
"dd.mm.yyyy") alias history='fc -El 1' ;;
"yyyy-mm-dd") alias history='fc -il 1' ;;
*) alias history='fc -l 1' ;;
esac
setopt append_history
setopt extended_history setopt extended_history
setopt hist_expire_dups_first setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list setopt hist_ignore_dups # ignore duplication command history list

View file

@ -64,6 +64,9 @@ autoload -U edit-command-line
zle -N edit-command-line zle -N edit-command-line
bindkey '\C-x\C-e' edit-command-line bindkey '\C-x\C-e' edit-command-line
# file rename magick
bindkey "^[m" copy-prev-shell-word
# consider emacs keybindings: # consider emacs keybindings:
#bindkey -e ## emacs key bindings #bindkey -e ## emacs key bindings

View file

@ -2,9 +2,6 @@
autoload -U url-quote-magic autoload -U url-quote-magic
zle -N self-insert url-quote-magic zle -N self-insert url-quote-magic
## file rename magick
bindkey "^[m" copy-prev-shell-word
## jobs ## jobs
setopt long_list_jobs setopt long_list_jobs
@ -13,3 +10,10 @@ export PAGER="less"
export LESS="-R" export LESS="-R"
export LC_CTYPE=$LANG export LC_CTYPE=$LANG
## super user alias
alias _='sudo'
alias please='sudo'
## more intelligent acking for ubuntu users
alias afind='ack-grep -il'

View file

@ -1,7 +1,6 @@
# ls colors # ls colors
autoload colors; colors; autoload -U colors && colors
export LSCOLORS="Gxfxcxdxbxegedabagacad" export LSCOLORS="Gxfxcxdxbxegedabagacad"
#export LS_COLORS
# Enable ls colors # Enable ls colors
if [ "$DISABLE_LS_COLORS" != "true" ] if [ "$DISABLE_LS_COLORS" != "true" ]
@ -23,7 +22,7 @@ fi
#setopt no_beep #setopt no_beep
setopt auto_cd setopt auto_cd
setopt multios setopt multios
setopt cdablevarS setopt cdablevars
if [[ x$WINDOW != x ]] if [[ x$WINDOW != x ]]
then then
@ -43,4 +42,3 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is c
# Setup the prompt with pretty colors # Setup the prompt with pretty colors
setopt prompt_subst setopt prompt_subst

View file

@ -1,6 +1,17 @@
# Activates autoenv or reports its failure
if ! source $HOME/.autoenv/activate.sh 2>/dev/null; then
echo '-------- AUTOENV ---------'
echo 'Could not find ~/.autoenv/activate.sh.'
echo 'Please check if autoenv is correctly installed.'
echo 'In the meantime the autoenv plugin is DISABLED.'
echo '--------------------------'
return 1
fi
# The use_env call below is a reusable command to activate/create a new Python # The use_env call below is a reusable command to activate/create a new Python
# virtualenv, requiring only a single declarative line of code in your .env files. # virtualenv, requiring only a single declarative line of code in your .env files.
# It only performs an action if the requested virtualenv is not the current one. # It only performs an action if the requested virtualenv is not the current one.
use_env() { use_env() {
typeset venv typeset venv
venv="$1" venv="$1"

View file

@ -20,12 +20,6 @@ alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
alias t='tail -f' alias t='tail -f'
# because typing 'cd' is A LOT of work!!
alias ..='cd ../'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
# Command line head / tail shortcuts # Command line head / tail shortcuts
alias -g H='| head' alias -g H='| head'
alias -g T='| tail' alias -g T='| tail'

View file

@ -2,9 +2,6 @@
# http://github.com/olivierverdier/zsh-git-prompt # http://github.com/olivierverdier/zsh-git-prompt
# #
export __GIT_PROMPT_DIR=$ZSH/plugins/git-prompt export __GIT_PROMPT_DIR=$ZSH/plugins/git-prompt
# Initialize colors.
autoload -U colors
colors
# Allow for functions in the prompt. # Allow for functions in the prompt.
setopt PROMPT_SUBST setopt PROMPT_SUBST

View file

@ -27,7 +27,6 @@ unmark() {
rm -i "$MARKPATH/$1" rm -i "$MARKPATH/$1"
} }
autoload colors
marks() { marks() {
for link in $MARKPATH/*(@); do for link in $MARKPATH/*(@); do
local markname="$fg[cyan]${link:t}$reset_color" local markname="$fg[cyan]${link:t}$reset_color"

View file

@ -99,10 +99,7 @@ prompt_context () {
set_prompt () { set_prompt () {
# required for the prompt # required for the prompt
setopt prompt_subst setopt prompt_subst
autoload colors zsh/terminfo autoload zsh/terminfo
if [[ "$terminfo[colors]" -gt 8 ]]; then
colors
fi
# ######### PROMPT ######### # ######### PROMPT #########
PROMPT='${PROMPT_HEAD} PROMPT='${PROMPT_HEAD}

View file

@ -7,7 +7,6 @@ get_git_dirty() {
} }
autoload -Uz vcs_info autoload -Uz vcs_info
autoload -U colors && colors
zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes
zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes

View file

@ -2,8 +2,7 @@
# Based on bira theme # Based on bira theme
# load some modules # load some modules
autoload -U colors zsh/terminfo # Used in the colour alias below autoload -U zsh/terminfo # Used in the colour alias below
colors
setopt prompt_subst setopt prompt_subst
# make some aliases for the colours: (could use normal escape sequences too) # make some aliases for the colours: (could use normal escape sequences too)

View file

@ -13,8 +13,6 @@ function virtualenv_info {
PR_GIT_UPDATE=1 PR_GIT_UPDATE=1
setopt prompt_subst setopt prompt_subst
autoload colors
colors
autoload -U add-zsh-hook autoload -U add-zsh-hook
autoload -Uz vcs_info autoload -Uz vcs_info

View file

@ -44,10 +44,7 @@ setprompt () {
### ###
# See if we can use colors. # See if we can use colors.
autoload colors zsh/terminfo autoload zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}' eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'

View file

@ -1,5 +1,3 @@
autoload -U colors && colors
autoload -Uz vcs_info autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}●' zstyle ':vcs_info:*' stagedstr '%F{green}●'

View file

@ -1,6 +1,4 @@
setopt prompt_subst setopt prompt_subst
autoload colors
colors
autoload -U add-zsh-hook autoload -U add-zsh-hook
autoload -Uz vcs_info autoload -Uz vcs_info

View file

@ -63,10 +63,7 @@ setprompt () {
### ###
# See if we can use colors. # See if we can use colors.
autoload colors zsh/terminfo autoload zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}' eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'

View file

@ -15,8 +15,6 @@ function virtualenv_info {
PR_GIT_UPDATE=1 PR_GIT_UPDATE=1
setopt prompt_subst setopt prompt_subst
autoload colors
colors
autoload -U add-zsh-hook autoload -U add-zsh-hook
autoload -Uz vcs_info autoload -Uz vcs_info

View file

@ -1,5 +1,3 @@
autoload -U colors && colors
autoload -Uz vcs_info autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}●' zstyle ':vcs_info:*' stagedstr '%F{green}●'