├── .aliases.sh ├── .config └── nvim │ ├── bundle.vim │ ├── config │ ├── autocmds.vim │ ├── bindings.vim │ └── plugin │ │ ├── all.vim │ │ ├── deoplete.vim │ │ ├── unite.vim │ │ └── vimfiler.vim │ ├── init.vim │ └── snips │ └── javascript.snippets ├── .tmux.conf ├── .zshrc ├── install.sh └── readme.md /.aliases.sh: -------------------------------------------------------------------------------- 1 | # Git 2 | alias gi="git init" 3 | alias gs="git status" 4 | alias gd="git diff" 5 | alias gdh="git diff HEAD" 6 | alias gc="git clone $1 $2" 7 | alias gcm="git commit -m "$1"" 8 | alias gaa="git add -A ." 9 | alias gpo="git push origin $1" 10 | alias gl="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" 11 | alias glo="git log --oneline" 12 | alias grhh="git reset --hard HEAD" 13 | alias gcp="git cherry-pick $1" 14 | 15 | # npm 16 | alias ni="npm install"; 17 | alias nis="npm i -S " 18 | alias nid="npm i -D " 19 | alias nig="npm i -g " 20 | alias nr="npm run $1"; 21 | alias nrs="npm run start"; 22 | alias nrb="npm run build"; 23 | alias nrt="npm run test"; 24 | alias nrc="npm run commit"; 25 | 26 | # Clipboard 27 | alias setclip='xclip -selection c' 28 | alias getclip='xclip -selection clipboard -o' 29 | 30 | # Files 31 | alias l="ls -o -hX --group-directories-first" 32 | alias la="ls -o -AhX --group-directories-first" 33 | alias j="jump" 34 | alias v='nvim' 35 | alias vim='nvim' 36 | -------------------------------------------------------------------------------- /.config/nvim/bundle.vim: -------------------------------------------------------------------------------- 1 | " General 2 | NeoBundle 'tpope/vim-surround' 3 | NeoBundle 'tpope/vim-commentary' 4 | NeoBundle 'tpope/vim-unimpaired' 5 | NeoBundle 'tpope/vim-eunuch' 6 | NeoBundle 'tpope/vim-repeat' 7 | NeoBundle 'vim-airline/vim-airline' 8 | NeoBundle 'SirVer/ultisnips' 9 | NeoBundle 'airblade/vim-gitgutter' 10 | NeoBundleLazy 'benekastah/neomake', {'on_cmd': 'Neomake'} 11 | NeoBundle 'christoomey/vim-tmux-navigator' 12 | NeoBundleLazy 'Raimondi/delimitMate', {'on_i': 1} 13 | NeoBundleLazy 'Shougo/deoplete.nvim', { 'on_i': 1 } 14 | 15 | " Unite 16 | NeoBundle 'Shougo/vimproc.vim', { 'build' : 'make' } 17 | NeoBundleLazy 'Shougo/unite.vim', { 'on_cmd': 'Unite' } 18 | NeoBundleLazy 'Shougo/vimfiler.vim', { 'depends': 'Shougo/unite.vim', } 19 | 20 | " JavaScript 21 | NeoBundle 'moll/vim-node' 22 | NeoBundleLazy 'mxw/vim-jsx', {'on_ft': 'javascript'} 23 | NeoBundleLazy 'othree/yajs.vim', {'on_ft': 'javascript'} 24 | NeoBundleLazy 'othree/es.next.syntax.vim', {'on_ft': 'javascript'} 25 | NeoBundleLazy 'gavocanov/vim-js-indent', {'on_ft': 'javascript'} 26 | NeoBundleLazy 'carlitux/deoplete-ternjs', { 'on_ft': 'javascript', 'on_i': 1 } 27 | 28 | " Markdown 29 | NeoBundleLazy 'plasticboy/vim-markdown', {'on_ft': 'markdown'} 30 | NeoBundleLazy 'dhruvasagar/vim-table-mode', {'on_ft': 'markdown'} 31 | NeoBundleLazy 'junegunn/goyo.vim', {'on_cmd': 'Goyo'} 32 | 33 | " Syntax 34 | NeoBundleLazy 'tmux-plugins/vim-tmux', {'on_ft': 'tmux'} 35 | -------------------------------------------------------------------------------- /.config/nvim/config/autocmds.vim: -------------------------------------------------------------------------------- 1 | autocmd FileType help wincmd L 2 | au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif 3 | au FocusGained,BufEnter * :silent! ! 4 | au VimResized * :wincmd = 5 | aug QFClose 6 | au! 7 | au WinEnter * if winnr('$') == 1 && getbufvar(winbufnr(winnr()), "&buftype") == "quickfix"|q|endif 8 | aug END 9 | 10 | -------------------------------------------------------------------------------- /.config/nvim/config/bindings.vim: -------------------------------------------------------------------------------- 1 | let mapleader = "\" 2 | 3 | noremap Q q 4 | nnoremap gQ : 5 | 6 | noremap (line("w$") >= line('$') ? "j" : "3\") 7 | noremap (line("w0") <= 1 ? "k" : "3\") 8 | 9 | nnoremap * *N 10 | nnoremap J mzJ`z 11 | nnoremap w :w 12 | nnoremap coh :nohl 13 | nnoremap n nzz 14 | 15 | nmap gp `[v`] 16 | nmap s [Window] 17 | nnoremap [Window]p :vsplit:wincmd w 18 | noremap q winnr('$') != 1 ? ':close' : "" 19 | nnoremap :wincmd w 20 | 21 | autocmd FileType vim nnoremap :so ~/.config/nvim/init.vim 22 | 23 | nnoremap :m .+1== 24 | nnoremap :m .-2== 25 | -------------------------------------------------------------------------------- /.config/nvim/config/plugin/all.vim: -------------------------------------------------------------------------------- 1 | if neobundle#tap('unite.vim') 2 | nmap \ [unite] 3 | nnoremap [unite]r :UniteResume -no-start-insert -force-redraw 4 | nnoremap [unite]g :Unite grep:. 5 | nnoremap [unite]f :Unite file_rec/async 6 | nnoremap [unite]e :VimFiler -find 7 | let neobundle#hooks.on_source = '~/.config/nvim/config/plugin/unite.vim' 8 | call neobundle#untap() 9 | endif 10 | 11 | if neobundle#tap('vimfiler.vim') 12 | let neobundle#hooks.on_source = '~/.config/nvim/config/plugin/vimfiler.vim' 13 | call neobundle#untap() 14 | endif 15 | 16 | if neobundle#tap('deoplete.nvim') && has('nvim') "{{{ 17 | let g:deoplete#enable_at_startup = 1 18 | let neobundle#hooks.on_source = '~/.config/nvim/config/plugin/deoplete.vim' 19 | call neobundle#untap() 20 | endif 21 | 22 | if neobundle#is_installed('vim-table-mode') 23 | let g:table_mode_corner="|" 24 | endif 25 | 26 | if neobundle#is_installed('vim-jsx') 27 | let g:jsx_ext_required = 0 28 | endif 29 | 30 | if neobundle#is_installed('vim-gitgutter') 31 | let g:gitgutter_sign_column_always = 1 32 | set updatetime=250 33 | let g:gitgutter_sign_added = '▎' 34 | let g:gitgutter_sign_modified = '▎' 35 | let g:gitgutter_sign_removed= '▎' 36 | endif 37 | 38 | if neobundle#is_installed('delimitMate') 39 | let delimitMate_expand_cr = 1 40 | endif 41 | 42 | if neobundle#is_installed('vim-markdown') 43 | let g:vim_markdown_folding_disabled = 1 44 | endif 45 | 46 | if neobundle#is_installed('ultisnips') 47 | let g:UltiSnipsExpandTrigger="" 48 | let g:UltiSnipsJumpForwardTrigger="" 49 | let g:UltiSnipsJumpBackwardTrigger="" 50 | let g:UltiSnipsSnippetDirectories=['snips'] 51 | endif 52 | 53 | 54 | if neobundle#is_installed('vim-airline') 55 | set laststatus=2 56 | set noshowmode 57 | let g:airline#extensions#tabline#fnamemod = ':t' 58 | let g:airline_powerline_fonts = 1 59 | let g:airline_left_sep='' 60 | let g:airline_right_sep='' 61 | let g:airline#extensions#tabline#left_sep = '' 62 | let g:airline#extensions#tabline#left_alt_sep = '' 63 | let g:airline_section_z = '%3p%%' 64 | let g:airline_section_y = '' 65 | let g:airline_section_b = '' 66 | let g:airline_mode_map = { 67 | \ '__' : '-', 68 | \ 'n' : 'N', 69 | \ 'i' : 'I', 70 | \ 'R' : 'R', 71 | \ 'c' : 'C', 72 | \ 'v' : 'V', 73 | \ 'V' : 'V', 74 | \ '' : 'V', 75 | \ 's' : 'S', 76 | \ 'S' : 'S', 77 | \ '' : 'S', 78 | \ } 79 | endif 80 | 81 | if neobundle#is_installed('neomake') 82 | function! ResolveESLint() 83 | let l:npm_bin = '' 84 | let l:eslint = 'eslint' 85 | if executable('npm') 86 | let l:npm_bin = split(system('npm bin'), '\n')[0] 87 | endif 88 | if strlen(l:npm_bin) && executable(l:npm_bin . '/eslint') 89 | let l:eslint = l:npm_bin . '/eslint' 90 | endif 91 | let b:neomake_javascript_eslint_exe = l:eslint 92 | endfunction 93 | autocmd FileType javascript :call ResolveESLint() 94 | autocmd! BufWritePost,BufReadPost * Neomake 95 | let g:neomake_javascript_enabled_makers = ['eslint'] 96 | let g:neomake_warning_sign = { 97 | \ 'text': 'W', 98 | \ 'texthl': 'WarningMsg', 99 | \ } 100 | let g:neomake_error_sign = { 101 | \ 'text': 'E', 102 | \ 'texthl': 'ErrorMsg', 103 | \ } 104 | let g:neomake_open_list = 2 105 | endif 106 | -------------------------------------------------------------------------------- /.config/nvim/config/plugin/deoplete.vim: -------------------------------------------------------------------------------- 1 | let g:deoplete#auto_completion_start_length = 2 2 | -------------------------------------------------------------------------------- /.config/nvim/config/plugin/unite.vim: -------------------------------------------------------------------------------- 1 | let g:unite_enable_auto_select = 1 2 | 3 | call unite#custom#profile('default', 'context', { 4 | \ 'start_insert': 1, 5 | \ 'no_split': 1, 6 | \ 'prompt' : '→ ', 7 | \ }) 8 | 9 | call unite#custom#profile('navigate,source/grep,source/tag', 'context', { 10 | \ 'start_insert': 0, 11 | \ }) 12 | 13 | if executable('ag') 14 | let s:custom_ag_ignore_arguments= [ 15 | \ '--ignore', 16 | \ 'node_modules', 17 | \ '--ignore', 18 | \ '.git' 19 | \ ] 20 | let g:unite_source_rec_async_command = [ 21 | \ 'ag', 22 | \ '--follow', 23 | \ '--nocolor', 24 | \ '--nogroup', 25 | \ '--hidden', 26 | \ '--ignore-case', 27 | \ '-g', 28 | \ '' 29 | \ ] + s:custom_ag_ignore_arguments 30 | let g:unite_source_grep_command = 'ag' 31 | let g:unite_source_grep_default_opts = join([ 32 | \ '--nogroup', 33 | \ '--vimgrep', 34 | \ '--nocolor', 35 | \ '--ignore-case' 36 | \ ] + s:custom_ag_ignore_arguments) 37 | endif 38 | 39 | function! s:apply_unite_win_settings() 40 | imap (unite_select_next_line) 41 | imap (unite_select_previous_line) 42 | " Attempt to unbind c-l and c-k so TmuxNavigator can use them... 43 | " silent! nunmap 44 | " silent! nunmap 45 | endfunction 46 | autocmd FileType unite call s:apply_unite_win_settings() 47 | -------------------------------------------------------------------------------- /.config/nvim/config/plugin/vimfiler.vim: -------------------------------------------------------------------------------- 1 | function! s:apply_vimfiler_win_settings() 2 | setlocal nonumber norelativenumber 3 | 4 | nmap e (vimfiler_expand_or_edit) 5 | endfunction 6 | autocmd FileType vimfiler call s:apply_vimfiler_win_settings() 7 | -------------------------------------------------------------------------------- /.config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | function! s:install_neobundle() 2 | if (!isdirectory(expand("$HOME/.config/nvim/bundle/neobundle.vim"))) 3 | echo 'Downloading NeoBundle. Please wait...' 4 | call system(expand("mkdir -p $HOME/.config/nvim/bundle")) 5 | call system(expand("git clone https://github.com/Shougo/neobundle.vim ~/.config/nvim/bundle/neobundle.vim")) 6 | echo 'NeoBundle has been downloaded...' 7 | endif 8 | if has('vim_starting') 9 | set runtimepath+=/home/booker/.config/nvim/bundle/neobundle.vim/ 10 | endif 11 | call neobundle#begin() 12 | NeoBundleFetch 'Shougo/neobundle.vim' 13 | source ~/.config/nvim/bundle.vim 14 | call neobundle#end() 15 | NeoBundleCheck 16 | endfunction 17 | call s:install_neobundle() 18 | 19 | let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 20 | filetype plugin indent on 21 | let base16colorspace=256 22 | syntax enable 23 | colorscheme base16-gooey 24 | 25 | set background=dark 26 | set number 27 | set clipboard=unnamed 28 | set relativenumber 29 | set tabstop=2 30 | set smartcase 31 | set expandtab 32 | set shiftwidth=2 33 | set noswapfile 34 | set cc=79 35 | set undofile 36 | set undodir=~/.config/nvim/temp/undodir 37 | set completeopt-=preview 38 | 39 | source ~/.config/nvim/config/plugin/all.vim 40 | source ~/.config/nvim/config/bindings.vim 41 | source ~/.config/nvim/config/autocmds.vim 42 | -------------------------------------------------------------------------------- /.config/nvim/snips/javascript.snippets: -------------------------------------------------------------------------------- 1 | snippet im 2 | import ${1} from '${2}'${0} 3 | endsnippet 4 | 5 | snippet log 6 | console.log(${0}) 7 | endsnippet 8 | 9 | snippet fun 10 | function (${1}) { 11 | ${0} 12 | } 13 | endsnippet 14 | 15 | snippet if 16 | if (${1}) { 17 | ${0} 18 | } 19 | endsnippet 20 | 21 | snippet ed 22 | export default ${0} 23 | endsnippet 24 | 25 | snippet test 26 | test(${1}t => { 27 | ${0} 28 | }) 29 | endsnippet 30 | 31 | 32 | snippet aget 33 | app.get('${1}', function(req, res) { 34 | ${0} 35 | }) 36 | endsnippet 37 | 38 | snippet class 39 | class ${1} { 40 | ${0} 41 | } 42 | endsnippet 43 | 44 | snippet try 45 | try { 46 | ${1} 47 | } catch (err) { 48 | ${0} 49 | } 50 | endsnippet 51 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | # Colours 2 | tm_yellow=colour03 3 | tm_gray=colour08 4 | tm_purple=colour05 5 | tm_black=colour00 6 | tm_green=colour10 7 | 8 | # General 9 | set -g prefix C-Space 10 | set -g base-index 1 11 | set -g pane-base-index 1 12 | set -g renumber-windows on 13 | set -g allow-rename off 14 | set -g status-justify right 15 | set -g status-position bottom 16 | 17 | # Keyboard 18 | set-window-option -g mode-keys vi 19 | bind-key -t vi-copy 'v' begin-selection 20 | bind-key , command-prompt "rename-window '%%'" 21 | bind-key & command-prompt "kill-window" 22 | 23 | # Status settings 24 | set -g status-bg default 25 | set -g status-right "" 26 | set -g @prefix_highlight_fg 'black' 27 | set -g @prefix_highlight_bg 'yellow' 28 | tm_session_name="#[fg=$tm_gray]Session #S" 29 | tm_prefix="#{prefix_highlight}" 30 | set -g status-left $tm_prefix' '$tm_session_name 31 | 32 | # Pane colours 33 | set -g pane-border-fg $tm_gray 34 | set -g pane-active-border-fg $tm_purple 35 | 36 | # Message colours 37 | set -g message-bg $tm_green 38 | set -g message-fg $tm_black 39 | 40 | # Pane border settings 41 | set -g display-panes-active-colour $tm_yellow 42 | set -g display-panes-colour $tm_gray 43 | 44 | # Inactive window colours and settings 45 | set-window-option -g window-status-fg $tm_gray 46 | set-window-option -g window-status-bg default 47 | set -g window-status-format "#W" 48 | 49 | # Active window settings 50 | set-window-option -g window-status-current-fg $tm_yellow 51 | set-window-option -g window-status-current-bg default 52 | set-window-option -g window-status-current-format "#[bold]#W" 53 | 54 | # Vim Tmux Navigator 55 | is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"' 56 | bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" 57 | bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" 58 | bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" 59 | bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" 60 | bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" 61 | 62 | # Tmux Plugin Manager 63 | set -g @plugin 'tmux-plugins/tpm' 64 | set -g @plugin 'tmux-plugins/tmux-sensible' 65 | set -g @plugin 'tmux-plugins/tmux-pain-control' 66 | set -g @plugin 'tmux-plugins/tmux-yank' 67 | set -g @plugin 'tmux-plugins/tmux-prefix-highlight' 68 | run '~/.tmux/plugins/tpm/tpm' 69 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | source ~/.aliases.sh 2 | source $(brew --prefix)/share/antigen.zsh 3 | 4 | antigen use oh-my-zsh 5 | antigen bundle zsh-users/zsh-syntax-highlighting 6 | antigen bundle mafredri/zsh-async 7 | antigen bundle sindresorhus/pure 8 | antigen bundle jump 9 | antigen apply 10 | 11 | export EDITOR=nvim 12 | 13 | 14 | export NVM_DIR="/Users/booker/.nvm" 15 | [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm 16 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | ask() { 5 | while true; do 6 | if [ "${2:-}" = "Y" ]; then 7 | prompt="Y/n" 8 | default=Y 9 | elif [ "${2:-}" = "N" ]; then 10 | prompt="y/N" 11 | default=N 12 | else 13 | prompt="y/n" 14 | default= 15 | fi 16 | read -p "$1 [$prompt] " REPLY