Skip to content

Latest commit

 

History

History
1229 lines (1012 loc) · 36.6 KB

home.org

File metadata and controls

1229 lines (1012 loc) · 36.6 KB

Installation

This section is not automatically run when exporting.

Mac

The following deps will be installed (mostly with brew): wget, emacs, git, oh-my-zsh, rbenv, ruby-build, irssi, mutt, offlineimap, ruby, tmux, keybase, ghc and stack.

Will also use brew cask to install the following: iterm2, quicksilver, 1password, dropbox, shiftit, bartender, devonthink-pro-office, racket, zotero standalone.

Brew may ask you to install Xcode command line tools first.

PATH=/usr/local/bin:$PATH
mkdir homebrew && curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C homebrew
brew update
brew install wget bash ag emacs notmuch git graphviz irssi gpg2 links mutt offline-imap tmux keybase mpw shadowsocks-libev
brew install duplicity
brew install ghc haskell-stack
brew tap homebrew/python
brew install matplotlib matplotlib/basemap
echo "/usr/local/bin/bash" | sudo tee -a /etc/shells
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
~/.rbenv/plugins/ruby-build/bin/rbenv-install 2.3.0
cabal update
cabal install cabal
brew tap caskroom/cask
brew cask install calibre flux firefox iterm2 karabiner keka quicksilver caffeine gpgtools dropbox shiftit squirrel devonthink-pro-office qgis racket scrivener transmission zotero
brew cask install shadowsocksx

Docker used to be difficult and cumbersome to install on OS X, thanks to &yet, there is now a simpler solution for using docker on my machine.

wget https://github.com/nlf/dlite/releases/download/1.1.1/dlite -o /usr/local/bin/dlite
sudo dlite install

Start the Dlite service:

launchctl start local.dlite

Then just install docker with Homebrew:

brew install docker

Language-dependence installations

Node:

brew install node npm
npm install npm -g

Python:

brew install python3

Haskell:

brew install ghc

Emacs

Install emacs init file and my settings (itself an Org file) to .emacs.d:

unlink $HOME/.emacs.d/init.el
unlink $HOME/.emacs.d/Haoyang.org
unlink $HOME/.emacs.d/snippets
unlink $HOME/.emacs.d/eshell/profile
ln -s $PWD/init.el $HOME/.emacs.d/init.el
ln -s $PWD/Haoyang.org $HOME/.emacs.d/Haoyang.org
ln -s $PWD/snippets $HOME/.emacs.d/snippets
ln -s $PWD/eshell/rc $HOME/.emacs.d/eshell/profile

Git

For now, I only store some configs of Git on the system.

User information

They can be set with git config --global user.name and git config --global user.email, respectively.

We can also specify what public key is used to sign the commits: git config --global user.signingkey

[user]
        name = Haoyang Xu
        email = [email protected]
	    signingkey = F99C109A

Core configs

[core]
        excludesfile = $HOME/.gitignore_global
        autocrlf = input

diff and merge tools

  • TODO Use meld and other tools to replace these.
[difftool "sourcetree"]
        cmd = opendiff \"$LOCAL\" \"$REMOTE\"
        path = 
[mergetool "sourcetree"]
        cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
        trustExitCode = true

Push settings

With push.default set to simple, git push will fail if the current local branch is not tracking a remote branch, even if remote has a branch with the same name. This seems to be the safest option. Other possible values are:

  • upstream: push the local branch to its upstream branch.
  • current: push the local branch to a branch of the same name.
[push]
        default = simple

Saving credentials

Under OS X, credentials are stored in system keychain.

[credential]
        helper = osxkeychain

Sign commits with GnuPG

This is set through git config --global commit.gpgsign.

[commit]
        gpgsign = true

Rime

Rime is the shared name of a series of input methods developed by Fo Zhen. Its configuration files are in yaml format. Users can save their settings in “patch” yaml files.

Some general settings:

patch:
  style:
    color_scheme: clean_white
    horizontal: true
  app_options:
    org.gnu.Emacs:
       ascii_mode: true

Use 小鹤双拼

patch:
  schema_list:
    - schema: double_pinyin_flypy

