-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
135 lines (105 loc) · 3.24 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
call plug#begin('~/.vim/plugged')
Plug 'ctrlpvim/ctrlp.vim'
Plug 'mbbill/undotree'
Plug 'tpope/vim-fugitive' " Git
Plug 'junegunn/vim-easy-align'
Plug 'eugen0329/vim-esearch'
"Plug 'tpope/vim-sleuth'
" Theme
Plug 'joshdick/onedark.vim'
" Languages
Plug 'w0rp/ale' " lint
Plug 'kchmck/vim-coffee-script'
Plug 'slim-template/vim-slim'
Plug 'davidhalter/jedi-vim' " Python autocomplete
Plug 'Vimjas/vim-python-pep8-indent'
Plug 'tmhedberg/SimpylFold' " Python folding
Plug 'artur-shaik/vim-javacomplete2'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'OrangeT/vim-csharp'
Plug 'hashivim/vim-terraform'
Plug 'juliosueiras/vim-terraform-completion'
Plug 'udalov/kotlin-vim'
call plug#end()
" Defaults
syntax on
filetype plugin indent on
set noswapfile
set incsearch
set number
set showcmd
set nowrap
set list
set listchars=tab:>~,trail:~
set iskeyword+=-
set splitbelow
set splitright
set scrolloff=3
set nofoldenable " prevent folding on start
" shortcuts
map gb :wprevious<CR>
map gn :wnext<CR>
nnoremap ,w :%s/\s\+$//<CR>
if !isdirectory($HOME."/.vim")
call mkdir($HOME."/.vim", "", 0770)
endif
if !isdirectory($HOME."/.vim/undo")
call mkdir($HOME."/.vim/undo", "", 0700)
endif
set undodir=~/.vim/undo
set undofile
" Theme
colorscheme onedark
let g:gruvbox_contrast_dark = 'hard'
set guioptions-=t " remove tearoff menu items
set guioptions-=T " remove toolbar
" Plugin configurations
set wildignore+=*/tmp/*,*/node_modules/*,*/.eggs/*
let g:ctrlp_match_window = 'max:20'
let g:ctrlp_show_hidden = 1
nnoremap ,, :CtrlP<CR>
nnoremap ,. :CtrlPClearCache<CR>:CtrlP<CR>
nnoremap ,d :diffupdate<CR>
nnoremap ,u :UndotreeToggle<CR>
xmap ga <Plug>(EasyAlign) " Start interactive EasyAlign in visual mode (e.g. vipga)
nmap ga <Plug>(EasyAlign) " Start interactive EasyAlign for a motion/text object (e.g. gaip)
" File type patches
autocmd FileType java setlocal omnifunc=javacomplete#Complete
au BufNewFile,BufRead *.jbuilder setf ruby
au BufNewFile,BufRead *.json.jbuilder setf ruby
au BufNewFile,BufRead *.json setf javascript
au BufNewFile,BufRead *.slim setf slim
au BufNewFile,BufRead *.html.slim setf slim
" Lint
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
" E501: line too long
" W503: line ending before operator
" E261: two spaces before inline comment
" E241: multiple spaces after ':' (formatted dict)
" E272: multiple spaces before keyword (formatted dict)
" E402: module level import not at the top of file
let g:ale_python_flake8_options = "--ignore=E501,W503,E261,E241,E272,E402"
" Language configuration
let javaScript_fold=1
let g:jedi#popup_on_dot = 0
let g:jedi#popup_select_first = 0
let g:jedi#show_call_signatures = 2
let g:jedi#smart_auto_mappings = 0 " disable 'from X ' automatically typing 'import'
let g:JavaComplete_ImportSortType = 'packageName'
let g:ale_ruby_rubocop_options = "--except "
+ "Metrics/BlockLength,"
+ "Metrics/LineLength,"
+ "Style/MutableConstant,"
+ "Style/NegatedIf,"
+ "Style/Not,"
+ "Style/StringLiterals,"
+ "Style/TrailingCommaInLiteral,"
+ "Style/WordArray"
let g:ale_javascript_eslint_options = "--config ".$HOME."/.vim/.eslintrc.yml"
let g:go_gocode_unimported_packages = 1
let g:go_fmt_command = $HOME."/go/bin/goreturns"
let g:terraform_align=1
let g:terraform_fold_sections=1
let g:terraform_fmt_on_save=1