aboutsummaryrefslogtreecommitdiff
path: root/.vim/plugin/godot.vim
diff options
context:
space:
mode:
authorgxlin <[email protected]>2021-07-15 21:28:06 +0800
committergxlin <[email protected]>2021-07-15 21:28:06 +0800
commitd4e1469e4b0c5aaf5c23be555e8b224f9254d781 (patch)
treee68a0e5dd44ee43efc2d70c081f41ae3237a78c1 /.vim/plugin/godot.vim
parent36f249e1a7250e24f0c415b5bc53ba1b2f5806d4 (diff)
downloaddotfiles-d4e1469e4b0c5aaf5c23be555e8b224f9254d781.tar.gz
dotfiles-d4e1469e4b0c5aaf5c23be555e8b224f9254d781.tar.bz2
dotfiles-d4e1469e4b0c5aaf5c23be555e8b224f9254d781.zip
A usable boostrap config
Diffstat (limited to '.vim/plugin/godot.vim')
-rw-r--r--.vim/plugin/godot.vim35
1 files changed, 35 insertions, 0 deletions
diff --git a/.vim/plugin/godot.vim b/.vim/plugin/godot.vim
new file mode 100644
index 0000000..49354f8
--- /dev/null
+++ b/.vim/plugin/godot.vim
@@ -0,0 +1,35 @@
+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
+ \ }
+ \ ]
+
+let g:Lf_RootMarkers += ['project.godot']
+
+func! s:godot_settings() abort
+ setlocal tabstop=4
+ nnoremap <buffer> <leader>rl :GodotRunLast<CR>
+ nnoremap <buffer> <leader>rc :GodotRunCurrent<CR>
+ nnoremap <buffer> <leader>rr :GodotRun<CR>
+endfunc
+
+augroup godot | au!
+ au FileType gdscript call s:godot_settings()
+augroup end
+
+call ale#linter#Define('gdscript', {
+\ 'name': 'godot',
+\ 'lsp': 'socket',
+\ 'address': '127.0.0.1:6008',
+\ 'project_root': 'project.godot',
+\ })