dizel_by: (Default)
dizel_by ([personal profile] dizel_by) wrote2010-10-03 02:14 am
Entry tags:

(no subject)

Френды, а вы уже перешли на zsh? Нет? А почему? О_о

[identity profile] theiced.livejournal.com 2010-10-03 12:08 am (UTC)(link)

if [ -e /etc/profile.env ] ; then
	. /etc/profile.env
fi

export EDITOR=/usr/bin/vim
export PAGER=/usr/bin/less

umask 022

if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
	PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
else
	PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
fi
export PATH
unset ROOTPATH

shopts=$-
setopt nullglob
for sh in /etc/profile.d/*.sh ; do
	[ -r "$sh" ] && . "$sh"
done
unsetopt nullglob
set -$shopts
unset sh shopts

autoload -U compinit
compinit

if [[ "$TERM" != "emacs" && "$TERM" != "dumb" ]]; then
	autoload -U promptinit
	promptinit
	prompt gentoo
fi

if [[ "$TERM" != "emacs" && "$TERM" != "dumb" ]]; then
	alias ls="ls --color=auto"
fi

HISTFILE=~/.zhistory
SAVEHIST=1000
HISTSIZE=1000
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_NO_FUNCTIONS
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_IGNORE_SPACE

if [[ "$TERM" != "emacs" && "$TERM" != "dumb" ]]; then
	bindkey -e
	[[ -z "$terminfo[kdch1]" ]] || bindkey -M emacs "$terminfo[kdch1]" delete-char
	[[ -z "$terminfo[khome]" ]] || bindkey -M emacs "$terminfo[khome]" beginning-of-line
	[[ -z "$terminfo[kend]"  ]] || bindkey -M emacs "$terminfo[kend]"  end-of-line
	[[ -z "$terminfo[kich1]" ]] || bindkey -M emacs "$terminfo[kich1]" overwrite-mode
fi

function title {
	if [[ $TERM == "xterm" ]]; then
		print -nR $'\033]0;'$*$'\a'
	fi
}

function precmd {
	title "$PWD"
}

function preexec {
	emulate -L zsh
	local -a cmd; cmd=(${(z)1})
	title $cmd[1]:t "$cmd[2,-1]"
}