Last active
August 11, 2017 16:49
-
-
Save qzchenwl/8d6927f2c6901c17a852 to your computer and use it in GitHub Desktop.
Install Haskell development environment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat << EOF >> $HOME/.bashrc | |
export PATH="\$HOME/.local/bin:\$HOME/.cabal/bin:/opt/ghc/7.10.2/bin:/opt/cabal/head/bin:\$PATH" | |
alias tmux="tmux -2" | |
EOF | |
cat << EOF > $HOME/.gitconfig | |
[include] | |
path = ~/.gitconfig.d/gitconfig | |
[core] | |
pager = "less -F -X -R" | |
[alias] | |
s = status -sb | |
[merge] | |
tool = diffconflicts | |
[mergetool "diffconflicts"] | |
cmd = 'diffconflicts vim $BASE $LOCAL $REMOTE $MERGED' | |
trustExitCode = true | |
keepBackup = false | |
EOF | |
cat << EOF > $HOME/.tmux.conf | |
# status bar | |
set-option -g status-utf8 on | |
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf | |
set-option -g status-bg colour235 #base02 | |
set-option -g status-fg colour136 #yellow | |
set-option -g status-attr default | |
# default window title colors | |
set-window-option -g window-status-fg colour244 #base0 | |
set-window-option -g window-status-bg default | |
# active window title colors | |
set-window-option -g window-status-current-fg colour166 #orange | |
set-window-option -g window-status-current-bg default | |
# pane border | |
set-option -g pane-border-fg colour235 #base02 | |
set-option -g pane-active-border-fg colour240 #base01 | |
# message text | |
set-option -g message-bg colour235 #base02 | |
set-option -g message-fg colour166 #orange | |
# pane number display | |
set-option -g display-panes-active-colour colour33 #blue | |
set-option -g display-panes-colour colour166 #orange | |
# clock | |
set-window-option -g clock-mode-colour green #green | |
set -g status-interval 1 | |
set -g status-justify centre # center align window list | |
set -g status-left-length 20 | |
set -g status-right-length 140 | |
set -g status-left '#[fg=green]#H #[fg=black]• #[fg=green,bright]#(uname -r | cut -c 1-6)#[default]' | |
set -g status-right "#(wemux status_users)" | |
# C-b is not acceptable -- Vim uses it | |
set-option -g prefix C-a | |
bind-key C-a last-window | |
# Start numbering at 0 | |
set -g base-index 0 | |
# Allows for faster key repetition | |
set -s escape-time 0 | |
# Rather than constraining window size to the maximum size of any client | |
# connected to the *session*, constrain window size to the maximum size of any | |
# client connected to *that window*. Much more reasonable. | |
setw -g aggressive-resize on | |
# Allows us to use C-a a <command> to send commands to a TMUX session inside | |
# another TMUX session | |
bind-key a send-prefix | |
# Activity monitoring | |
setw -g monitor-activity on | |
set -g visual-activity on | |
# Vi copypaste mode | |
set-window-option -g mode-keys vi | |
bind-key -t vi-copy 'v' begin-selection | |
bind-key -t vi-copy 'y' copy-selection | |
# more intuitive split keys | |
bind | split-window -h | |
bind _ split-window -v | |
# hjkl pane traversal | |
bind h select-pane -L | |
bind j select-pane -D | |
bind k select-pane -U | |
bind l select-pane -R | |
# resizing | |
bind H resize-pane -L 5 | |
bind J resize-pane -D 5 | |
bind K resize-pane -U 5 | |
bind L resize-pane -R 5 | |
# Smart pane switching with awareness of vim splits | |
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-h) || tmux select-pane -L" | |
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-j) || tmux select-pane -D" | |
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-k) || tmux select-pane -U" | |
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-l) || tmux select-pane -R" | |
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l" | |
# reload config | |
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." | |
# auto window rename | |
set-window-option -g automatic-rename | |
# rm mouse mode fail | |
set -g mode-mouse off | |
# color | |
set -g default-terminal "screen-256color" | |
EOF | |
export PATH="$HOME/.local/bin:$HOME/.cabal/bin:/opt/ghc/7.10.2/bin:/opt/cabal/head/bin:$PATH" | |
wget -q -O- https://s3.amazonaws.com/download.fpcomplete.com/ubuntu/fpco.key | sudo apt-key add - | |
echo 'deb http://download.fpcomplete.com/ubuntu/trusty stable main'|sudo tee /etc/apt/sources.list.d/fpco.list | |
sudo apt-add-repository -y ppa:webupd8team/y-ppa-manager | |
sudo apt-add-repository -y ppa:webupd8team/java | |
sudo apt-add-repository -y ppa:hvr/ghc | |
sudo apt-get update | |
sudo apt-get install -y tmux vim-gtk ghc-7.10.2 cabal-install-head zsh \ | |
y-ppa-manager python-pip python-setuptools git happy ctags stack \ | |
libtinfo-dev libncurses5-dev libzmq3-dev libpcre3-dev libcairo2-dev \ | |
libpango1.0-dev libmagic-dev libblas-dev liblapack-dev \ | |
libcurl4-openssl-dev python-dev | |
bash <(curl -sL http://git.io/haskell-vim-now) | |
git clone git://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh | |
cp $HOME/.oh-my-zsh/templates/zshrc.zsh-template $HOME/.zshrc | |
git clone https://github.com/SixArm/sixarm_git_gitconfig.git $HOME/.gitconfig.d | |
sudo pip install -I 'ipython[all]' | |
sudo pip install -I path.py==7.7.1 | |
sudo pip install jupyter | |
stack install ihaskell | |
ihaskell install --debug | |
# {{{ Install shadowsocks | |
# | |
# ➜ ~ sudo pip install shadowsocks | |
# | |
# ➜ ~ cat /etc/init.d/sslocald | |
# #!/bin/bash | |
# | |
# case "$1" in | |
# start) | |
# /usr/local/bin/sslocal -s vps.chenwl.com -p 443 -k password -d start | |
# ;; | |
# stop) | |
# /usr/local/bin/sslocal -s vps.chenwl.com -p 443 -k password -d stop | |
# ;; | |
# restart) | |
# /usr/local/bin/sslocal -s vps.chenwl.com -p 443 -k password -d restart | |
# ;; | |
# *) | |
# echo "Usage: sslocald {start|stop|restart}" >&2 | |
# exit 3 | |
# ;; | |
# esac | |
# | |
# ➜ init.d sudo update-rc.d sslocald defaults | |
# | |
# }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment