-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
87 lines (79 loc) · 2.89 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
call plug#begin('~/.vim/plugged')
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'prabirshrestha/vim-lsp'
call plug#end()
let g:asyncomplete_remove_duplicates = 1
let g:asyncomplete_smart_completion = 1
let g:asyncomplete_auto_popup = 1
let g:lsp_log_verbose = 0
let g:lsp_log_file = expand('~/vim-lsp.log')
if executable(expand('~/.mozbuild/clang-tools/clang-tidy/bin/clangd'))
au User lsp_setup call lsp#register_server({
\ 'name': 'clangd',
\ 'cmd': {server_info->[
\ expand('~/.mozbuild/clang-tools/clang-tidy/bin/clangd'),
\ '--compile-commands-dir=objdir'
\ ]},
\ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'],
\ })
endif
if executable('rust-analyzer')
au User lsp_setup call lsp#register_server({
\ 'name': 'Rust Language Server',
\ 'cmd': {server_info->['rust-analyzer']},
\ 'whitelist': ['rust'],
\ })
endif
if executable('java') && filereadable(expand('~/lsp/eclipse.jdt.ls/plugins/org.eclipse.equinox.launcher_1.6.700.v20231214-2017.jar'))
au User lsp_setup call lsp#register_server({
\ 'name': 'eclipse.jdt.ls',
\ 'cmd': {server_info->[
\ 'java',
\ '-Declipse.application=org.eclipse.jdt.ls.core.id1',
\ '-Dosgi.bundles.defaultStartLevel=4',
\ '-Declipse.product=org.eclipse.jdt.ls.core.product',
\ '-Dlog.level=ALL',
\ '-noverify',
\ '-Dfile.encoding=UTF-8',
\ '-Xmx1G',
\ '-jar',
\ expand('~/lsp/eclipse.jdt.ls/plugins/org.eclipse.equinox.launcher_1.6.700.v20231214-2017.jar'),
\ '-configuration',
\ expand('~/lsp/eclipse.jdt.ls/config_linux'),
\ '-data',
\ '/tmp/java-lsp' . getcwd()
\ ]},
\ 'whitelist': ['java'],
\ })
endif
if executable(expand('~/lsp/kotlin/server/bin/kotlin-language-server2'))
au User lsp_setup call lsp#register_server({
\ 'name': 'kotlin-language-server',
\ 'cmd': {server_info->[
\ &shell,
\ &shellcmdflag,
\ expand('~/lsp/kotlin/server/bin/kotlin-language-server')
\ ]},
\ 'whitelist': ['kotlin']
\ })
endif
syntax on
set modeline
set spell
set mouse-=a
set ruler
hi clear SpellBad
hi SpellBad cterm=underline
au BufRead,BufNewFile *.kt set filetype=kotlin
au BufRead,BufNewFile *.jsm set filetype=javascript
au BufRead,BufNewFile *.sjs set filetype=javascript
au BufRead,BufNewFile *.webidl set filetype=idl
au BufNewFile,BufRead *.gradle set filetype=groovy
augroup vimrc
autocmd!
autocmd FileType c,cpp,java setl cindent
autocmd FileType c,cpp,java,javascript setl expandtab tabstop=2 shiftwidth=2
autocmd FileType xml setl expandtab tabstop=4 shiftwidth=4
autocmd FileType kotlin setl expandtab tabstop=4 shiftwidth=4
augroup END