diff options
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/query.lua | 2 | ||||
-rw-r--r-- | runtime/ftplugin/vim.vim | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua index 964c221ad4..c75dc30430 100644 --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -1,5 +1,5 @@ -- Neovim filetype plugin file --- Language: Tree-sitter query +-- Language: Treesitter query -- Last Change: 2023 Aug 23 if vim.b.did_ftplugin == 1 then diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index 06369e8a82..f5dae0f94e 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -49,18 +49,17 @@ setlocal isk+=# " Use :help to lookup the keyword under the cursor with K. setlocal keywordprg=:help -" if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>' -if "\n" .. join(getline(1, 10), "\n") =~# '\n\s*vim9\%[script]\>' - " Set 'comments' to format dashed lists in comments - setlocal com=sO:#\ -,mO:#\ \ ,eO:##,:# - " Comments starts with # in Vim9 script +" Comments starts with # in Vim9 script. We have to guess which one to use. +if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>' setlocal commentstring=#%s else - setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\" - " Comments starts with a double quote in legacy script setlocal commentstring=\"%s endif +" Set 'comments' to format dashed lists in comments, both in Vim9 and legacy +" script. +setlocal com=sO:#\ -,mO:#\ \ ,eO:##,:#\\\ ,:#,sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"\\\ ,:\" + " Format comments to be up to 78 characters long if &tw == 0 |