Irssi

Preparation: create dir for irssi config files.

mkdir ~/.irssi

Config

servers = (
  { 
    address = "irc.freenode.org";
    chatnet = "FreeNode";
    port = "6667";
  },
  { 
    address = "irc.undernet.org";
    chatnet = "Undernet";
    port = "6667";
  }
);

chatnets = {
  FreeNode = { type = "IRC"; max_kicks = "1"; };
  Undernet = {
    type = "IRC";
    max_kicks = "1";
    max_msgs = "3";
    max_whois = "30";
  };
  SILC = { type = "SILC"; };
};

channels = (
  { name = "#irssi"; chatnet = "ircnet"; autojoin = "No"; },
  { name = "silc"; chatnet = "silc"; autojoin = "No"; },
  {
    name = "#emacs";
    chatnet = "freenode";
    autojoin = "Yes";
    autosendcmd = "/msg NickServ identify; /oper";
  }
    );

aliases = {
  J = "join";
  WJOIN = "join -window";
  WQUERY = "query -window";
  LEAVE = "part";
  BYE = "quit";
  EXIT = "quit";
  SIGNOFF = "quit";
  DESCRIBE = "action";
  DATE = "time";
  HOST = "userhost";
  LAST = "lastlog";
  SAY = "msg *";
  WI = "whois";
  WII = "whois $0 $0";
  WW = "whowas";
  W = "who";
  N = "names";
  M = "msg";
  T = "topic";
  C = "clear";
  CL = "clear";
  K = "kick";
  KB = "kickban";
  KN = "knockout";
  BANS = "ban";
  B = "ban";
  MUB = "unban *";
  UB = "unban";
  IG = "ignore";
  UNIG = "unignore";
  SB = "scrollback";
  UMODE = "mode $N";
  WC = "window close";
  WN = "window new hide";
  SV = "say Irssi $J ($V) - http://irssi.org/";
  GOTO = "sb goto";
  CHAT = "dcc chat";
  RUN = "SCRIPT LOAD";
  CALC = "exec - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi";
  SBAR = "STATUSBAR";
  INVITELIST = "mode $C +I";
  Q = "QUERY";
  "MANUAL-WINDOWS" = "set use_status_window off;set autocreate_windows off;set autocreate_query_level none;set autoclose_windows off;set reuse_unused_windows on;save";
  EXEMPTLIST = "mode $C +e";
  ATAG = "WINDOW SERVER";
  UNSET = "set -clear";
  RESET = "set -default";
};

