馃悷 My personal dotfiles
1set nocompatible
2set encoding=utf-8
3
4call plug#begin('~/.vim/plugged')
5
6" Theming
7Plug 'chriskempson/tomorrow-theme', { 'rtp': 'vim' }
8Plug 'junegunn/goyo.vim'
9Plug 'vim-airline/vim-airline'
10Plug 'vim-airline/vim-airline-themes'
11Plug 'bogado/file-line'
12Plug 'myusuf3/numbers.vim'
13Plug 'airblade/vim-gitgutter'
14
15" Syntaxes
16Plug 'ekalinin/Dockerfile.vim', { 'for': 'dockerfile' }
17Plug 'tpope/vim-haml', { 'for': 'haml' }
18Plug 'tpope/vim-markdown', { 'for': 'markdown' }
19Plug 'tpope/vim-rails', { 'for': 'ruby' }
20Plug 'stephencelis/vim-mml', { 'for': 'mml' }
21
22" Utilities
23Plug 'tpope/vim-bundler', { 'on': 'Bundle' }
24Plug 'tpope/vim-commentary'
25Plug 'tpope/vim-dispatch', { 'on': 'Dispatch' }
26Plug 'tpope/vim-endwise'
27Plug 'tpope/vim-fugitive'
28Plug 'tpope/vim-surround'
29Plug 'rking/ag.vim', { 'on': 'Ag' }
30Plug 'jiangmiao/auto-pairs'
31Plug 'kien/ctrlp.vim'
32Plug 'JazzCore/ctrlp-cmatcher'
33
34call plug#end()
35
36" Speed
37nnoremap ; :
38
39" Theme/Colors
40syntax on
41
42silent! colorscheme Tomorrow-Night
43set background=dark
44set cursorline
45set nowrap
46set numberwidth=4
47set visualbell
48
49highlight ColorColumn ctermbg=233
50call matchadd('ColorColumn', '\%81v', 100)
51set list
52set listchars=""
53set listchars=tab:\ \
54set listchars+=trail:.
55set listchars+=extends:>
56set listchars+=precedes:<
57
58set wildmenu
59set wildmode=list:longest,full
60
61" Indentation
62set autoindent
63set expandtab
64set shiftwidth=2
65set smartindent
66set tabstop=2
67
68" Searching
69set ignorecase
70set smartcase
71set hlsearch
72set incsearch
73
74" Code folding
75set foldmethod=syntax
76set foldminlines=3
77set foldlevel=100
78
79" Ignore tmp/ directories
80set wildignore+=*/tmp/*
81
82" Interaction
83set backspace=indent,eol,start
84set laststatus=2
85set number
86set scrolloff=3
87set sidescrolloff=5
88set showcmd
89
90" Undo
91set undodir=~/.vim/tmp
92set undofile
93set undolevels=1000
94set undoreload=10000
95
96set backupdir=~/.vim/tmp
97set directory=~/.vim/tmp
98
99" git
100hi def link gitcommitOverflow WarningMsg
101
102" Make
103au FileType make setlocal noexpandtab
104
105" Markdown
106function! s:Wrap()
107 set wrap linebreak nolist
108 set textwidth=120
109 call matchadd('ColorColumn', '\%121v', 100)
110endfunction
111
112autocmd BufWritePre * :%s/\s\+$//e
113autocmd BufRead,BufNewFile *.md set filetype=markdown
114au FileType markdown call s:Wrap()
115
116" Mml
117augroup myvimrc
118 au!
119 autocmd FileType mml nnoremap <leader>m :w<cr>:MmlMake<cr>
120augroup END
121
122" Ctrl-P
123let g:ctrlp_user_command = ['.git/', 'cd %s && git ls-files --exclude-standard -co']
124let g:ctrlp_match_func = {'match' : 'matcher#cmatch' }
125
126" Dispatch
127augroup dispatch
128 au!
129 autocmd BufNewFile,BufRead *_spec.rb compiler rspec
130 autocmd BufNewFile,BufRead *_spec.rb set makeprg=bundle\ exec\ rspec\ %
131 autocmd BufNewFile,BufRead *_test.rb compiler rake
132 autocmd BufNewFile,BufRead *_test.rb set makeprg=bundle\ exec\ rake\ minitest\ TEST=%
133augroup END
134
135" Airline
136let g:airline_powerline_fonts=1
137let g:airline_theme='base16'