-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvimrc
More file actions
142 lines (113 loc) · 3.58 KB
/
vimrc
File metadata and controls
142 lines (113 loc) · 3.58 KB
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
" ----------
" Vim Config
" ----------
"
"
" How this works:
"
" This file is minimal. Most of the vim settings and initialization is in
" several files in .vim/init. This makes it easier to find things and to
" merge between branches and repos.
"
" Please do not add configuration to this file, unless it *really* needs to
" come first or last, like Pathogen and sourcing the machine-local config.
" Instead, add it to one of the files in .vim/init, or create a new one.
" Pathogen (This must happen first.)
" --------
filetype off " Avoid a Vim/Pathogen bug
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
set nocompatible " Don't maintain compatibility with vi
syntax on " Highlight known syntaxes
filetype plugin indent on
" Source initialization files
" ---------------------------
runtime! init/**.vim
" Machine-local vim settings - keep this at the end
" --------------------------
silent! source ~/.vimrc.local
set background=dark
"set background=light
"set mouse-=a
"let g:solarized_termcolors=16
if has('gui_running')
"colorscheme solarized
"set background=dark
set guifont=Source\ Code\ Pro\ 9
endif
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
colorscheme monokai_lumpy
"let g:jsbeautify = {'indent_size': 2, 'indent_char': ' '}
"autocmd FileType javascript nmap <leader>= :call JsBeautify()<CR>
"set guifont=Monospace
set cursorcolumn
set cursorline
hi CursorLine cterm=NONE ctermbg=238
hi CursorColumn cterm=NONE ctermbg=238
set foldmethod=syntax
set foldlevelstart=100
set novisualbell
"set t_vb=
" tab navigation like firefox
nnoremap <C-S-tab> :tabprevious<CR>
nnoremap <C-tab> :tabnext<CR>
nnoremap <C-t> :tabnew<CR>
inoremap <C-S-tab> <Esc>:tabprevious<CR>i
inoremap <C-tab> <Esc>:tabnext<CR>i
inoremap <C-t> <Esc>:tabnew<CR>
map <ESC>[1;5C <C-Right>
map <ESC>[1;5D <C-Left>
map! <ESC>[1;5C <C-Right>
map! <ESC>[1;5D <C-Left>
set fileformat=unix
set updatetime=250
augroup autoformat_settings
"autocmd FileType c,cpp,proto,javascript AutoFormatBuffer clang-format
augroup END
let g:codefmt_clang_format_style = 'Google'
set nolist
set ignorecase
let g:ctrlp_max_files = 0
let g:ctrlp_custom_ignore = {
\ 'dir': 'node_modules\|dist$',
\ }
set diffopt+=vertical
let g:lasttab = 1
nmap <Leader>f :ALEFix<CR>
nmap <Leader>t :exe "tabn ".g:lasttab<CR>
nnoremap `` :exe "tabn ".g:lasttab<CR>
au TabLeave * let g:lasttab = tabpagenr()
" use a more readable color for Linter warnings/errors than the default bright
" orange
"highlight ALEError ctermbg=160 ctermfg=234
"highlight ALEWarning ctermbg=166 ctermfg=234
highlight ALEError ctermbg=none cterm=underline ctermfg=208
highlight ALEWarning ctermbg=none cterm=underline ctermfg=208
let g:ale_echo_msg_format = '%linter% says %s'
let g:ale_linters = {
\ 'javascript': [ 'eslint' ],
\ 'typescript': [ 'tslint', 'eslint', 'tsserver' ],
\}
let g:ale_fixers = {
\ 'javascript': [ 'eslint' ],
\ 'typescript': [ 'tslint', 'eslint' ],
\}
let g:gitgutter_max_signs = 2000
" security. :(
set modelines=0
set nomodeline
" The Silver Searcher
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' " ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
command! -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
nmap <leader>d :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>" Ack
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
cabbrev Ack Ack!