statusbar = {
  # formats:
  # when using {templates}, the template is shown only if it's argument isn't
  # empty unless no argument is given. for example {sb} is printed always,
  # but {sb $T} is printed only if $T isn't empty.

  items = {
    # start/end text in statusbars
    barstart = "{sbstart}";
    barend = "{sbend}";

    topicbarstart = "{topicsbstart}";
    topicbarend = "{topicsbend}";

    # treated "normally", you could change the time/user name to whatever
    time = "{sb $Z}";
    user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}";

    # treated specially .. window is printed with non-empty windows,
    # window_empty is printed with empty windows
    window = "{sb $winref:$tag/$itemname{sbmode $M}}";
    window_empty = "{sb $winref{sbservertag $tag}}";
    prompt = "{prompt $[.15]itemname}";
    prompt_empty = "{prompt $winname}";
    topic = " $topic";
    topic_empty = " Irssi v$J - http://www.irssi.org";

    # all of these treated specially, they're only displayed when needed
    lag = "{sb Lag: $0-}";
    act = "{sb Act: $0-}";
    more = "-- more --";
  };

  # there's two type of statusbars. root statusbars are either at the top
  # of the screen or at the bottom of the screen. window statusbars are at
  # the top/bottom of each split window in screen.
  default = {
    # the "default statusbar" to be displayed at the bottom of the window.
    # contains all the normal items.
    window = {
      disabled = "no";

      # window, root
      type = "window";
      # top, bottom
      placement = "bottom";
      # number
      position = "1";
      # active, inactive, always
      visible = "active";

      # list of items in statusbar in the display order
      items = {
        barstart = { priority = "100"; };
        time = { };
        user = { };
        window = { };
        window_empty = { };
        lag = { priority = "-1"; };
        act = { priority = "10"; };
        more = { priority = "-1"; alignment = "right"; };
        barend = { priority = "100"; alignment = "right"; };
      };
    };

    # statusbar to use in inactive split windows
    window_inact = {
      type = "window";
      placement = "bottom";
      position = "1";
      visible = "inactive";
      items = {
        barstart = { priority = "100"; };
        window = { };
        window_empty = { };
        more = { priority = "-1"; alignment = "right"; };
        barend = { priority = "100"; alignment = "right"; };
      };
    };

    # we treat input line as yet another statusbar :) It's possible to
    # add other items before or after the input line item.
    prompt = {
      type = "root";
      placement = "bottom";
      # we want to be at the bottom always
      position = "100";
      visible = "always";
      items = {
        prompt = { priority = "-1"; };
        prompt_empty = { priority = "-1"; };
        # treated specially, this is the real input line.
        input = { priority = "10"; };
      };
    };

    # topicbar
    topic = {
      type = "root";
      placement = "top";
      position = "1";
      visible = "always";
      items = {
        topicbarstart = { priority = "100"; };
        topic = { };
        topic_empty = { };
        topicbarend = { priority = "100"; alignment = "right"; };
      };
    };
  };
};
settings = {
  core = {
    real_name = "Xu Haoyang";
    user_name = "snakehsu";
    nick = "snakehsu";
  };
  "fe-text" = { actlist_sort = "refnum"; };
  "fe-common/core" = {
    theme = "syntax";
    autolog = "yes";
    autolog_path = "/Users/snakehsu/Library/Logs/irclogs/$tag/$0.log";
  };
};
logs = { };
theme = "agon";

Theme

### agon.theme

default_color = "-1";
info_eol = "false";
replaces = { "[]=" = "%K$*%n"; };

