aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorshadmansaleh <shadmansaleh3@gmail.com>2021-06-02 16:25:50 +0600
committershadmansaleh <shadmansaleh3@gmail.com>2021-06-11 01:01:02 +0600
commitfd5e5d2715d264447d94d7253f3c78bd7003a472 (patch)
treecd4cd78d99197de5e30d18c7a078d70ebc4575c1 /runtime
parent68be8b99cfb1ab6105c48707986ce409ca38dd35 (diff)
downloadrneovim-fd5e5d2715d264447d94d7253f3c78bd7003a472.tar.gz
rneovim-fd5e5d2715d264447d94d7253f3c78bd7003a472.tar.bz2
rneovim-fd5e5d2715d264447d94d7253f3c78bd7003a472.zip
feat(runtime): Allow lua to be used in ftplugin
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/usr_05.txt2
-rw-r--r--runtime/ftplugin.vim4
2 files changed, 4 insertions, 2 deletions
diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt
index d8634ac6ed..d0206ba82d 100644
--- a/runtime/doc/usr_05.txt
+++ b/runtime/doc/usr_05.txt
@@ -411,7 +411,7 @@ Examples for the "stuff" filetype on Unix: >
The <filetype> part is the name of the filetype the plugin is to be used for.
Only files of this filetype will use the settings from the plugin. The <name>
part of the plugin file doesn't matter, you can use it to have several plugins
-for the same filetype. Note that it must end in ".vim".
+for the same filetype. Note that it must end in ".vim" or ".lua".
Further reading:
diff --git a/runtime/ftplugin.vim b/runtime/ftplugin.vim
index a434b9372b..feef949dba 100644
--- a/runtime/ftplugin.vim
+++ b/runtime/ftplugin.vim
@@ -28,7 +28,9 @@ augroup filetypeplugin
" When there is a dot it is used to separate filetype names. Thus for
" "aaa.bbb" load "aaa" and then "bbb".
for name in split(s, '\.')
- exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
+ exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
+ " Load lua ftplugins
+ exe printf('runtime! ftplugin/%s.lua ftplugin/%s_*.lua ftplugin/%s/*.lua', name, name, name)
endfor
endif
endfunc