aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2021-12-10 01:26:20 +0800
committerGuangxiong Lin <[email protected]>2021-12-10 01:26:20 +0800
commit02cf0f9b678eae0815d9da4347cab8971b160cb6 (patch)
treebf3a38d76a20b9f8c53a93ceeaff462d430b8c01
parent9690e7e90d0302c225211724b59116ccf63df4b2 (diff)
downloaddotfiles-02cf0f9b678eae0815d9da4347cab8971b160cb6.tar.gz
dotfiles-02cf0f9b678eae0815d9da4347cab8971b160cb6.tar.bz2
dotfiles-02cf0f9b678eae0815d9da4347cab8971b160cb6.zip
Add several ycm commands
-rw-r--r--.vim/plugin/godot.vim27
-rw-r--r--.vim/plugin/init.vim2
-rw-r--r--.vim/plugin/youcompleteme.vim6
3 files changed, 24 insertions, 11 deletions
diff --git a/.vim/plugin/godot.vim b/.vim/plugin/godot.vim
index 6bcf679..655710e 100644
--- a/.vim/plugin/godot.vim
+++ b/.vim/plugin/godot.vim
@@ -1,19 +1,11 @@
if has('macunix')
let g:godot_executable = '/Applications/Godot.app'
endif
+
if has('win32') || has('win32unix')
let g:godot_executable = ''
endif
-let g:ycm_language_server += [
- \ {
- \ 'name': 'godot',
- \ 'filetypes': ['gdscript'],
- \ 'project_root_files': ['project.godot'],
- \ 'port': 6008
- \ }
- \ ]
-
func! s:godot_settings() abort
setlocal tabstop=4
nnoremap <buffer> <leader>rl :GodotRunLast<CR>
@@ -25,6 +17,23 @@ augroup godot | au!
au FileType gdscript call s:godot_settings()
augroup end
+"YCM config
+
+if !has_key( g:, 'ycm_language_server' )
+ let g:ycm_language_server = []
+endif
+
+let g:ycm_language_server += [
+ \ {
+ \ 'name': 'godot',
+ \ 'filetypes': ['gdscript'],
+ \ 'project_root_files': ['project.godot'],
+ \ 'port': 6008
+ \ }
+ \ ]
+
+" ALE config
+
call ale#linter#Define('gdscript', {
\ 'name': 'godot',
\ 'lsp': 'socket',
diff --git a/.vim/plugin/init.vim b/.vim/plugin/init.vim
index 6ecd7cd..75d4871 100644
--- a/.vim/plugin/init.vim
+++ b/.vim/plugin/init.vim
@@ -24,8 +24,6 @@ function! BuildYCM(info)
exec '!python3 ./install.py' . ycm_install_options
endfunction
-let g:ycm_language_server = []
-
call plug#begin('~/.vim/plugged')
" General
diff --git a/.vim/plugin/youcompleteme.vim b/.vim/plugin/youcompleteme.vim
index f54613f..4a1e7cd 100644
--- a/.vim/plugin/youcompleteme.vim
+++ b/.vim/plugin/youcompleteme.vim
@@ -22,6 +22,11 @@ let g:ycm_filetype_blacklist = {
\ 'org': 1
\ }
+command YcmCompleterGoTo :YcmCompleter GoTo
+command YcmCompleterGoToType :YcmCompleter GoToType
+command YcmCompleterGoToReferences :YcmCompleter GoToReferences
+command YcmCompleterGoToImplementation :YcmCompleter GoToImplementation
+
nnoremap gd :YcmCompleter GoTo<CR>
nnoremap gr :YcmCompleter GoToReferences<CR>
nnoremap gi :YcmCompleter GoToImplementation<CR>
@@ -31,3 +36,4 @@ nmap gS <plug>(YCMFindSymbolInWorkspace)
nmap K <plug>(YCMHover)
autocmd! BufWritePre *.rs,*.go call execute('YcmCompleter Format')
+