abstracts = {
  ##
  ## generic
  ##

  # text to insert at the beginning of each non-message line
  line_start = "*** ";

  # timestamp styling, nothing by default
  timestamp = "%W$*";

  # any kind of text that needs hilighting, default is to bold
  hilight = "%_$*%_";

  # any kind of error message, default is bright red
  error = "%R$*%n";

  # channel name is printed
  channel = "%c$0-%n";

  # nick is printed
  nick = "%_%r$*%_";

  # nick host is printed
  nickhost = "$*";

  # server name is printed
  server = "%_$*%_";

  # some kind of comment is printed
  comment = "[$*]";

  # reason for something is printed (part, quit, kick, ..)
  reason = "{comment $*}";

  # mode change is printed ([+o nick])
  mode = "{comment $*}";

  ##
  ## channel specific messages
  ##

  # highlighted nick/host is printed (joins)
  channick_hilight = "%c$0-%n";
  chanhost_hilight = "{nickhost %c$0-%n}";

  # nick/host is printed (parts, quits, etc.)
  channick = "%C$*";
  chanhost = "%C{nickhost $*}";

  # highlighted channel name is printed
  channelhilight = "%r$*%n";

  # ban/ban exception/invite list mask is printed
  ban = "%R$*%n";

  ##
  ## messages
  ##

  # the basic styling of how to print message, $0 = nick mode, $1 = nick
  msgnick = "%r<%R$0%n$1-%r>%n %|";

  # message from you is printed. "msgownnick" specifies the styling of the
  # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
  # whole line.

  # Example1: You want the message text to be green:
  #  ownmsgnick = "{msgnick $0 $1-}%g";
  # Example2.1: You want < and > chars to be yellow:
  #  ownmsgnick = "%Y{msgnick $0 $1-%Y}%n";
  #  (you'll also have to remove <> from replaces list above)
  # Example2.2: But you still want to keep <> grey for other messages:
  #  pubmsgnick = "%K{msgnick $0 $1-%K}%n";
  #  pubmsgmenick = "%K{msgnick $0 $1-%K}%n";
  #  pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n";
  #  ownprivmsgnick = "%K{msgnick  $*%K}%n";
  #  privmsgnick = "%K{msgnick  %R$*%K}%n";

  # $0 = nick mode, $1 = nick
  ownmsgnick = "%R{msgnick $0 $1-%R}%w";
  ownnick = "%W$*%n";

  # public message in channel, $0 = nick mode, $1 = nick
  pubmsgnick = "{msgnick $0 $1-}";
  pubnick = "%N$*%n";

  # public message in channel meant for me, $0 = nick mode, $1 = nick
  pubmsgmenick = "{msgnick $0 $1-}";
  menick = "%Y$*";

  # public highlighted message in channel
  # $0 = highlight color, $1 = nick mode, $2 = nick
  pubmsghinick = "{msgnick $1 $0$2-%n}";

  # channel name is printed with message
  msgchannel = "%K:%c$*%n";

  # private message, $0 = nick, $1 = host
  privmsg = "[%R$0%K(%W$1-%K)%n] ";

  # private message from you, $0 = "msg", $1 = target nick
  ownprivmsg = "[%n$0%K(%n$1-%K)%n] ";

  # own private message in query
  ownprivmsgnick = "{msgnick  $*}%W";
  ownprivnick = "%n$*%W";

  # private message in query
  privmsgnick = "{msgnick  $*}";

  ##
  ## Actions (/ME stuff)
  ##

  # used internally by this theme
  action_core = "%Y * $*%y";

  # generic one that's used by most actions
  action = "{action_core $*} ";

  # own action, both private/public
  ownaction = "{action $*}";

  # own action with target, both private/public
  ownaction_target = "{action_core $0}%K:%c$1%n ";

  # private action sent by others
  pvtaction = "%W (*) $*%n ";
  pvtaction_query = "{action $*}";

  # public action sent by others
  pubaction = "{action $*}";


  ##
  ## other IRC events
  ##

  # whois
  whois = "%# $[8]0 : $1-";

  # notices
  ownnotice = "[%r$0%K(%R$1-%K)]%n ";
  notice = "%K-%C$*%K-%n ";
  pubnotice_channel = "%K:%m$*";
  pvtnotice_host = "%K(%m$*%K)";
  servernotice = "%g!$*%n ";

  # CTCPs
  ownctcp = "[%y$0%K(%R$1-%K)] ";
  ctcp = "%Y$*%n";

  # wallops
  wallop = "%W$*%n: ";
  wallop_nick = "%n$*";
  wallop_action = "%W * $*%n ";

  # netsplits
  netsplit = "%R$*%n";
  netjoin = "%C$*%n";

  # /names list
  names_prefix = "";
  names_nick = "[%_$0%_$1-] ";
  names_nick_op = "{names_nick $*}";
  names_nick_halfop = "{names_nick $*}";
  names_nick_voice = "{names_nick $*}";
  names_users = "[%c$*%n]";
  names_channel = "%C$*%n";

  # DCC
  dcc = "%g$*%n";
  dccfile = "%_$*%_";

  # DCC chat, own msg/action
  dccownmsg = "[%r$0%K($1-%K)%n] ";
  dccownnick = "%R$*%n";
  dccownquerynick = "%W$*%n";
  dccownaction = "{action $*}";
  dccownaction_target = "{action_core $0}%K:%c$1%n ";

  # DCC chat, others
  dccmsg = "[%G$1-%K(%g$0%K)%n] ";
  dccquerynick = "%G$*%n";
  dccaction = "%W (*dcc*) $*%n %|";

  ##
  ## statusbar
  ##

  # default background for all statusbars. You can also give
  # the default foreground color for statusbar items.
  sb_background = "%0%w";

  # default backround for "default" statusbar group
  #sb_default_bg = "%4";
  # background for prompt / input line
  sb_prompt_bg = "%n";
  # background for info statusbar
  sb_info_bg = "%8";
  # background for topicbar (same default)
  #sb_topic_bg = "%4";

  # text at the beginning of statusbars. sb-item already puts
  # space there,so we don't use anything by default.
  sbstart = "";
  # text at the end of statusbars. Use space so that it's never
  # used for anything.
  sbend = " ";

  topicsbstart = "{sbstart $*}";
  topicsbend = "{sbend $*}";

  prompt = "[$*] ";

  sb = " %c[%n$*%c]%n";
  sbmode = "(%c+%n$*)";
  sbaway = " (%GzZzZ%n)";
  sbservertag = ":$0 (change with ^X)";
  sbnickmode = "$0";

  # activity in statusbar

  # ',' separator
  sb_act_sep = "%w$*";
  # normal text
  sb_act_text = "%w$*";
  # public message
  sb_act_msg = "%W$*";
  # hilight
  sb_act_hilight = "%M$*";
  # hilight with specified color, $0 = color, $1 = text
  sb_act_hilight_color = "$0$1-%n";
};
formats = {
  "fe-common/core" = { timestamp = "{timestamp %%H:%%M:%%S} "; };
};

