From e1ce4b2fa88c45843fa2039d4c383ff36556b6b4 Mon Sep 17 00:00:00 2001 From: Dmitry Chumak Date: Sun, 9 Mar 2025 21:00:41 +0300 Subject: [PATCH] gdscript support added --- vim/coc-settings.json | 9 ++++++++- vim/ftplugin/gdscript.vim | 8 ++++++++ vim/vimrc | 6 +++++- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 vim/ftplugin/gdscript.vim diff --git a/vim/coc-settings.json b/vim/coc-settings.json index 6824e94..baa026e 100644 --- a/vim/coc-settings.json +++ b/vim/coc-settings.json @@ -1,5 +1,12 @@ { "inlayHints.enable": false, "pyright.inlayHints.functionReturnTypes": false, - "pyright.inlayHints.variableTypes": false + "pyright.inlayHints.variableTypes": false, + "languageserver": { + "godot": { + "host": "127.0.0.1", + "filetypes": ["gdscript"], + "port": 6005 + } + } } diff --git a/vim/ftplugin/gdscript.vim b/vim/ftplugin/gdscript.vim new file mode 100644 index 0000000..4dc233c --- /dev/null +++ b/vim/ftplugin/gdscript.vim @@ -0,0 +1,8 @@ +" to use folding provided by plugin +setlocal foldmethod=expr +setlocal shiftwidth=4 +setlocal tabstop=4 +nnoremap :GodotRunLast +nnoremap :GodotRun +nnoremap :GodotRunCurrent +nnoremap :GodotRunFZF diff --git a/vim/vimrc b/vim/vimrc index 90b0af5..6c45022 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -66,6 +66,7 @@ call plug#begin('~/.vim/bundle') "Начать искать плагины в э Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } Plug 'hashivim/vim-terraform' " Plug 'Exafunction/codeium.vim' + Plug 'habamax/vim-godot' call plug#end() "Перестать это делать " @@ -180,7 +181,7 @@ let g:ansible_yamlKeyName = 'yamlKey' " let g:coc_global_extensions = ['coc-pyright', 'coc-sh', 'coc-go'] function! s:enable_coc_for_type() - let l:filesuffix_whitelist = ['py', 'sh', 'go'] + let l:filesuffix_whitelist = ['py', 'sh', 'go', 'gd', 'gdscript'] if index(l:filesuffix_whitelist, expand('%:e')) == -1 let b:coc_enabled = 0 endif @@ -196,3 +197,6 @@ let g:sneak#label = 1 " YAML files config autocmd FileType yaml,yml setlocal ts=2 sts=2 sw=2 expandtab let g:indentLine_char = '⦙' + +" vim-go settings +let g:go_fmt_autosave = 1