diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 14:57:57 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 14:57:57 -0700 |
| commit | c324271b99eee4c621463f368914d57cd729bd9c (patch) | |
| tree | 5d979d333a2d5f9c080991d5482fd5916f8579c6 /runtime/ftplugin/vim.vim | |
| parent | 931bffbda3668ddc609fc1da8f9eb576b170aa52 (diff) | |
| parent | ade1b12f49c3b3914c74847d791eb90ea90b56b7 (diff) | |
| download | rneovim-c324271b99eee4c621463f368914d57cd729bd9c.tar.gz rneovim-c324271b99eee4c621463f368914d57cd729bd9c.tar.bz2 rneovim-c324271b99eee4c621463f368914d57cd729bd9c.zip | |
Merge remote-tracking branch 'upstream/master' into userreg
Diffstat (limited to 'runtime/ftplugin/vim.vim')
| -rw-r--r-- | runtime/ftplugin/vim.vim | 13 |
1 files changed, 6 insertions, 7 deletions
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 |