runtime(gdscript): add recommended indent options to ftplugin
Commit:
https://github.com/vim/vim/commit/6a54dcbbd68e70ee067348d1d9c1898befc56972
Author: markmacode <[email protected]>
Date: Tue Jul 16 21:18:06 2024 +0200
runtime(gdscript): add recommended indent options to ftplugin
related: https://github.com/vim/vim/issues/15264
Signed-off-by: markmacode <[email protected]>
Signed-off-by: Maxim Kim <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index a342ba464..1885f8688 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -623,6 +623,17 @@ any #lang directive overrides, use the following command: >
let g:freebasic_lang = "fblite"
+GDSCRIPT *ft-gdscript-plugin*
+
+By default the following options are set, based on Godot official docs: >
+
+ setlocal noexpandtab softtabstop=0 shiftwidth=0
+
+To disable this behavior, set the following variable in your vimrc: >
+
+ let g:gdscript_recommended_style = 0
+
+
GIT COMMIT *ft-gitcommit-plugin*
One command, :DiffGitCached, is provided to show a diff of the current commit
diff --git a/runtime/ftplugin/gdscript.vim b/runtime/ftplugin/gdscript.vim
index 93519d8af..d1f41c8ea 100644
--- a/runtime/ftplugin/gdscript.vim
+++ b/runtime/ftplugin/gdscript.vim
@@ -4,6 +4,7 @@ vim9script
# Language: gdscript (Godot game engine scripting language)
# Maintainer: Maxim Kim <[email protected]>
# Website: https://github.com/habamax/vim-gdscript
+# Last Change: 2024 Jul 14
if exists("b:did_ftplugin") | finish | endif
@@ -22,6 +23,11 @@ setlocal commentstring=#\ %s
setlocal foldignore=
setlocal foldexpr=GDScriptFoldLevel()
+if get(g:, 'gdscript_recommended_style', 1)
+ setlocal noexpandtab tabstop=4 softtabstop=0 shiftwidth=0
+ b:undo_ftplugin ..= ' | setlocal expandtab< tabstop< softtabstop<
shiftwidth<'
+endif
+
def GDScriptFoldLevel(): string
var line = getline(v:lnum)
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/E1sTxvM-0091UD-BR%40256bit.org.