Mutt

Preparation:

mkdir ~/.mutt

aliases

Set up aliases for some mail addresses. None at the moment.

   

muttrc

#source "/etc/Muttrc"   # Not available on OS X
source "gpg --batch --passphrase-file ~/.sec/.passphrase --textmode -d ~/.sec/mutt.gpg |"
set realname="Haoyang Xu"

set sig_dashes

set envelope_from=yes
set reverse_name

set alias_file="~/.mutt/aliases"
source ~/.mutt/aliases

set rfc2047_parameters=yes

set query_command="goobook query %s"
bind editor <Tab> complete-query
macro index,pager a "<pipe-message>goobook add<return>" "add the sender address to Google contacts"


# Account hooks
account-hook . 'unset imap_user ; unset imap_pass ; unset tunnel'
account-hook 'imaps://[email protected]/' "\
             set imap_user=celadevra imap_pass=$my_gpass "

# IMAP settings
set folder="imaps://[email protected]/"
mailboxes ='Work' =INBOX =[Gmail]/Drafts =[Gmail]/'Sent Mail' =[Gmail]/Spam =[Gmail]/'All Mail'
folder-hook 'imaps://[email protected]' ' \
            set folder="imaps://[email protected]/" ;\
            set postponed="+[Gmail]/Drafts" ;\
            set record="+[Gmail]/'Sent Mail'" ;\
            set smtp_url="smtp://[email protected]" ;\
            set smtp_pass=$my_mpass ;\
            set from="Haoyang Xu <[email protected]> " ;\
            set signature="~/.mutt/signature.feco" ;\
            set noaskcc ;\
            set realname="Haoyang Xu" '

# send settings
send-hook '\.org\.cn' "set create_rfc2047_parameters=yes"

# Mail-check preferences
set timeout=60

goobookrc

# "#" or ";" at the start of a line makes it a comment.
[DEFAULT]
# If not given here, email and password is taken from .netrc using
# machine google.com
email: [email protected]
;password: top secret
# or if you want to get the password from a commmand:
passwordeval: gpg --batch --passphrase-file ~/.sec/.passphrase -d ~/.sec/goobook.gpg
# The following are optional, defaults are shown
;cache_filename: ~/.goobook_cache
;cache_expiry_hours: 24
;filter_groupless_contacts: yes

notmuch

# .notmuch-config - Configuration file for the notmuch mail system
#
# For more information about notmuch, see http://notmuchmail.org

# Database configuration
#
# The only value supported here is 'path' which should be the top-level
# directory where your mail currently exists and to where mail will be
# delivered in the future. Files should be individual email messages.
# Notmuch will store its database within a sub-directory of the path
# configured here named ".notmuch".
#

[database]
path=/Users/xhy/Maildir

# User configuration
#
# Here is where you can let notmuch know how you would like to be
# addressed. Valid settings are
#
#       name            Your full name.
#       primary_email   Your primary email address.
#       other_email     A list (separated by ';') of other email addresses
#                       at which you receive email.
#
# Notmuch will use the various email addresses configured here when
# formatting replies. It will avoid including your own addresses in the
# recipient list of replies, and will set the From address based on the
# address to which the original email was addressed.
#

[user]
name=Haoyang Xu
[email protected]

