-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdotvimrc
More file actions
129 lines (108 loc) · 3.23 KB
/
dotvimrc
File metadata and controls
129 lines (108 loc) · 3.23 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
set number
set autoindent
set tabstop=2
set shiftwidth=4
set expandtab
set softtabstop=0
set smarttab
set noswapfile
set nowrap
set showcmd
set backspace=indent,eol,start
set smartcase
set showtabline=2
set modeline
set modelines=5
set cindent
syntax on
map <C-h> <C-w>h
map <C-l> <C-w>l
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-t> <C-w>v
map <C-n> <C-w>v
map <C-s> <C-w>s
" Old python setup no expand code
function! SetupPython()
setlocal noexpandtab shiftwidth=2 softtabstop=0 tabstop=2
endfunction
fun! StripTrailingWhitespace()
" Only strip if the b:noStripeWhitespace variable isn't set
if exists('b:noStripWhitespace')
return
endif
%s/\s\+$//e
endfun
if has("autocmd")
" Enable filetype detection
filetype plugin indent on
" Restore cursor position
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
autocmd Filetype go compiler go
autocmd VimEnter * set vb t_vb=
" autocmd FileType python call SetupPython()
" autocmd FileType pug call SetupPython()
autocmd BufWritePre * call StripTrailingWhitespace()
autocmd FileType markdown let b:noStripWhitespace=1
endif
autocmd Filetype c setlocal noexpandtab shiftwidth=2
" 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
" bind K to grep word under cursor
nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
let g:golang_onwrite = 0
let g:go_def_mapping_enabled = 0
let g:golang_goroot = "/Users/erik/code/go/"
cnoreabbrev W w
cnoreabbrev E e
cnoreabbrev Q q
command W w
nmap ; :
noremap ;; ;
autocmd Filetype javascript setlocal noexpandtab
set undofile
set undodir="/Users/erik/.undos/
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
set statusline+=%F
set re=0
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_jshint_args = "--config ~/.jshint-config"
let g:syntastic_python_checkers = ['flake8']
let g:syntastic_go_checkers = [ 'gofmt', 'golint']
let g:syntastic_python_flake8_args = "--ignore=E111,E117,E121,E122,E123,E124,E126,E127,E128,E131,E265,E302,E501,E999,E711,F405,F403,E741,W191"
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_java_checkers = ['checkstyle']
" let g:syntastic_javascript_eslint_exe = 'npm run lint --'
let g:python_recommended_style = 0
let g:vim_markdown_folding_disabled = 1
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|\.git\|\.pyc'
let g:syntastic_c_checkers = ['gcc', 'make']
let g:syntastic_c_remove_include_errors = 1
map <C-a> <Nop>
" Install vim-plug if not found
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
" Must be installed with :PlugInstall!
call plug#begin()
Plug 'ctrlpvim/ctrlp.vim'
Plug 'vim-syntastic/syntastic/'
Plug 'fatih/vim-go'
Plug 'prabirshrestha/vim-lsp'
call plug#end()