parent
fa0112b98e
commit
494ad7dcd9
@ -1,13 +1,14 @@
|
||||
## Command history configuration
|
||||
HISTFILE=$HOME/.zsh_history
|
||||
HISTFILE="$HOME/.zsh_history"
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
|
||||
setopt HIST_VERIFY
|
||||
setopt HIST_EXPIRE_DUPS_FIRST
|
||||
setopt HIST_IGNORE_SPACE
|
||||
setopt HIST_IGNORE_DUPS
|
||||
setopt SHARE_HISTORY
|
||||
setopt APPEND_HISTORY
|
||||
setopt EXTENDED_HISTORY
|
||||
setopt INC_APPEND_HISTORY
|
||||
setopt hist_verify
|
||||
setopt hist_expire_dups_first
|
||||
setopt hist_ignore_space
|
||||
setopt hist_ignore_dups
|
||||
setopt share_history
|
||||
setopt append_history
|
||||
setopt extended_history
|
||||
setopt inc_append_history
|
||||
|
||||
|
@ -1,13 +1,17 @@
|
||||
## smart urls
|
||||
# Smart URLs
|
||||
autoload -U 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
|
||||
|
||||
## pager
|
||||
[[ -z "$PAGER" ]] && export PAGER=less
|
||||
[[ -z "$LC_CTYPE" ]] && export LC_CTYPE=en_US.UTF-8
|
||||
# Pager
|
||||
if [[ -z "$PAGER" ]]; then
|
||||
export PAGER=less
|
||||
fi
|
||||
|
||||
# Localization
|
||||
if [[ -z "$LC_CTYPE" ]]; then
|
||||
export LC_CTYPE=en_US.UTF-8
|
||||
fi
|
||||
|
||||
|
@ -1,31 +1,40 @@
|
||||
[[ "$TERM" == "dumb" ]] && return
|
||||
# Dumb terminals lack support.
|
||||
if [[ "$TERM" == 'dumb' ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
|
||||
#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
|
||||
#Fully support screen, iterm, and probably most modern xterm and rxvt
|
||||
#Limited support for Apple Terminal (Terminal can't set window or tab separately)
|
||||
# Fully supports GNU Screen, iTerm, and most modern xterm and rxvt terminals.
|
||||
# Partially supports Mac OS X Terminal since it can't set window and tab separately.
|
||||
# Usage: title "tab title" "window title"
|
||||
function title {
|
||||
[ "$DISABLE_AUTO_TITLE" != "true" ] || return
|
||||
if [[ "$TERM" == screen* ]]; then
|
||||
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
|
||||
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)
|
||||
if [[ "$DISABLE_AUTO_TITLE" != 'true' ]]; then
|
||||
if [[ "$TERM" == screen* ]]; then
|
||||
# Set GNU Screen's hardstatus (usually truncated at 20 characters).
|
||||
print -Pn "\ek$1:q\e\\"
|
||||
elif [[ "$TERM" == xterm* ]] || [[ "$TERM" == rxvt* ]]; then
|
||||
# Set the window title.
|
||||
print -Pn "\e]2;$2:q\a"
|
||||
# Set the tab title (will override window title on a broken terminal).
|
||||
print -Pn "\e]1;$1:q\a"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
|
||||
# 15 character, left-truncated current working directory.
|
||||
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<"
|
||||
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
|
||||
|
||||
#Appears when you have the prompt
|
||||
# Set the tab and window titles before the prompt is displayed.
|
||||
function precmd {
|
||||
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
|
||||
title "$ZSH_THEME_TERM_TAB_TITLE_IDLE" "$ZSH_THEME_TERM_TITLE_IDLE"
|
||||
}
|
||||
|
||||
#Appears at the beginning of (and during) of command execution
|
||||
# Set the tab and window titles before command execution.
|
||||
function preexec {
|
||||
emulate -L zsh
|
||||
setopt extended_glob
|
||||
local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
|
||||
# Command name only, or if this is sudo or ssh, the next command.
|
||||
local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]}
|
||||
title "$CMD" "%100>...>$2%<<"
|
||||
}
|
||||
|
||||
|
@ -1,35 +1,23 @@
|
||||
# ls colors
|
||||
autoload colors; colors;
|
||||
[[ -z "$LSCOLORS" ]] && export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||
# Load and run colors.
|
||||
autoload -U colors
|
||||
colors -i
|
||||
|
||||
# Enable ls colors
|
||||
if [ "$DISABLE_COLOR" != "true" ]
|
||||
then
|
||||
# Find the option for using colors in ls, depending on the version: Linux or BSD
|
||||
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
|
||||
fi
|
||||
|
||||
#setopt no_beep
|
||||
setopt auto_cd
|
||||
setopt multios
|
||||
setopt cdablevarS
|
||||
|
||||
if [[ x$WINDOW != x ]]
|
||||
then
|
||||
SCREEN_NO="%B$WINDOW%b "
|
||||
# Set the GNU Screen window number.
|
||||
if [[ -n "$WINDOW" ]]; then
|
||||
SCREEN_NO="%B$WINDOW%b "
|
||||
else
|
||||
SCREEN_NO=""
|
||||
SCREEN_NO=""
|
||||
fi
|
||||
|
||||
# Apply theming defaults
|
||||
# Set the default prompt theme.
|
||||
PS1="%n@%m:%~%# "
|
||||
|
||||
# git theming default: Variables for theming the git info prompt
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
|
||||
# Set the default Git prompt theme.
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix before the branch name.
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # Suffix after the branch name.
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Indicator to display if the branch is dirty.
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="" # Indicator to display if the branch is clean.
|
||||
|
||||
# Setup the prompt with pretty colors
|
||||
# Enable parameter, arithmentic expansion and command substitution in prompt.
|
||||
setopt prompt_subst
|
||||
|
||||
|
@ -1,25 +1,24 @@
|
||||
# Path to your oh-my-zsh configuration.
|
||||
export ZSH=$HOME/.oh-my-zsh
|
||||
# Path to oh-my-zsh.
|
||||
export ZSH="$HOME/.oh-my-zsh"
|
||||
|
||||
# Set name of the theme to load.
|
||||
# Look in ~/.oh-my-zsh/themes/
|
||||
# Optionally, if you set this to "random", it'll load a random theme each
|
||||
# time that oh-my-zsh is loaded.
|
||||
# Set the name of the theme to load (see $ZSH/themes/).
|
||||
# Setting it to 'random' loads a random theme.
|
||||
export ZSH_THEME="robbyrussell"
|
||||
|
||||
# Set to this to use case-sensitive completion
|
||||
# export CASE_SENSITIVE="true"
|
||||
# Set to 'true' to enable case-sensitivity.
|
||||
export CASE_SENSITIVE='false'
|
||||
|
||||
# Uncomment following line if you want to disable colors in ls
|
||||
# export DISABLE_COLOR="true"
|
||||
# Set to 'true' to disable color (auto set on dumb terminals).
|
||||
export DISABLE_COLOR='false'
|
||||
|
||||
# Uncomment following line if you want to disable autosetting terminal title.
|
||||
# export DISABLE_AUTO_TITLE="true"
|
||||
# Set to 'true' to disable auto setting the tab and window titles.
|
||||
export DISABLE_AUTO_TITLE='false'
|
||||
|
||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
# Set the plugins to load (see $ZSH/plugins/).
|
||||
# Example: plugins=(rails git textmate ruby lighthouse)
|
||||
plugins=(git)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
source "$ZSH/oh-my-zsh.sh"
|
||||
|
||||
# Customize to your needs...
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
# Evan describes this sexy prompt as: "a skinny, topless prompt"
|
||||
PROMPT='%m :: %2~ %B»%b '
|
||||
PROMPT='%m :: %2~ %B»%b '
|
||||
|
Loading…
Reference in new issue