# Configuration for "notmuch new"
#
# The following options are supported here:
#
#       tags    A list (separated by ';') of the tags that will be
#               added to all messages incorporated by "notmuch new".
#
#       ignore  A list (separated by ';') of file and directory names
#               that will not be searched for messages by "notmuch new".
#
#               NOTE: *Every* file/directory that goes by one of those
#               names will be ignored, independent of its depth/location
#               in the mail store.
#

[new]
tags=inbox;unread;
ignore=INBOX.Drafts;INBOX.Trash;INBOX.Spam

# Search configuration
#
# The following option is supported here:
#
#       exclude_tags
#               A ;-separated list of tags that will be excluded from
#               search results by default.  Using an excluded tag in a
#               query will override that exclusion.
#

[search]
exclude_tags=deleted;spam;

# Maildir compatibility configuration
#
# The following option is supported here:
#
#       synchronize_flags      Valid values are true and false.
#
#       If true, then the following maildir flags (in message filenames)
#       will be synchronized with the corresponding notmuch tags:
#
#               Flag    Tag
#               ----    -------
#               D       draft
#               F       flagged
#               P       passed
#               R       replied
#               S       unread (added when 'S' flag is not present)
#
#       The "notmuch new" command will notice flag changes in filenames
#       and update tags, while the "notmuch tag" and "notmuch restore"
#       commands will notice tag changes and update flags in filenames
#

[maildir]
synchronize_flags=true

# Cryptography related configuration
#
# The following option is supported here:
#
#       gpg_path
#               binary name or full path to invoke gpg.
#

[crypto]
gpg_path=gpg2

Nginx

Here is the config file I use to set up a very simple docker image, that is built on newest Nginx image, and serve the simple function to serve contents in a directory to the Web.

The first step would be pulling the newest Nginx image:

docker pull nginx

Next, check my Nginx config:

worker_processes 1;

events { worker_connections 1024; }

http {
    include /etc/nginx/mime.types;
    default_type text/html;
    server {
        listen 443 ssl http2;
        server_name expoundite.net;
        ssl_certificate /etc/nginx/fullchain.pem;
        ssl_trusted_certificate /etc/nginx/chain.pem;
        ssl_certificate_key /etc/nginx/privkey.pem;
        location / {
            root /data/www;
            try_files $uri $uri/ $uri.html;
        }
    }

    server {
        listen 80;
        server_name expoundite.net;
        return 301 https://expoundite.net$request_uri;
    }
}

and the Docker file:

FROM nginx
COPY config /etc/nginx/nginx.conf
COPY privkey.pem /etc/nginx/privkey.pem
COPY chain.pem /etc/nginx/chain.pem
COPY fullchain.pem /etc/nginx/fullchain.pem

Then I can build an Nginx docker image with the right configs:

docker build -t org-nginx .
docker kill $(docker ps -a -q --filter ancestor=org-nginx --format='{{.ID}}')
docker run -d -p 443:443 -p 80:80 -v /home/snakehsu/site:/data/www org-nginx
# delete all stopped containers
docker rm $(docker ps -q -f status=exited)
# remove untagged images
docker images | grep "<none>" | awk '{print $3}' | xargs docker rmi

Music library and playing

Beets

Beets configuration is stored in $HOME/.config/beets/config.yaml:

directory: ~/Music
library: ~/Dropbox/musiclibrary.blb

ignore: .AppleDouble ._* *~ .DS_Store
ignore_hidden: yes

ui:
    color: yes

paths:
    default: $genre/$albumartist/$album/$track $title
    singleton: Singletons/$artist - $title
    comp: $genre/$album/$track $title
    albumtype:soundtrack: Soundtracks/$album/$track $title

plugins: fetchart lyrics lastgenre web bpd

Ruby

---
:backtrace: false
:bulk_threshold: 1000
:sources:
- http://ruby.taobao.org/
- https://ruby.taobao.org/
:update_sources: true
:verbose: true

tmux

# adapted from https://github.com/davidbrewer/tmux-conf/blob/master/tmux.conf
unbind C-b
set -g prefix `
bind-key ` send-prefix

