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