parent
db6c172e9f
commit
1e9b718af1
@ -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 [[ "$DISABLE_AUTO_TITLE" != 'true' ]]; then
|
||||
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)
|
||||
# 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
|
||||
# Set the GNU Screen window number.
|
||||
if [[ -n "$WINDOW" ]]; then
|
||||
SCREEN_NO="%B$WINDOW%b "
|
||||
else
|
||||
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,45 +1,45 @@
|
||||
# Initializes Oh My Zsh
|
||||
# Initializes OH MY ZSH.
|
||||
|
||||
# Disable colors on dumb terminals
|
||||
if [ "$TERM" = "dumb" ]; then
|
||||
DISABLE_COLOR="true"
|
||||
# Disable color in dumb terminals.
|
||||
if [[ "$TERM" == 'dumb' ]]; then
|
||||
DISABLE_COLOR='true'
|
||||
fi
|
||||
|
||||
# Load all of the config files in ~/oh-my-zsh that end in .zsh
|
||||
# TIP: Add files you don't want in git to .gitignore
|
||||
for config_file ($ZSH/lib/*.zsh) source $config_file
|
||||
# Load all files in $ZSH/oh-my-zsh/lib/ that end in .zsh.
|
||||
for config_file in $ZSH/lib/*.zsh; do
|
||||
source "$config_file"
|
||||
done
|
||||
|
||||
# Add all defined plugins to fpath
|
||||
# Add all defined plugins to fpath.
|
||||
plugin=${plugin:=()}
|
||||
for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
|
||||
for plugin in $plugins; do
|
||||
fpath=($ZSH/plugins/$plugin $fpath)
|
||||
done
|
||||
|
||||
# Load and run compinit
|
||||
# Load and run compinit.
|
||||
autoload -U compinit
|
||||
compinit -i
|
||||
|
||||
# Load all of the plugins that were defined in ~/.zshrc
|
||||
for plugin ($plugins); do
|
||||
if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
|
||||
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
|
||||
# Load all plugins defined in ~/.zshrc.
|
||||
for plugin in $plugins; do
|
||||
if [[ -f "$ZSH/plugins/$plugin/$plugin.plugin.zsh" ]]; then
|
||||
source "$ZSH/plugins/$plugin/$plugin.plugin.zsh"
|
||||
fi
|
||||
done
|
||||
|
||||
# Load the theme
|
||||
# Check for updates on initial load...
|
||||
if [ "$ZSH_THEME" = "random" ]
|
||||
then
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
N=${#themes[@]}
|
||||
((N=(RANDOM%N)+1))
|
||||
RANDOM_THEME=${themes[$N]}
|
||||
source "$RANDOM_THEME"
|
||||
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
|
||||
# Load the theme.
|
||||
if [[ "$ZSH_THEME" == "random" ]]; then
|
||||
themes=($ZSH/themes/*.zsh-theme)
|
||||
theme_index=${#themes[@]}
|
||||
(( theme_index=((RANDOM % theme_index) + 1) ))
|
||||
random_theme="${themes[$theme_index]}"
|
||||
source "$random_theme"
|
||||
else
|
||||
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
|
||||
fi
|
||||
|
||||
# Compile zcompdump, if modified, to increase startup speed.
|
||||
if [ "$HOME/.zcompdump" -nt "$HOME/.zcompdump.zwc" -o ! -e "$HOME/.zcompdump.zwc" ]; then
|
||||
if [[ "$HOME/.zcompdump" -nt "$HOME/.zcompdump.zwc" ]] || [[ ! -e "$HOME/.zcompdump.zwc" ]]; then
|
||||
zcompile "$HOME/.zcompdump"
|
||||
fi
|
||||
|
||||
|
@ -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...
|
||||
|
||||
|
Loading…
Reference in new issue