set -g default-terminal "xterm-256color"

# Remove delay for esc so I can use evil-mode faster
set -s escape-time 0

# better mnemonics for splitting panes
bind | split-window -h
bind - split-window -v

# vim / xmonad style bindings for pane movement
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R

# shift-movement keys will resize panes
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5

# fiddle with colors of status bar
set -g status-fg white
set -g status-bg colour234

# fiddle with colors of inactive windows
setw -g window-status-fg cyan
setw -g window-status-bg colour234
setw -g window-status-attr dim

# change color of active window
setw -g window-status-current-fg white
setw -g window-status-current-bg colour88
setw -g window-status-current-attr bright

# set color of regular and active panes
set -g pane-border-fg colour238
set -g pane-border-bg default
set -g pane-active-border-fg green
set -g pane-active-border-bg default

# set color of command line
set -g message-fg white
set -g message-bg colour22
set -g message-attr bright

# configure contents of status bar
## set -g status-utf8 on
## above line not required in Tmux 2.2
set -g status-left-length 40
set -g status-left "#[fg=green]\"#S\""

set -g status-right "#[fg=green] #h | %d %b %R"

set -g status-justify centre
setw -g monitor-activity on
set -g visual-activity on

Vim

Preparation:

mkdir -p ~/.config/nvim
mkdir -p ~/.vim/autoload ~/.vim/bundle

Install pathogen:

curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

Vimrc

I only sometimes use vim to do quick editing and send git commit message, so the vimrc is quite simple.
""""""""""""""""""""
" > Basic Settings
""""""""""""""""""""
set nocompatible
execute pathogen#infect()
set autoindent
filetype plugin indent on
set nobackup
set expandtab
set tabstop=2
set shiftwidth=2
set bs=2
""""""""""""""""""""
" > User Interface
""""""""""""""""""""
set guifont=CosmicSansNeueMono:h13
syntax on
color desert
set laststatus=2
set number
""""""""""""""""""""
" > Completion
""""""""""""""""""""
imap <Tab> <C-P>
set complete=.,b,u,]
set wildmode=longest,list:longest
set completeopt=menu,preview
""""""""""""""""""""
" > Key bindings
""""""""""""""""""""
let mapleader = ","
map <leader>p :set paste<CR>
map <leader>P :set nopaste<CR>

Nvim

cp ~/.vimrc ~/.config/nvim/init.vim
cp -r ~/.vim/* ~/.config/nvim/

bash

profile

.profile is the per-user setting read by bash when starting a login shell.
# settings
set -o vi

# Customize prompt
export PS1="\[\e[1;31m\]\][\A] \[\e[1;34m\]\u \[\e[1;32m\]@ \h > \w \[\e[1;30m\]\$(git_branch)\n\[\e[0m\]$ " 
# rbenv settings
export PATH="$HOME/.local/bin:$HOME/.cabal/bin:$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

# MasterPassword settings
export MP_FULLNAME="Haoyang Xu"

# Show git branch/status in prompt
function git_branch {
    echo -e $(git branch 2>/dev/null | awk '/^*/{ print $2 }')
}

# set editors
export GIT_EDITOR="vim"
export EDITOR="emacsclient -a -t"
# Aliases
alias 'ls'='ls -G'
alias 'll'='ls -l'
alias 'la'='ls -a'

alias 'gst'='git status'
alias 'ga'='git add'
alias 'gaa'='git add -A'
alias 'gc'='git commit'
alias 'gp'='git push'

alias 'e'='emacsclient -t'
alias 'emacs'='/Applications/Emacs.app/Contents/MacOS/Emacs -nw'

alias 'be'='bundle exec'

alias 'psg'='ps aux | grep'

bashrc

.bashrc is the per-user setting for non-login shells. In many cases, justing sourcing .profile would suffice.

source ~/.profile

Credentials

gpg2 -o credentials.org --passphrase="$PPH" -d credentials.org.gpg 
/usr/local/bin/emacs-24.5 credentials.org --batch --eval '(setq org-confirm-babel-evaluate nil)' -f org-org-export-as-org --kill
rm credentials.org

Execute