diff options
-rw-r--r-- | _profile | 67 | ||||
-rw-r--r-- | _xprofile | 2 | ||||
-rw-r--r-- | _zlogout | 11 | ||||
-rw-r--r-- | _zprofile | 16 | ||||
-rw-r--r-- | _zshrc | 34 | ||||
-rw-r--r-- | _zshrc.local | 8 |
6 files changed, 87 insertions, 51 deletions
@@ -1,19 +1,39 @@ -# ~/.profile: executed by the command interpreter for login shells. -# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login -# exists. -# see /usr/share/doc/bash/examples/startup-files for examples. -# the files are located in the bash-doc package. +# +# ~/.profile +# executed by the command interpreter for login shells. +# +# Aaron LI +# Updated: 2016-01-26 +# + # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. #umask 022 -###### locale ###### + +### PATH +# ~/bin +if [ -d "$HOME/bin" ]; then + export PATH="$HOME/bin:$PATH" +fi +# local installed (python) packages +if [ -d "$HOME/.local/bin" ]; then + export PATH="$PATH:$HOME/.local/bin" +fi +# admin +if groups | grep -qE '\b(wheel|adm|sudo)\b'; then + export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" +fi + + +### Locale export LANG="en_US.UTF-8" export LC_CTYPE="zh_CN.UTF-8" export LC_COLLATE="C" -###### input method ###### + +### Input method: fcitx export XMODIFIERS="@im=fcitx" export INPUT_METHOD="fcitx" export GTK_IM_MODULE="fcitx" @@ -22,35 +42,24 @@ export QT_IM_MODULE="fcitx" export QT4_IM_MODULE="fcitx" -###### PATH ###### -# admin -if groups | grep -qE '\b(wheel|adm|sudo)\b'; then - export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" -fi -# $HOME/bin -if [ -d "$HOME/bin" ]; then - export PATH="$HOME/bin:$PATH" -fi -# npm -if [ -d "$HOME/npm/bin" ]; then - export PATH="$PATH:$HOME/npm/bin" +### LS colors +if which dircolors >/dev/null 2>&1; then + eval `dircolors -b` fi -###### Xmodmap ###### -[ -f ~/.Xmodmap ] && xmodmap ~/.Xmodmap +### Xmodmap +#[ -f ~/.Xmodmap ] && xmodmap ~/.Xmodmap -###### ConTeXt ###### +### ConTeXt fonts export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts" -###### bash ###### -if [ -n "$BASH_VERSION" ]; then - # include .bashrc if it exists - if [ -f "$HOME/.bashrc" ]; then - . "$HOME/.bashrc" - fi -fi +### Xapian +# CJK support: set this before notmuch/mu indexing +# Required for correct CJK index and search +export XAPIAN_CJK_NGRAM=1 + # vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # @@ -4,4 +4,4 @@ [ -f ~/.profile ] && . ~/.profile -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/_zlogout b/_zlogout new file mode 100644 index 0000000..d6f7e3a --- /dev/null +++ b/_zlogout @@ -0,0 +1,11 @@ +# +# ~/.zlogout +# executed when a login zsh shell exits +# + +# clear console +if which tput >/dev/null 2>&1; then + tput clear +fi + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: # diff --git a/_zprofile b/_zprofile new file mode 100644 index 0000000..4c531d8 --- /dev/null +++ b/_zprofile @@ -0,0 +1,16 @@ +# +# ~/.zprofile +# sourced only by login zsh shell +# +# Credit: +# * Zsh not hitting ~/.profile +# https://superuser.com/a/187673 +# +# Aaron LI +# Created: 2016-01-26 +# Updated: 2016-01-26 +# + +[ -f ~/.profile ] && emulate sh -c '. ~/.profile' + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: # @@ -1,6 +1,14 @@ +## ## ~/.zshrc -## ZSH configuration file +## Zsh configuration file ## oh-my-zsh: http://ohmyz.sh/ +## +## Zsh reads this file in all interactive shells, whether they are +## login shells or not. +## +## Aaron LI +## Updated: 2016-01-26 +## # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh @@ -12,10 +20,6 @@ export ZSH=$HOME/.oh-my-zsh #ZSH_THEME="robbyrussell" ZSH_THEME="gentoo" -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" - # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" @@ -58,29 +62,23 @@ plugins=(fasd git tmux vi-mode) source $ZSH/oh-my-zsh.sh -# User configuration -#export PATH="$HOME/bin:/usr/local/texlive/bin/x86_64-linux:/usr/lib64/mpi/gcc/openmpi/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/local/sbin:/usr/sbin:/sbin" -# export MANPATH="/usr/local/man:$MANPATH" +### aliases +alias e='emacs' +alias v='vim' -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 -# Preferred editor for local and remote sessions -if [[ -n $SSH_CONNECTION ]]; then +### Preferred editor for local and remote sessions +if [ -n $SSH_CONNECTION ]; then export EDITOR='vim' else export EDITOR='vim' fi -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# ssh -# export SSH_KEY_PATH="~/.ssh/dsa_id" -# zsh local config +### Local configurations if [ -r ~/.zshrc.local ]; then source ~/.zshrc.local fi +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: # diff --git a/_zshrc.local b/_zshrc.local index 9e5d50d..6459c22 100644 --- a/_zshrc.local +++ b/_zshrc.local @@ -14,14 +14,16 @@ export LC_COLLATE="C" if [ -d "$HOME/bin" ]; then export PATH="$HOME/bin:$PATH" fi +if [ -d "$HOME/.local/bin" ]; then + export PATH="$HOME/.local/bin:$PATH" +fi # admin if groups | grep -qE '\b(wheel|adm|sudo)\b'; then export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" fi -# GREP_OPTIONS deprecated -unset GREP_OPTIONS -alias grep='grep --color=auto' +# ls colors +[ -x /usr/bin/dircolors ] && eval `dircolors -b` ### environments }}} ### vi mode {{{ |