├── vim ├── .vimrc └── autoload │ └── pathogen.vim ├── .gitmodules ├── README.md ├── ssh └── config ├── mg └── mg ├── python └── pypirc ├── git ├── config └── ignore ├── install.sh ├── LICENSE ├── terminator └── config ├── postgres └── psqlrc ├── vagrant └── Vagrantfile ├── zsh └── osx │ ├── zshrc.antigen │ └── zshrc.ohmyzsh └── emacs └── init.el /vim/.vimrc: -------------------------------------------------------------------------------- 1 | execute pathogen#infect() 2 | filetype plugin indent on 3 | 4 | " color scheme configuration 5 | colorscheme molokai 6 | 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vim/bundle/colorschemes"] 2 | path = vim/bundle/colorschemes 3 | url = https://github.com/flazz/vim-colorschemes.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | ~ for all my . files 3 | 4 | ## Getting the source code 5 | 6 | ``` 7 | git clone https://github.com/sandeepraju/dotfiles.git --recursive 8 | ``` 9 | -------------------------------------------------------------------------------- /ssh/config: -------------------------------------------------------------------------------- 1 | Host * 2 | IdentityFile ~/.ssh/id_rsa 3 | ServerAliveInterval 60 4 | VisualHostKey yes 5 | LogLevel DEBUG 6 | 7 | # Hostname sandeepraju.in 8 | # Port 22 9 | # User sandeep 10 | # ForwardAgent yes 11 | -------------------------------------------------------------------------------- /mg/mg: -------------------------------------------------------------------------------- 1 | ;; source: https://github.com/milkypostman/dotfiles/blob/master/.mg 2 | (make-backup-files nil) 3 | global-set-key "\^w" backward-kill-word 4 | global-set-key "\^x\^m" execute-extended-command 5 | global-set-key "\^x\^k" kill-region 6 | -------------------------------------------------------------------------------- /python/pypirc: -------------------------------------------------------------------------------- 1 | [distutils] 2 | index-servers = 3 | pypi 4 | pypitest 5 | 6 | [pypi] 7 | repository=https://pypi.python.org/pypi 8 | username= 9 | password= 10 | 11 | [pypitest] 12 | repository=https://testpypi.python.org/pypi 13 | username= 14 | password= -------------------------------------------------------------------------------- /git/config: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Sandeep Raju Prabhakar 3 | email = me@sandeepraju.in 4 | 5 | [credential] 6 | helper = cache --timeout=3600 7 | 8 | [core] 9 | editor = mg 10 | autocrlf = input 11 | safecrlf = true 12 | excludesfile = ~/.gitignore 13 | 14 | [alias] 15 | co = checkout 16 | ci = commit 17 | st = status 18 | br = branch 19 | hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short 20 | type = cat-file -t 21 | dump = cat-file -p 22 | 23 | [color] 24 | diff = auto 25 | branch = auto 26 | status = auto 27 | interactive = auto 28 | ui = true 29 | pager = true 30 | 31 | [apply] 32 | whitespace = fix 33 | 34 | [branch] 35 | autosetuprebase = always -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install SSH config 4 | echo "installing ssh config file" 5 | mkdir -p ~/.ssh/ 6 | cp ssh/config ~/.ssh/ 7 | 8 | # Install terminator config 9 | echo "installing terminator config file" 10 | mkdir -p ~/.config/terminator/ 11 | cp terminator/config ~/.config/terminator/ 12 | 13 | # Install git config 14 | echo "installing git config file" 15 | cp git/config ~/.gitconfig 16 | cp git/ignore ~/.gitignore 17 | 18 | # Install PyPI config 19 | echo "installing PyPI config file" 20 | cp python/pypirc ~/.pypirc 21 | 22 | # Install Postgres PSQL config 23 | echo "installing psql config file" 24 | cp postgres/psqlrc ~/.psqlrc 25 | 26 | # Install zsh config 27 | echo "installing zsh config file" 28 | cp zsh/osx/zshrc ~/.zshrc 29 | 30 | # Install emacs config 31 | echo "installing emacs config file" 32 | mkdir -p ~/.emacs.d/ 33 | cp emacs/init.el ~/.emacs.d/init.el 34 | 35 | # Install mg config 36 | echo "installing mg config file" 37 | cp mg/mg ~/.mg 38 | 39 | # Install vagrant file 40 | echo "setting up vagrant" 41 | cp vagrant/Vagrantfile ~/Vagrantfile 42 | -------------------------------------------------------------------------------- /git/ignore: -------------------------------------------------------------------------------- 1 | ## Emacs ## 2 | *~ 3 | \#*\# 4 | /.emacs.desktop 5 | /.emacs.desktop.lock 6 | *.elc 7 | auto-save-list 8 | tramp 9 | .\#* 10 | 11 | # Org-mode 12 | .org-id-locations 13 | *_archive 14 | 15 | # flymake-mode 16 | *_flymake.* 17 | 18 | # eshell files 19 | /eshell/history 20 | /eshell/lastdir 21 | 22 | # elpa packages 23 | /elpa/ 24 | 25 | # reftex files 26 | *.rel 27 | 28 | # AUCTeX auto folder 29 | /auto/ 30 | 31 | # cask packages 32 | .cask/ 33 | dist/ 34 | 35 | # Flycheck 36 | flycheck_*.el 37 | 38 | # server auth directory 39 | /server/ 40 | 41 | # projectiles files 42 | .projectile 43 | 44 | ## ViM ## 45 | # swap 46 | [._]*.s[a-w][a-z] 47 | [._]s[a-w][a-z] 48 | # session 49 | Session.vim 50 | # temporary 51 | .netrwhist 52 | *~ 53 | # auto-generated tag files 54 | tags 55 | 56 | ## OSx ## 57 | *.DS_Store 58 | .AppleDouble 59 | .LSOverride 60 | 61 | # Icon must end with two \r 62 | Icon 63 | 64 | 65 | # Thumbnails 66 | ._* 67 | 68 | # Files that might appear in the root of a volume 69 | .DocumentRevisions-V100 70 | .fseventsd 71 | .Spotlight-V100 72 | .TemporaryItems 73 | .Trashes 74 | .VolumeIcon.icns 75 | .com.apple.timemachine.donotpresent 76 | 77 | # Directories potentially created on remote AFP share 78 | .AppleDB 79 | .AppleDesktop 80 | Network Trash Folder 81 | Temporary Items 82 | .apdisk 83 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Sandeep Raju Prabhakar 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of dotfiles nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /terminator/config: -------------------------------------------------------------------------------- 1 | # modified from: https://github.com/ghuntley/terminator-solarized 2 | [global_config] 3 | handle_size = 0 4 | enabled_plugins = TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, Logger, LaunchpadBugURLHandler 5 | focus = system 6 | title_hide_sizetext = True 7 | geometry_hinting = False 8 | title_transmit_bg_color = "#d30102" 9 | inactive_color_offset = 0.63 10 | always_split_with_profile = True 11 | [keybindings] 12 | [profiles] 13 | [[default]] 14 | scrollbar_position = hidden 15 | use_system_font = False 16 | login_shell = True 17 | cursor_shape = underline 18 | background_image = None 19 | scroll_on_output = False 20 | font = Source Code Pro 10 21 | scrollback_infinite = True 22 | [[solarized-dark]] 23 | scrollbar_position = hidden 24 | palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#586e75:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3" 25 | login_shell = True 26 | background_image = None 27 | cursor_shape = underline 28 | use_system_font = False 29 | cursor_color = "#eee8d5" 30 | foreground_color = "#eee8d5" 31 | scroll_on_output = False 32 | font = Source Code Pro 10 33 | background_color = "#002b36" 34 | scrollback_infinite = True 35 | show_titlebar = False 36 | [[solarized-light]] 37 | palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3" 38 | background_color = "#eee8d5" 39 | background_image = None 40 | cursor_color = "#002b36" 41 | foreground_color = "#002b36" 42 | [layouts] 43 | [[default]] 44 | [[[child1]]] 45 | type = Terminal 46 | parent = window0 47 | profile = solarized-dark 48 | [[[window0]]] 49 | type = Window 50 | parent = "" 51 | [plugins] 52 | -------------------------------------------------------------------------------- /postgres/psqlrc: -------------------------------------------------------------------------------- 1 | -- sources: 2 | -- * https://robots.thoughtbot.com/improving-the-command-line-postgres-experience 3 | -- * https://github.com/hgmnz/dotfiles/blob/master/psqlrc 4 | -- * http://blog.endpoint.com/2015/02/postgres-onerrorrollback-explained.html 5 | -- * https://github.com/thoughtbot/dotfiles/blob/master/psqlrc 6 | -- * http://www.craigkerstiens.com/2013/02/21/more-out-of-psql/ 7 | -- * http://i-dba.blogspot.com/2014/02/colorizing-psql-prompt-guide.html 8 | -- * http://merlinmoncure.blogspot.com/2012/09/psql-now-with-splash-of-color.html 9 | -- * https://www.digitalocean.com/community/tutorials/how-to-customize-the-postgresql-prompt-with-psqlrc-on-ubuntu-14-04 10 | -- Supress showing "helpful" startup text 11 | \set QUIET 1 12 | -- By default, NULL displays as an empty space. Is it actually an empty 13 | -- string, or is it null? This makes that distinction visible. 14 | \pset null '[NULL]' 15 | -- Use table format (with headers across the top) by default, but switch to 16 | -- expanded table format when there's a lot of data, which makes it much 17 | -- easier to read. 18 | \x auto 19 | -- Make the tables look sexy 20 | \pset linestyle unicode 21 | \pset border 2 22 | -- Turn off pager 23 | \pset pager off 24 | -- Verbose error reports. 25 | \set VERBOSITY verbose 26 | -- Use a separate history file per-database. 27 | \set HISTFILE ~/.psql_history- :DBNAME 28 | -- If a command is run more than once in a row, only store it once in the 29 | -- history. 30 | \set HISTCONTROL ignoredups 31 | -- Autocomplete keywords (like SELECT) in upper-case, even if you started 32 | -- typing them in lower case. 33 | \set COMP_KEYWORD_CASE upper 34 | -- Time the SQL queries 35 | \timing 36 | -- Stay inside a transction even if you make a typo 37 | \set ON_ERROR_ROLLBACK interactive 38 | -- Set the primary prompt 39 | \set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]%# ' 40 | -- Set the secondary prompt 41 | \set PROMPT2 '[more] %R > ' 42 | -- Resume showing "helpful" messages 43 | \unset QUIET 44 | -- Define query aliases (invoked as :name_of_alias;) 45 | \set ping 46 | 'SELECT 1;' 47 | \echo 'With great power comes great responsibility ~ Uncle Ben' 48 | -------------------------------------------------------------------------------- /vagrant/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # All Vagrant configuration is done below. The "2" in Vagrant.configure 5 | # configures the configuration version (we support older styles for 6 | # backwards compatibility). Please don't change it unless you know what 7 | # you're doing. 8 | Vagrant.configure("2") do |config| 9 | # The most common configuration options are documented and commented below. 10 | # For a complete reference, please see the online documentation at 11 | # https://docs.vagrantup.com. 12 | 13 | # Every Vagrant development environment requires a box. You can search for 14 | # boxes at https://atlas.hashicorp.com/search. 15 | config.vm.box = "ubuntu/xenial64" 16 | 17 | # Disable automatic box update checking. If you disable this, then 18 | # boxes will only be checked for updates when the user runs 19 | # `vagrant box outdated`. This is not recommended. 20 | # config.vm.box_check_update = false 21 | 22 | # Create a forwarded port mapping which allows access to a specific port 23 | # within the machine from a port on the host machine. In the example below, 24 | # accessing "localhost:8080" will access port 80 on the guest machine. 25 | # config.vm.network "forwarded_port", guest: 80, host: 8080 26 | 27 | # Create a private network, which allows host-only access to the machine 28 | # using a specific IP. 29 | # config.vm.network "private_network", ip: "192.168.33.10" 30 | 31 | # Create a public network, which generally matched to bridged network. 32 | # Bridged networks make the machine appear as another physical device on 33 | # your network. 34 | # config.vm.network "public_network" 35 | 36 | # Share an additional folder to the guest VM. The first argument is 37 | # the path on the host to the actual folder. The second argument is 38 | # the path on the guest to mount the folder. And the optional third 39 | # argument is a set of non-required options. 40 | # config.vm.synced_folder "../data", "/vagrant_data" 41 | 42 | # Provider-specific configuration so you can fine-tune various 43 | # backing providers for Vagrant. These expose provider-specific options. 44 | # Example for VirtualBox: 45 | # 46 | # config.vm.provider "virtualbox" do |vb| 47 | # # Display the VirtualBox GUI when booting the machine 48 | # vb.gui = true 49 | # 50 | # # Customize the amount of memory on the VM: 51 | # vb.memory = "1024" 52 | # end 53 | # 54 | # View the documentation for the provider you are using for more 55 | # information on available options. 56 | 57 | # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies 58 | # such as FTP and Heroku are also available. See the documentation at 59 | # https://docs.vagrantup.com/v2/push/atlas.html for more information. 60 | # config.push.define "atlas" do |push| 61 | # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" 62 | # end 63 | 64 | # Enable provisioning with a shell script. Additional provisioners such as 65 | # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the 66 | # documentation for more information about their specific syntax and use. 67 | # config.vm.provision "shell", inline: <<-SHELL 68 | # apt-get update 69 | # apt-get install -y apache2 70 | # SHELL 71 | end 72 | -------------------------------------------------------------------------------- /zsh/osx/zshrc.antigen: -------------------------------------------------------------------------------- 1 | source ~/.antigen/antigen.zsh 2 | 3 | # Load the oh-my-zsh's library. 4 | antigen use oh-my-zsh 5 | 6 | # Bundles from the default repo (robbyrussell's oh-my-zsh). 7 | antigen bundle git 8 | antigen bundle heroku 9 | antigen bundle pip 10 | antigen bundle lein 11 | antigen bundle command-not-found 12 | antigen bundle rupa/z 13 | 14 | # Syntax highlighting bundle. 15 | antigen bundle zsh-users/zsh-syntax-highlighting 16 | 17 | # For SSH, starting ssh-agent is annoying 18 | # antigen bundle ssh-agent 19 | 20 | # Node Plugins 21 | antigen bundle node 22 | antigen bundle npm 23 | 24 | # Python Plugins 25 | antigen bundle pip 26 | antigen bundle python 27 | antigen bundle virtualenv 28 | 29 | # Load the theme. 30 | antigen theme robbyrussell 31 | 32 | # Tell antigen that you're done. 33 | antigen apply 34 | 35 | # Add binaries installed on local 36 | export PATH=/usr/local/bin:$PATH 37 | 38 | # Homebrew Github auto token 39 | export HOMEBREW_GITHUB_API_TOKEN="add-your-github-token-here" 40 | 41 | # Homebrew default editor of choice 42 | export HOMEBREW_EDITOR="emacs" 43 | 44 | # Virtualenvwrapper 45 | export WORKON_HOME=$HOME/.virtualenvs 46 | export PROJECT_HOME=$HOME/code 47 | source /usr/local/bin/virtualenvwrapper.sh 48 | 49 | # Go config 50 | export GOROOT=/usr/local/opt/go/libexec 51 | export PATH=$PATH:$GOROOT/bin 52 | export GOPATH=$HOME/code 53 | export PATH=$PATH:$GOPATH/bin 54 | 55 | # Aliases 56 | 57 | # Makes using emacs easier 58 | alias starte="emacs --daemon"; 59 | alias e="emacsclient -c -t -a mg"; 60 | alias stope="emacsclient -e \"(kill-emacs)\""; 61 | 62 | # Run a local smtp server for debugging 63 | alias pysmtp="sudo python -m smtpd -c DebuggingServer -n localhost:25" 64 | 65 | # List only directories 66 | alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" 67 | 68 | # Timer 69 | alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' 70 | 71 | # IP addresses 72 | alias ip="dig +short myip.opendns.com @resolver1.opendns.com" 73 | alias localip="ipconfig getifaddr en0" 74 | alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'" 75 | 76 | # View HTTP traffic 77 | alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'" 78 | alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\"" 79 | 80 | # Trim new lines and copy to clipboard 81 | alias c="tr -d '\n' | pbcopy" 82 | 83 | # Lock the screen (when going AFK) 84 | alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend" 85 | 86 | # PyPI aliases 87 | alias pypi-register-test="python setup.py register -r pypitest" 88 | alias pypi-register-live="python setup.py register -r pypi" 89 | alias pypi-upload-test="python setup.py sdist upload -r pypitest" 90 | alias pypi-upload-live="python setup.py sdist upload -r pypi" 91 | 92 | # Custom functions 93 | function mkcd { 94 | mkdir -p $1 && cd $1; 95 | } 96 | 97 | function mkcdtemp { 98 | cd $(mktemp -d); 99 | } 100 | 101 | function en() { 102 | mkdir -p $HOME/.vault/ && gpg-zip -c -o $HOME/.vault/$1.gpg ./$1 && srm -rf ./$1 103 | } 104 | 105 | function de() { 106 | dir=`mktemp -d` && cd $dir && gpg-zip -d $HOME/.vault/$1.gpg 107 | } 108 | 109 | function enf() { 110 | mkdir -p $HOME/.vault/ && gpg -c -o $HOME/.vault/$1.gpg ./$1 && srm -rf ./$1 111 | } 112 | 113 | function def() { 114 | dir=`mktemp -d` && cd $dir && gpg -o ./$1 -d $HOME/.vault/$1.gpg 115 | } 116 | 117 | function focus { 118 | secs=$(($1 * 60)) 119 | while [ true ]; do 120 | afplay /System/Library/Sounds/Ping.aiff 121 | sleep $secs 122 | done 123 | } 124 | 125 | # Configure the editor 126 | export EDITOR=mg 127 | 128 | # Add RVM to PATH for scripting 129 | export PATH="$PATH:$HOME/.rvm/bin" 130 | 131 | # This loads nvm 132 | export NVM_DIR="$HOME/.nvm" 133 | [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" 134 | -------------------------------------------------------------------------------- /zsh/osx/zshrc.ohmyzsh: -------------------------------------------------------------------------------- 1 | # If you come from bash you might have to change your $PATH. 2 | # export PATH=$HOME/bin:/usr/local/bin:$PATH 3 | 4 | # Path to your oh-my-zsh installation. 5 | export ZSH=~/.oh-my-zsh 6 | 7 | # Set name of the theme to load. Optionally, if you set this to "random" 8 | # it'll load a random theme each time that oh-my-zsh is loaded. 9 | # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes 10 | ZSH_THEME="robbyrussell" 11 | 12 | # Set list of themes to load 13 | # Setting this variable when ZSH_THEME=random 14 | # cause zsh load theme from this variable instead of 15 | # looking in ~/.oh-my-zsh/themes/ 16 | # An empty array have no effect 17 | # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) 18 | 19 | # Uncomment the following line to use case-sensitive completion. 20 | # CASE_SENSITIVE="true" 21 | 22 | # Uncomment the following line to use hyphen-insensitive completion. Case 23 | # sensitive completion must be off. _ and - will be interchangeable. 24 | # HYPHEN_INSENSITIVE="true" 25 | 26 | # Uncomment the following line to disable bi-weekly auto-update checks. 27 | # DISABLE_AUTO_UPDATE="true" 28 | 29 | # Uncomment the following line to change how often to auto-update (in days). 30 | # export UPDATE_ZSH_DAYS=13 31 | 32 | # Uncomment the following line to disable colors in ls. 33 | # DISABLE_LS_COLORS="true" 34 | 35 | # Uncomment the following line to disable auto-setting terminal title. 36 | # DISABLE_AUTO_TITLE="true" 37 | 38 | # Uncomment the following line to enable command auto-correction. 39 | # ENABLE_CORRECTION="true" 40 | 41 | # Uncomment the following line to display red dots whilst waiting for completion. 42 | # COMPLETION_WAITING_DOTS="true" 43 | 44 | # Uncomment the following line if you want to disable marking untracked files 45 | # under VCS as dirty. This makes repository status check for large repositories 46 | # much, much faster. 47 | # DISABLE_UNTRACKED_FILES_DIRTY="true" 48 | 49 | # Uncomment the following line if you want to change the command execution time 50 | # stamp shown in the history command output. 51 | # The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" 52 | # HIST_STAMPS="mm/dd/yyyy" 53 | 54 | # Would you like to use another custom folder than $ZSH/custom? 55 | # ZSH_CUSTOM=/path/to/new-custom-folder 56 | 57 | # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) 58 | # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ 59 | # Example format: plugins=(rails git textmate ruby lighthouse) 60 | # Add wisely, as too many plugins slow down shell startup. 61 | plugins=( 62 | git, 63 | dotenv, 64 | osx, 65 | # autopep8, 66 | # autoenv, 67 | # brew, 68 | # docker, 69 | # emacs, 70 | # github, 71 | # gitignore, 72 | # golang, 73 | # history, 74 | # iterm2, 75 | # mvn, 76 | # pep8, 77 | # python, 78 | z 79 | ) 80 | 81 | source $ZSH/oh-my-zsh.sh 82 | 83 | # User configuration 84 | 85 | # export MANPATH="/usr/local/man:$MANPATH" 86 | 87 | # You may need to manually set your language environment 88 | # export LANG=en_US.UTF-8 89 | 90 | # Preferred editor for local and remote sessions 91 | # if [[ -n $SSH_CONNECTION ]]; then 92 | # export EDITOR='vim' 93 | # else 94 | # export EDITOR='mvim' 95 | # fi 96 | 97 | # Compilation flags 98 | # export ARCHFLAGS="-arch x86_64" 99 | 100 | # ssh 101 | # export SSH_KEY_PATH="~/.ssh/rsa_id" 102 | 103 | # Set personal aliases, overriding those provided by oh-my-zsh libs, 104 | # plugins, and themes. Aliases can be placed here, though oh-my-zsh 105 | # users are encouraged to define aliases within the ZSH_CUSTOM folder. 106 | # For a full list of active aliases, run `alias`. 107 | # 108 | # Example aliases 109 | # alias zshconfig="mate ~/.zshrc" 110 | # alias ohmyzsh="mate ~/.oh-my-zsh" 111 | 112 | # Go config 113 | export GOROOT=/usr/local/opt/go/libexec 114 | export PATH=$PATH:$GOROOT/bin 115 | export GOPATH=$HOME/projects 116 | export PATH=$PATH:$GOPATH/bin 117 | 118 | # NVM config 119 | export NVM_DIR="$HOME/.nvm" 120 | . "/usr/local/opt/nvm/nvm.sh" 121 | 122 | # Virtualenv 123 | alias python=/usr/local/bin/python3 124 | export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3 125 | export WORKON_HOME=$HOME/.virtualenvs 126 | export PROJECT_HOME=$HOME/projects 127 | source /usr/local/bin/virtualenvwrapper.sh 128 | 129 | # Be focussed 130 | function focus { 131 | secs=$(($1 * 60)) 132 | while [ true ]; do 133 | afplay /System/Library/Sounds/Ping.aiff 134 | sleep $secs 135 | done 136 | } -------------------------------------------------------------------------------- /emacs/init.el: -------------------------------------------------------------------------------- 1 | ;; The following elisp code has been hacked together 2 | ;; from various resources all over the internet. 3 | 4 | ;; Few references here: 5 | ;; [01] http://stackoverflow.com/a/10093312/1044366 6 | ;; [02] http://stackoverflow.com/a/10095853/1044366 7 | ;; [03] http://stackoverflow.com/a/15962540/1044366 8 | ;; [04] http://stackoverflow.com/a/21989454/1044366 9 | ;; [05] http://stackoverflow.com/a/18330742/1044366 10 | ;; [06] http://stackoverflow.com/a/65473/1044366 11 | ;; [07] http://stackoverflow.com/a/64558/1044366 12 | ;; [08] http://stackoverflow.com/a/11624677/1044366 13 | ;; [09] http://stackoverflow.com/a/4160949/1044366 14 | ;; [10] https://www.reddit.com/r/emacs/comments/4fqu0a/automatically_install_packages_on_startup/d2ba42o 15 | ;; [11] http://stackoverflow.com/a/6415812 16 | ;; [12] http://stackoverflow.com/a/322690 17 | ;; [13] http://stackoverflow.com/a/3316038 18 | 19 | 20 | ;; Set the emacs config directory. 21 | (unless (boundp 'user-emacs-directory) 22 | (defvar user-emacs-directory "~/.emacs.d/")) 23 | 24 | ;; List the package repositories (elpa, gnu, melpa). 25 | (when (>= emacs-major-version 24) 26 | (require 'package) 27 | (package-initialize) 28 | ;; (add-to-list 'package-archives '("elpa" . "http://tromey.com/elpa/") t) 29 | ;; (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/") t) 30 | (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)) 31 | 32 | (defun ensure-package-installed (&rest packages) 33 | "Assure every package is installed, ask for installation if it’s not. 34 | Return a list of installed packages or nil for every skipped package." 35 | (mapcar 36 | (lambda (package) 37 | (if (package-installed-p package) 38 | nil 39 | (if (y-or-n-p (format "Package %s is missing. Install it? " package)) 40 | (package-install package) 41 | package))) 42 | packages)) 43 | 44 | ;; Make sure to have downloaded archive description. 45 | ;; Or use package-archive-contents as suggested by [1] 46 | (or (file-exists-p package-user-dir) 47 | (package-refresh-contents)) 48 | 49 | ;; Install the required packages 50 | (ensure-package-installed 'use-package 'nyan-mode 'company 'ws-butler 'helm 'undo-tree 'multiple-cursors 'smartparens 'gist 'markdown-mode 'elpy) 51 | 52 | ;; Install the required themes. 53 | (ensure-package-installed 'sublime-themes 'monokai-theme 'color-theme-solarized 'molokai-theme 'hipster-theme 'gotham-theme) 54 | 55 | ;; Activate installed packages. 56 | (package-initialize) 57 | 58 | ;; Load the `use-package` package. 59 | (eval-when-compile 60 | (require 'use-package)) 61 | 62 | ;; Package specifc configs. 63 | ;; `nyan-mode` config. 64 | (if (display-graphic-p) 65 | (use-package nyan-mode 66 | :config 67 | (nyan-mode) 68 | (setq nyan-wavy-trail t) 69 | (nyan-start-animation) 70 | ) 71 | ) 72 | 73 | ;; `company-mode` configs. 74 | (use-package company 75 | :init 76 | (add-hook 'after-init-hook 'global-company-mode t) 77 | ) 78 | 79 | ;; `ws-butler` configs. 80 | (use-package ws-butler) 81 | 82 | ;; `helm` configs. 83 | (use-package helm 84 | :config 85 | ;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs. 86 | ;; Changed to "C-c h". Note: We must set "C-c h" globally, because we 87 | ;; cannot change `helm-command-prefix-key' once `helm-config' is loaded. 88 | (global-set-key (kbd "C-c h") 'helm-command-prefix) 89 | (global-unset-key (kbd "C-x c")) 90 | 91 | (define-key helm-map (kbd "") 'helm-execute-persistent-action) ; rebind tab to run persistent action 92 | (define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB works in terminal 93 | (define-key helm-map (kbd "C-z") 'helm-select-action) ; list actions using C-z 94 | (when (executable-find "curl") 95 | (setq helm-google-suggest-use-curl-p t)) 96 | 97 | (setq helm-split-window-in-side-p t ; open helm buffer inside current window, not occupy whole other window 98 | helm-move-to-line-cycle-in-source t ; move to end or beginning of source when reaching top or bottom of source. 99 | helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp. 100 | helm-scroll-amount 8 ; scroll 8 lines other window using M-/M- 101 | helm-ff-file-name-history-use-recentf t) 102 | (helm-autoresize-mode 1) 103 | (helm-mode 1)) 104 | (use-package helm-config) 105 | 106 | ;; `undo-tree` configs. 107 | (use-package undo-tree 108 | :init 109 | (setq undo-tree-auto-save-history t) 110 | (global-undo-tree-mode)) 111 | (setq undo-tree-history-directory-alist '((".*" . "~/.emacs.d/undo-list"))) 112 | 113 | ;; `multiple-cursors` configs. 114 | (use-package multiple-cursors 115 | :config 116 | (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) 117 | (global-set-key (kbd "C->") 'mc/mark-next-like-this) 118 | (global-set-key (kbd "C-<") 'mc/mark-previous-like-this) 119 | (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)) 120 | 121 | ;; `smartparens` configs. 122 | (use-package smartparens 123 | :config 124 | (show-smartparens-global-mode t) 125 | (smartparens-global-mode t)) 126 | 127 | ;; `gist` configs. 128 | (use-package gist) 129 | 130 | ;; `markdown-mode` configs. 131 | (use-package markdown-mode 132 | :config 133 | (add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode)) 134 | (add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode)) 135 | (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))) 136 | 137 | ;; Load the required theme. 138 | (if (display-graphic-p) 139 | (load-theme 'monokai t) 140 | (load-theme 'dorsey t)) 141 | 142 | ;; Line & column numbers. 143 | (global-linum-mode t) 144 | (setq line-number-mode t) 145 | (setq column-number-mode t) 146 | 147 | ;; Prevent the cursor from blinking. 148 | (blink-cursor-mode 0) 149 | 150 | ;; Don't show messages that you don't read. 151 | (setq initial-scratch-message "") 152 | (setq inhibit-startup-message t) 153 | 154 | ;; Set startup *scratch* buffer mode to text. 155 | (setq initial-major-mode 'text-mode) 156 | 157 | ;; Enable soft wrapping. 158 | (visual-line-mode t) 159 | 160 | ;; Always highlight cursor line. 161 | (global-hl-line-mode t) 162 | 163 | ;; Set appropriate line number gutter. 164 | (setq linum-format "%4d ") 165 | 166 | ;; Set custom typeface and size 167 | (set-default-font "Monaco 12") 168 | 169 | ;; Revert files automatically 170 | (global-auto-revert-mode t) 171 | 172 | ;; Don't litter the working directory. 173 | (defvar --backup-directory (concat user-emacs-directory "backups")) 174 | (if (not (file-exists-p --backup-directory)) 175 | (make-directory --backup-directory t)) 176 | (setq backup-directory-alist `(("." . ,--backup-directory))) 177 | (setq make-backup-files t ; backup of a file the first time it is saved. 178 | backup-by-copying t ; don't clobber symlinks 179 | version-control t ; version numbers for backup files 180 | delete-old-versions t ; delete excess backup files silently 181 | delete-by-moving-to-trash t 182 | kept-old-versions 6 ; oldest versions to keep when a new numbered backup is made (default: 2) 183 | kept-new-versions 9 ; newest versions to keep when a new numbered backup is made (default: 2) 184 | auto-save-default t ; auto-save every buffer that visits a file 185 | auto-save-timeout 20 ; number of seconds idle time before auto-save (default: 30) 186 | auto-save-interval 200 ; number of keystrokes between auto-saves (default: 300) 187 | ) 188 | 189 | ;; Yank and paste elsewhere. 190 | (setq x-select-enable-clipboard t) 191 | 192 | ;; Replace yes or no with y or n. 193 | (defalias 'yes-or-no-p 'y-or-n-p) 194 | 195 | ;; No more tabs 196 | (setq-default indent-tabs-mode nil) 197 | 198 | ;; Set default tab width to 4 199 | (setq-default tab-width 4) 200 | 201 | ;; Confirm before quitting. 202 | (if (display-graphic-p) 203 | (bind-key 204 | "C-x C-c" 205 | (lambda () 206 | (interactive) 207 | (if (y-or-n-p "Quit Emacs? ") 208 | (save-buffers-kill-emacs)))) 209 | ) 210 | 211 | ;; Toggle line numbers 212 | (global-set-key (kbd "M-\\") 'global-linum-mode) 213 | 214 | ;; Minimal emacs looks good. 215 | (tool-bar-mode -1) 216 | (menu-bar-mode -1) 217 | (if (display-graphic-p) 218 | (scroll-bar-mode -1)) 219 | 220 | 221 | ;; Custom functions 222 | 223 | ;; Indent & un-indent 224 | (defun my-indent-region (N) 225 | (interactive "p") 226 | (if (use-region-p) 227 | (progn (indent-rigidly (region-beginning) (region-end) (* N 4)) 228 | (setq deactivate-mark nil)) 229 | (self-insert-command N))) 230 | 231 | (defun my-unindent-region (N) 232 | (interactive "p") 233 | (if (use-region-p) 234 | (progn (indent-rigidly (region-beginning) (region-end) (* N -4)) 235 | (setq deactivate-mark nil)) 236 | (self-insert-command N))) 237 | 238 | (global-set-key ">" 'my-indent-region) 239 | (global-set-key "<" 'my-unindent-region) 240 | 241 | 242 | ;; Smoother scroll. Way better than the default. 243 | (setq redisplay-dont-pause t 244 | scroll-margin 1 245 | scroll-step 1 246 | scroll-conservatively 10000 247 | scroll-preserve-screen-position 1) 248 | 249 | ;; Specify the virtual environment for emacs to use. 250 | (push "~/.virtualenvs/emacs/bin" exec-path) 251 | (setenv "PATH" 252 | (concat 253 | "~/.virtualenvs/emacs/bin" ":" 254 | (getenv "PATH") 255 | )) 256 | 257 | ;; Set up Python Development Environment. 258 | ;; Pre-requisites: 259 | ;; # Either of these 260 | ;; pip install rope 261 | ;; pip install jedi 262 | ;; # flake8 for code checks 263 | ;; pip install flake8 264 | ;; # and importmagic for automatic imports 265 | ;; pip install importmagic 266 | (use-package elpy 267 | :config 268 | (elpy-enable)) 269 | 270 | ;; set the $PATH from shell 271 | (defun set-exec-path-from-shell-PATH () 272 | (let ((path-from-shell (replace-regexp-in-string 273 | "[ \t\n]*$" 274 | "" 275 | (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'")))) 276 | (setenv "PATH" path-from-shell) 277 | (setq eshell-path-env path-from-shell) ; for eshell users 278 | (setq exec-path (split-string path-from-shell path-separator)))) 279 | 280 | (when window-system (set-exec-path-from-shell-PATH)) 281 | 282 | ;; Setup per mode hooks 283 | ;; untabify some modes 284 | (setq untabify-modes '(python-mode emacs-lisp-mode lisp-mode)) 285 | (defun untabify-hook () 286 | (when (member major-mode untabify-modes) 287 | (untabify (point-min) (point-max)))) 288 | (add-hook 'before-save-hook 'untabify-hook) 289 | -------------------------------------------------------------------------------- /vim/autoload/pathogen.vim: -------------------------------------------------------------------------------- 1 | " pathogen.vim - path option manipulation 2 | " Maintainer: Tim Pope 3 | " Version: 2.4 4 | 5 | " Install in ~/.vim/autoload (or ~\vimfiles\autoload). 6 | " 7 | " For management of individually installed plugins in ~/.vim/bundle (or 8 | " ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your 9 | " .vimrc is the only other setup necessary. 10 | " 11 | " The API is documented inline below. 12 | 13 | if exists("g:loaded_pathogen") || &cp 14 | finish 15 | endif 16 | let g:loaded_pathogen = 1 17 | 18 | " Point of entry for basic default usage. Give a relative path to invoke 19 | " pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke 20 | " pathogen#surround(). Curly braces are expanded with pathogen#expand(): 21 | " "bundle/{}" finds all subdirectories inside "bundle" inside all directories 22 | " in the runtime path. 23 | function! pathogen#infect(...) abort 24 | for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}'] 25 | if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]' 26 | call pathogen#surround(path) 27 | elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)' 28 | call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') 29 | call pathogen#surround(path . '/{}') 30 | elseif path =~# '[{}*]' 31 | call pathogen#interpose(path) 32 | else 33 | call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') 34 | call pathogen#interpose(path . '/{}') 35 | endif 36 | endfor 37 | call pathogen#cycle_filetype() 38 | if pathogen#is_disabled($MYVIMRC) 39 | return 'finish' 40 | endif 41 | return '' 42 | endfunction 43 | 44 | " Split a path into a list. 45 | function! pathogen#split(path) abort 46 | if type(a:path) == type([]) | return a:path | endif 47 | if empty(a:path) | return [] | endif 48 | let split = split(a:path,'\\\@]','\\&','') 244 | endif 245 | endfunction 246 | 247 | " Like findfile(), but hardcoded to use the runtimepath. 248 | function! pathogen#runtime_findfile(file,count) abort 249 | let rtp = pathogen#join(1,pathogen#split(&rtp)) 250 | let file = findfile(a:file,rtp,a:count) 251 | if file ==# '' 252 | return '' 253 | else 254 | return fnamemodify(file,':p') 255 | endif 256 | endfunction 257 | 258 | " Section: Deprecated 259 | 260 | function! s:warn(msg) abort 261 | echohl WarningMsg 262 | echomsg a:msg 263 | echohl NONE 264 | endfunction 265 | 266 | " Prepend all subdirectories of path to the rtp, and append all 'after' 267 | " directories in those subdirectories. Deprecated. 268 | function! pathogen#runtime_prepend_subdirectories(path) abort 269 | call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')') 270 | return pathogen#surround(a:path . pathogen#slash() . '{}') 271 | endfunction 272 | 273 | function! pathogen#incubate(...) abort 274 | let name = a:0 ? a:1 : 'bundle/{}' 275 | call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')') 276 | return pathogen#interpose(name) 277 | endfunction 278 | 279 | " Deprecated alias for pathogen#interpose(). 280 | function! pathogen#runtime_append_all_bundles(...) abort 281 | if a:0 282 | call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')') 283 | else 284 | call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()') 285 | endif 286 | return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}') 287 | endfunction 288 | 289 | if exists(':Vedit') 290 | finish 291 | endif 292 | 293 | let s:vopen_warning = 0 294 | 295 | function! s:find(count,cmd,file,lcd) 296 | let rtp = pathogen#join(1,pathogen#split(&runtimepath)) 297 | let file = pathogen#runtime_findfile(a:file,a:count) 298 | if file ==# '' 299 | return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'" 300 | endif 301 | if !s:vopen_warning 302 | let s:vopen_warning = 1 303 | let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE' 304 | else 305 | let warning = '' 306 | endif 307 | if a:lcd 308 | let path = file[0:-strlen(a:file)-2] 309 | execute 'lcd `=path`' 310 | return a:cmd.' '.pathogen#fnameescape(a:file) . warning 311 | else 312 | return a:cmd.' '.pathogen#fnameescape(file) . warning 313 | endif 314 | endfunction 315 | 316 | function! s:Findcomplete(A,L,P) 317 | let sep = pathogen#slash() 318 | let cheats = { 319 | \'a': 'autoload', 320 | \'d': 'doc', 321 | \'f': 'ftplugin', 322 | \'i': 'indent', 323 | \'p': 'plugin', 324 | \'s': 'syntax'} 325 | if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0]) 326 | let request = cheats[a:A[0]].a:A[1:-1] 327 | else 328 | let request = a:A 329 | endif 330 | let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*' 331 | let found = {} 332 | for path in pathogen#split(&runtimepath) 333 | let path = expand(path, ':p') 334 | let matches = split(glob(path.sep.pattern),"\n") 335 | call map(matches,'isdirectory(v:val) ? v:val.sep : v:val') 336 | call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]') 337 | for match in matches 338 | let found[match] = 1 339 | endfor 340 | endfor 341 | return sort(keys(found)) 342 | endfunction 343 | 344 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(,'edit',,0) 345 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(,'edit',,0) 346 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(,'edit',,1) 347 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(,'split',,1) 348 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(,'vsplit',,1) 349 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(,'tabedit',,1) 350 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(,'pedit',,1) 351 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(,'read',,1) 352 | 353 | " vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=': 354 | --------------------------------------------------------------------------------