├── README.md ├── .gitignore ├── config.fish ├── profile ├── LICENSE ├── emacs └── init.el └── bashrc /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *~ 3 | emacs/session* -------------------------------------------------------------------------------- /config.fish: -------------------------------------------------------------------------------- 1 | set -x PATH $PATH /home/ceshine/miniconda3/bin 2 | 3 | source /home/ceshine/miniconda3/etc/fish/conf.d/conda.fish 4 | # set -gx CONDA_LEFT_PROMPT 1 5 | 6 | set -g theme_date_format "+%Y-%m-%d %H:%M" 7 | set -g theme_color_scheme solarized-dark 8 | 9 | set -g NVM_DIR "/mnt/SSD_Data/nvm" 10 | 11 | conda activate base 12 | 13 | alias ping=prettyping 14 | alias droplet "doctl compute droplet" 15 | alias du "ncdu --color dark -rr -x --exclude .git --exclude node_modules" 16 | if status --is-interactive 17 | nvm use node 18 | end -------------------------------------------------------------------------------- /profile: -------------------------------------------------------------------------------- 1 | # ~/.profile: executed by the command interpreter for login shells. 2 | # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login 3 | # exists. 4 | # see /usr/share/doc/bash/examples/startup-files for examples. 5 | # the files are located in the bash-doc package. 6 | 7 | # the default umask is set in /etc/profile; for setting the umask 8 | # for ssh logins, install and configure the libpam-umask package. 9 | #umask 022 10 | 11 | # if running bash 12 | if [ -n "$BASH_VERSION" ]; then 13 | # include .bashrc if it exists 14 | if [ -f "$HOME/.bashrc" ]; then 15 | . "$HOME/.bashrc" 16 | fi 17 | fi 18 | 19 | # set PATH so it includes user's private bin if it exists 20 | if [ -d "$HOME/bin" ] ; then 21 | PATH="$HOME/bin:$PATH" 22 | fi 23 | _byobu_sourced=1 . /usr/bin/byobu-launch 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 CeShine Lee 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /emacs/init.el: -------------------------------------------------------------------------------- 1 | ;; Legacy commands that I don't what are they for 2 | (require 'ido) 3 | ;; (require 'ffap) 4 | ;; (require 'linum) 5 | ;; (require 'whitespace) 6 | ;; (require 'recentf) 7 | (ido-mode t) 8 | 9 | (require 'package) 10 | (setq package-enable-at-startup nil) 11 | (add-to-list 'package-archives 12 | '("melpa" . "http://melpa.org/packages/")) 13 | ;; (add-to-list 'package-archives 14 | ;; '("melpa-stable" . "https://stable.melpa.org/packages/")) 15 | 16 | (package-initialize) 17 | 18 | (unless (package-installed-p 'use-package) 19 | (package-refresh-contents) 20 | (package-install 'use-package)) 21 | 22 | (require 'use-package) 23 | 24 | ;; do not show welcome screen 25 | (setq inhibit-startup-message t) 26 | 27 | ;; auto-reload buffers 28 | (global-auto-revert-mode t) 29 | 30 | ;; Tab-related settings 31 | (setq-default 32 | tab-width 4 33 | standard-indent 4 34 | indent-tabs-mode nil) 35 | 36 | ;; elpy 37 | (use-package elpy 38 | :ensure t 39 | :config 40 | (setq elpy-rpc-backend "jedi") 41 | ) 42 | (elpy-enable) 43 | 44 | ;; magit 45 | (use-package magit 46 | :ensure t 47 | :init 48 | (setq magit-last-seen-setup-instructions "1.4.0") 49 | :config 50 | (setq magit-auto-revert-mode nil)) 51 | 52 | ;; anaconda-mode 53 | ;; (use-package anaconda-mode 54 | ;; :ensure t 55 | ;; :config 56 | ;; (add-hook 'python-mode-hook 'anaconda-mode)) 57 | 58 | ;; enable conda 59 | (use-package conda 60 | :ensure t 61 | :config 62 | (custom-set-variables 63 | '(conda-anaconda-home "/home/ceshine/miniconda3")) 64 | (setq-default mode-line-format (cons '(:exec conda-env-current-name) mode-line-format)) 65 | (conda-env-autoactivate-mode t)) 66 | 67 | ;; enable autopep8 on save 68 | (use-package py-autopep8 69 | :ensure t 70 | :config 71 | (add-hook 'python-mode-hook 'py-autopep8-enable-on-save)) 72 | 73 | (setq 74 | python-shell-interpreter "ipython" 75 | python-shell-interpreter-args "--simple-prompt -i" 76 | python-shell-prompt-regexp "In \\[[0-9]+\\]: " 77 | python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: " 78 | python-shell-completion-setup-code 79 | "from IPython.core.completerlib import module_completion" 80 | python-shell-completion-module-string-code 81 | "';'.join(module_completion('''%s'''))\n" 82 | python-shell-completion-string-code 83 | "';'.join(get_ipython().Completer.all_completions('''%s'''))\n") 84 | 85 | ;; enable autocomplete for python 86 | (use-package jedi 87 | :ensure t 88 | :config 89 | (add-hook 'python-mode-hook 'jedi:setup) 90 | (setq jedi:complete-on-dot t)) ; optional 91 | 92 | ;; go-mode indent setting 93 | ;; (use-package go-mode 94 | ;; :config 95 | ;; (add-hook 'go-mode-hook 96 | ;; (lambda () 97 | ;; (setq-default) 98 | ;; (setq tab-width 4) 99 | ;; (setq standard-indent 4) 100 | ;; (setq indent-tabs-mode nil)))) 101 | 102 | (custom-set-faces 103 | ;; custom-set-faces was added by Custom. 104 | ;; If you edit it by hand, you could mess it up, so be careful. 105 | ;; Your init file should contain only one such instance. 106 | ;; If there is more than one, they won't work right. 107 | '(default ((t (:inherit autoface-default :stipple nil :background "#d6d6d6" :foreground "#212121" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 140 :width normal :foundry "unknown" :family "Ubuntu Mono")))) 108 | '(column-marker-1 ((t (:background "red")))) 109 | '(diff-added ((t (:foreground "cyan")))) 110 | '(flymake-errline ((((class color) (background light)) (:background "Red")))) 111 | '(font-lock-comment-face ((((class color) (min-colors 8) (background light)) (:foreground "red")))) 112 | '(fundamental-mode-default ((t (:inherit default)))) 113 | '(highlight ((((class color) (min-colors 8)) (:background "white" :foreground "magenta")))) 114 | '(isearch ((((class color) (min-colors 8)) (:background "yellow" :foreground "black")))) 115 | '(linum ((t (:foreground "black" :weight bold)))) 116 | '(region ((((class color) (min-colors 8)) (:background "white" :foreground "magenta")))) 117 | '(secondary-selection ((((class color) (min-colors 8)) (:background "gray" :foreground "cyan")))) 118 | '(show-paren-match ((((class color) (background light)) (:background "black")))) 119 | '(vertical-border ((t nil)))) 120 | 121 | ;; ------------ 122 | ;; -- Macros -- 123 | ;; ------------ 124 | (global-set-key "\C-c;" 'comment-or-uncomment-region) 125 | 126 | ;; Auto refresh buffer upon changes 127 | (global-auto-revert-mode t) 128 | 129 | ;; Delete trailing whitespace 130 | (add-hook 'before-save-hook 'delete-trailing-whitespace) 131 | 132 | ;; Flycheck 133 | (use-package flycheck 134 | :ensure t 135 | :config 136 | (add-hook 'after-init-hook #'global-flycheck-mode)) 137 | 138 | (provide 'init) 139 | ;;; init.el ends here 140 | (custom-set-variables 141 | ;; custom-set-variables was added by Custom. 142 | ;; If you edit it by hand, you could mess it up, so be careful. 143 | ;; Your init file should contain only one such instance. 144 | ;; If there is more than one, they won't work right. 145 | '(conda-anaconda-home "/home/ceshine/miniconda3") 146 | '(package-selected-packages 147 | (quote 148 | (elpy flycheck jedi py-autopep8 virtualenvwrapper magit use-package)))) 149 | -------------------------------------------------------------------------------- /bashrc: -------------------------------------------------------------------------------- 1 | # ~/.bashrc: executed by bash(1) for non-login shells. 2 | # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) 3 | # for examples 4 | # If not running interactively, don't do anything 5 | case $- in 6 | *i*) ;; 7 | *) return;; 8 | esac 9 | 10 | # don't put duplicate lines or lines starting with space in the history. 11 | # See bash(1) for more options 12 | HISTCONTROL=ignoreboth 13 | 14 | # append to the history file, don't overwrite it 15 | shopt -s histappend 16 | 17 | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) 18 | HISTSIZE=1000 19 | HISTFILESIZE=2000 20 | 21 | # check the window size after each command and, if necessary, 22 | # update the values of LINES and COLUMNS. 23 | shopt -s checkwinsize 24 | 25 | # If set, the pattern "**" used in a pathname expansion context will 26 | # match all files and zero or more directories and subdirectories. 27 | #shopt -s globstar 28 | 29 | # make less more friendly for non-text input files, see lesspipe(1) 30 | [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" 31 | 32 | # set variable identifying the chroot you work in (used in the prompt below) 33 | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then 34 | debian_chroot=$(cat /etc/debian_chroot) 35 | fi 36 | 37 | # set a fancy prompt (non-color, unless we know we "want" color) 38 | case "$TERM" in 39 | xterm-color) color_prompt=yes;; 40 | esac 41 | 42 | # uncomment for a colored prompt, if the terminal has the capability; turned 43 | # off by default to not distract the user: the focus in a terminal window 44 | # should be on the output of commands, not on the prompt 45 | # force_color_prompt=yes 46 | 47 | if [ -n "$force_color_prompt" ]; then 48 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then 49 | # We have color support; assume it's compliant with Ecma-48 50 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such 51 | # a case would tend to support setf rather than setaf.) 52 | color_prompt=yes 53 | else 54 | color_prompt= 55 | fi 56 | fi 57 | 58 | if [ "$color_prompt" = yes ]; then 59 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 60 | else 61 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 62 | fi 63 | unset color_prompt force_color_prompt 64 | 65 | # If this is an xterm set the title to user@host:dir 66 | case "$TERM" in 67 | xterm*|rxvt*) 68 | PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" 69 | ;; 70 | *) 71 | ;; 72 | esac 73 | 74 | # enable color support of ls and also add handy aliases 75 | if [ -x /usr/bin/dircolors ]; then 76 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" 77 | alias ls='ls --color=auto' 78 | #alias dir='dir --color=auto' 79 | #alias vdir='vdir --color=auto' 80 | 81 | alias grep='grep --color=auto' 82 | alias fgrep='fgrep --color=auto' 83 | alias egrep='egrep --color=auto' 84 | fi 85 | 86 | # colored GCC warnings and errors 87 | #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' 88 | 89 | # Add an "alert" alias for long running commands. Use like so: 90 | # sleep 10; alert 91 | alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' 92 | 93 | # Alias definitions. 94 | # You may want to put all your additions into a separate file like 95 | # ~/.bash_aliases, instead of adding them here directly. 96 | # See /usr/share/doc/bash-doc/examples in the bash-doc package. 97 | 98 | if [ -f ~/.bash_aliases ]; then 99 | . ~/.bash_aliases 100 | fi 101 | 102 | # enable programmable completion features (you don't need to enable 103 | # this, if it's already enabled in /etc/bash.bashrc and /etc/profile 104 | # sources /etc/bash.bashrc). 105 | # if ! shopt -oq posix; then 106 | # if [ -f /usr/share/bash-completion/bash_completion ]; then 107 | # . /usr/share/bash-completion/bash_completion 108 | # elif [ -f /etc/bash_completion ]; then 109 | # . /etc/bash_completion 110 | # fi 111 | # fi 112 | 113 | ## ----------------------------------- 114 | ## -- 1) Set up virtualenvwrapper -- 115 | ## ----------------------------------- 116 | 117 | export WORKON_HOME=$HOME/.virtualenvs 118 | export VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh 119 | source /usr/local/bin/virtualenvwrapper_lazy.sh 120 | 121 | 122 | ## ----------------------- 123 | ## -- 2) Set up aliases -- 124 | ## ----------------------- 125 | 126 | # 2.1) Safety 127 | alias rm="rm -i" 128 | alias mv="mv -i" 129 | alias cp="cp -i" 130 | set -o noclobber 131 | 132 | # 2.2) Listing, directories, and motion 133 | alias ll="ls -alrtF --color" 134 | alias la="ls -A" 135 | alias l="ls -CF" 136 | alias dir='ls --color=auto --format=vertical' 137 | alias vdir='ls --color=auto --format=long' 138 | alias m='less' 139 | alias ..='cd ..' 140 | alias ...='cd ..;cd ..' 141 | alias md='mkdir' 142 | alias cl='clear' 143 | alias du='du -ch --max-depth=1' 144 | alias treeacl='tree -A -C -L 2' 145 | 146 | # 2.3) Text and editor commands 147 | alias em='emacs -nw' # No X11 windows 148 | export EDITOR='emacs' 149 | export VISUAL='emacs' 150 | 151 | # 2.4) grep options 152 | # export GREP_OPTIONS='--color=auto' 153 | # export GREP_COLOR='1;31' # green for matches 154 | 155 | # 2.5) sort options 156 | # Ensures cross-platform sorting behavior of GNU sort. 157 | # http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-not-sort-in-normal-order_0021 158 | #unset LANG 159 | 160 | [ -r /home/ceshine/.byobu/prompt ] && . /home/ceshine/.byobu/prompt #byobu-prompt# 161 | [[ -s "/home/ceshine/.gvm/scripts/gvm" ]] && source "/home/ceshine/.gvm/scripts/gvm" 162 | 163 | gvm use go1.4.2 --------------------------------------------------------------------------------