-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
183 lines (149 loc) · 4.07 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
"NeoBundle Scripts-----------------------------
if has('vim_starting')
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('~/.vim/bundle'))
" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'
" Add or remove your Bundles here:
NeoBundle 'Shougo/vimproc.vim', {
\ 'build' : {
\ 'windows' : 'tools\\update-dll-mingw',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'linux' : 'make',
\ 'unix' : 'gmake',
\ },
\ }
NeoBundle 'Shougo/unite.vim'
NeoBundle 'godlygeek/tabular'
NeoBundle 'bling/vim-airline'
NeoBundle 'tpope/vim-endwise'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'tpope/vim-surround'
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'scrooloose/syntastic'
NeoBundle 'scrooloose/nerdcommenter'
NeoBundle 'pangloss/vim-javascript'
NeoBundle 'terryma/vim-multiple-cursors'
NeoBundle 'jbohren-forks/vim-gitgutter'
NeoBundle 'slim-template/vim-slim'
NeoBundle 'junegunn/vim-easy-align'
NeoBundle 'tpope/vim-rails'
NeoBundle 'kien/ctrlp.vim'
NeoBundle 'kchmck/vim-coffee-script'
" You can specify revision/branch/tag.
NeoBundle 'Shougo/vimshell'
" Required:
call neobundle#end()
" Required:
filetype plugin indent on
" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck
"End NeoBundle Scripts-------------------------
" Standard settings "
"""""""""""""""""""""
syntax on
set background=dark
let g:solarized_termtrans=1
let g:solarized_termcolors=16
colorscheme solarized
set number " show line numbers
set ruler
set expandtab
set warn
set autoindent
set smartcase
set hlsearch
set showcmd " show command in bottom bar
set showmatch " highlight matching [{()}]
set incsearch
set wildmenu " visual autocomplete for command menu
set mouse=a
set tabstop=2
set shiftwidth=2
set list " Show `listchars` characters
set listchars=tab:=»,trail:·
set laststatus=2
set fillchars+=vert:\
set cc=121
set textwidth=0
set wrapmargin=0
set backspace=indent,eol,start
" Custom settings "
"""""""""""""""""""
" Unite mappings
nnoremap <C-o> :Unite file_rec/async<cr>
nnoremap <C-f> :Unite grep:.<cr>
nnoremap <C-b> :Unite buffer<cr>
call unite#filters#matcher_default#use(['matcher_fuzzy'])
nnoremap <leader>r :<C-u>Unite -start-insert file_rec/async:!<CR>
" Some Ctrlp settings until Unite takes over
" Ctrl-P
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" CtrlP settings
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_custom_ignore = '\v[\/](node_modules)$'
let g:ctrlp_prompt_mappings = {
\ 'AcceptSelection("e")': ['<c-t>'],
\ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'],
\ }
" Powerline font support
let g:airline_powerline_fonts = 1
" Custom Mappings "
"""""""""""""""""""
" One less keystroke!
map ; :
map ;; ;
map Y y$
" System's clipboard integration
map <leader>p "+p
map <leader>y "+y
" NerdTree plugin
nmap <leader>f :NERDTreeToggle
nmap <leader>F :NERDTreeFind
"nnoremap <esc> :noh<return><esc>
:noremap <Space>n :cnext<C-m>
:noremap <Space>p :cprev<C-m>
hi VertSplit guibg=#000000 gui=NONE guifg=#414243 ctermfg=235
hi NonText ctermfg=238
" Default mapping
let g:multi_cursor_next_key='<C-n>'
let g:multi_cursor_prev_key='<C-S-p>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'
" Tabularize mappings
if exists(":Tabularize")
nmap <Leader>a= :Tabularize /=<CR>
vmap <Leader>a= :Tabularize /=<CR>
endif
" Gitgutter
highlight clear SignColumn
let g:gitgutter_sign_column_always = 1
" Strip whitespace on write
fun! StripTrailingWhitespace()
if &ft =~ 'vim\|vimrc'
return
endif
%s/\s\+$//e
endfun
autocmd BufWritePre * call StripTrailingWhitespace()
" String trailing empty newlines on write
fun! StripTrailingNewlines()
%s/\($\n\s*\)\+\%$//e
endfun
autocmd BufWritePre * call StripTrailingNewlines()
" FZF
set rtp+=~/.fzf
" EasyAlign
vmap <Enter> <Plug>(EasyAlign)
"
autocmd filetype crontab setlocal nobackup nowritebackup