...
 
Commits (2)
This diff is collapsed.
""" dockerfile {{{
" }}}
""" plugin {{{
if executable('docker-langserver')
" npm install -g dockerfile-language-server-nodejs
au User lsp_setup call lsp#register_server({
\ 'name': 'docker-langserver',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'docker-langserver --stdio']},
\ 'whitelist': ['dockerfile'],
\ })
endif
" }}}
""" go {{{
set nolist
set rtp+=$GOPATH/src/golang.org/x/lint/misc/vim
set autowrite
map <C-n> :cnext<CR>
map <C-m> :cprevious<CR>
noremap <leader>a :cclose<CR>
let g:go_fmt_autosave = 0
let g:go_play_open_browser = 0
let g:go_highlight_types = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_calls = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_code_completion_enabled = 1
let g:go_info_mode = 'gocode'
let g:go_autodetect_gopath = 1
let g:go_textobj_enabled = 1
let g:go_textobj_include_variable = 1
let g:go_textobj_include_function_doc = 1
let g:go_template_autocreate = 1
let g:go_template_test_file = "hello_world_test.go"
let g:go_auto_type_info = 1
"" vim-lsp
if executable('go-langserver')
au User lsp_setup call lsp#register_server({
\ 'name': 'go-langserver',
\ 'cmd': {server_info->['go-langserver', '-gocodecompletion']},
\ 'whitelist': ['go'],
\ })
autocmd BufWritePre *.go LspDocumentFormatSync
endif
"" deoplete
"let g:deoplete#sources#go#package_dot = 1
"let g:deoplete#sources#go#gocode_binary = $GOPATH.'/bin/gocode'
"let g:deoplete#sources#go#sort_class = [
"\ 'package',
"\ 'func',
"\ 'type',
"\ 'var',
"\ 'const'
"\]
"augroup omni_patterns
" autocmd!
" autocmd Bufread *.go :call deoplete#custom#option(
" \ 'omni_patterns', {'go': '[^. *\t]\.\w*'
" \ })
"augroup END
" }}}
""" plugin {{{
" vim-lsp
"if executable('go-langserver')
" au User lsp_setup call lsp#register_server({
" \ 'name': 'go-langserver',
" \ 'cmd': {server_info->['go-langserver', '-gocodecompletion']},
" \ 'whitelist': ['go'],
" \ })
" autocmd BufWritePre *.go LspDocumentFormatSync
"endif
if executable('gopls')
au User lsp_setup call lsp#register_server({
\ 'name': 'gopls',
\ 'cmd': {server_info->['gopls', '-mode', 'stdio']},
\ 'whitelist': ['go'],
\ })
autocmd BufWritePre *.go LspDocumentFormatSync
endif
" }}}
......@@ -16,4 +16,36 @@ augroup javacomplete
autocmd!
autocmd FileType java setlocal omnifunc=javacomplete#Complete
augroup END
" vim-lsp
if executable('java') && filereadable(expand(
\ '~/lsp/eclipse.jdt.ls/' .
\ 'plugins/org.eclipse.equinox.launcher_1.5.300.v20190213-1655.jar'))
" mkdir -p ~/lsp/eclipse.jdt.ls
" cd ~/lsp/eclipse.jdt.ls
" curl -L https://download.eclipse.org/jdtls/milestones/0.35.0/ \
" jdt-language-server-0.35.0-201903142358.tar.gz -O
" tar xf jdt-language-server-0.35.0-201903142358.tar.gz
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.5.300.v20190213-1655.jar'),
\ '-configuration',
\ expand('~/lsp/eclipse.jdt.ls/config_win'),
\ '-data',
\ getcwd()
\ ]},
\ 'whitelist': ['java'],
\ })
endif
" }}}
""" javascript {{{
nnoremap <buffer> <LocalLeader>c I// <Esc>
"""" }}}
" }}}
""" plugin {{{
"" ale
" vim-lsp
if executable('typescript-language-server')
" npm install -g typescript typescript-language-server
au User lsp_setup call lsp#register_server({
\ 'name': 'javascript support using typescript-language-server',
\ 'cmd': { server_info->[
\ &shell,
\ &shellcmdflag,
\ 'typescript-language-server --stdio'
\ ]},
\ 'root_uri': { server_info->lsp#utils#path_to_uri(
\ lsp#utils#find_nearest_parent_directory(
\ lsp#utils#get_buffer_path(),
\ '.git/..'
\ )
\ )},
\ 'whitelist': ['javascript', 'javascript.jsx', 'javascriptreact']
\ })
endif
" ale
let g:ale_linters = {
\ 'javascript': ['eslint']
\}
......
""" php {{{
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal textwidth=80
setlocal errorformat=%m\ in\ %f\ on\ line\ %l
"let g:php_sql_query = 0
"let g:php_htmlInStrings = 0
"let g:php_noShortTags = 0
"let g:php_folding = 1
let g:php_sql_query = 0
let g:php_htmlInStrings = 0
let g:php_noShortTags = 0
let g:php_folding = 1
inoremap ,pp<ESC> :call PhpDocSingle()<CR>i
nnoremap ,pp :call PhpDocSingle()<CR>
vnoremap ,pp :call PhpDocRange()<CR>
......@@ -13,9 +17,24 @@ vnoremap ,pp :call PhpDocRange()<CR>
" autocmd FileType php setlocal makeprg=php\ -l\ %
" autocmd BufWrite *.php w !php -l
"augroup END
" }}}
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal textwidth=80
""" plugin {{{
" vim-lsp
if executable('intelephense')
" # update `PATH_TO_GLOBAL_NODE_MODULES` and `PATH_TO_TEMP_FOLDER`
" npm root -g (
au User lsp_setup call lsp#register_server({
\ 'name': 'intelephense',
\ 'cmd': {server_info->[
\ 'node',
\ expand('PATH_TO_GLOBAL_NODE_MODULES/intelephense/lib/intelephense.js'),
\ '--stdio'
\ ]},
\ 'initialization_options': {
\ "storagePath": "PATH_TO_TEMP_FOLDER/intelephense"
\ },
\ 'whitelist': ['php'],
\ })
endif
" }}}
......@@ -10,11 +10,14 @@ iabbrev <buffer> iff if:hli
""" plugin {{{
"" pep8
let g:pep8_map = '<F8>'
"" jedi-vim
let g:jedi#usages_command = '<leader>U'
let g:jedi#rename_command = '<leader>R'
let g:jedi#use_tabs_not_buffers = 1
setlocal completeopt-=preview
"" vim-lsp
if executable('pyls')
au User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'whitelist': ['python'],
\ })
endif
"" ale
let g:ale_linters = {
\ 'python': ['pylint']
......
""" ruby {{{
setlocal dictionary=$HOME/.vim/dict/ruby.dict
"" ri.vim
"" split 0 => h, 1 => v
" ri.vim
" split 0 => h, 1 => v
nnoremap <Leader>rh :call ri#OpenSearchPrompt(0)<CR>
nnoremap <Leader>rv :call ri#OpenSearchPrompt(1)<CR>
nnoremap <Leader>rk :call ri#LookupNameUnderCursor()<CR>
if &filetype == "ruby"
"" syntax check
" syntax check
compiler ruby
setlocal makeprg=ruby\ -c\ %
augroup syntax_check
......@@ -15,3 +15,16 @@ if &filetype == "ruby"
augroup END
endif
" }}}
""" plugin {{{
" vim-lsp
if executable('solargraph')
" gem install solargraph
au User lsp_setup call lsp#register_server({
\ 'name': 'solargraph',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'solargraph stdio']},
\ 'initialization_options': {"diagnostics": "true"},
\ 'whitelist': ['ruby'],
\ })
endif
" }}}
......@@ -13,6 +13,7 @@ set conceallevel=1
""" plugin {{{
" vim-lsp
if executable('rls')
" rustup component add rls rust-analysis rust-src
au User lsp_setup call lsp#register_server({
\ 'name': 'rls',
\ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']},
......@@ -20,6 +21,9 @@ if executable('rls')
\ 'whitelist': ['rust'],
\ })
endif
" asyncomplete-racer.vim
autocmd User asyncomplete_setup call asyncomplete#register_source(
\ asyncomplete#sources#racer#get_source_options())
" vim-racer
let g:racer_cmd = $HOME."/.cargo/bin/racer"
let g:racer_experimental_completer = 0
......
""" typescript {{{
" }}}
""" plugin {{{
" vim-lsp
if executable('typescript-language-server')
" npm install -g typescript typescript-language-server
au User lsp_setup call lsp#register_server({
\ 'name': 'typescript-language-server',
\ 'cmd': {server_info->[
\ &shell,
\ &shellcmdflag,
\ 'typescript-language-server --stdio'
\ ]},
\ 'root_uri':{ server_info->lsp#utils#path_to_uri(
\ lsp#utils#find_nearest_parent_file_directory(
\ lsp#utils#get_buffer_path(),
\ 'tsconfig.json'
\ )
\ )},
\ 'whitelist': ['typescript', 'typescript.tsx'],
\ })
endif
" ale
let g:ale_linters = {
\ 'typescript': ['tslint']
\}
"""" }}}