aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/dosbatch.vim18
-rw-r--r--runtime/ftplugin/fish.vim15
-rw-r--r--runtime/ftplugin/vim.vim23
3 files changed, 42 insertions, 14 deletions
diff --git a/runtime/ftplugin/dosbatch.vim b/runtime/ftplugin/dosbatch.vim
index 0c5cde2503..f02f26b1fd 100644
--- a/runtime/ftplugin/dosbatch.vim
+++ b/runtime/ftplugin/dosbatch.vim
@@ -1,7 +1,10 @@
" Vim filetype plugin file
-" Language: MS-DOS .bat files
-" Maintainer: Mike Williams <mrw@eandem.co.uk>
-" Last Change: 7th May 2020
+" Language: MS-DOS/Windows .bat files
+" Maintainer: Mike Williams <mrmrdubya@gmail.com>
+" Last Change: 12th February 2023
+"
+" Options Flags:
+" dosbatch_colons_comment - any value to treat :: as comment line
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -15,8 +18,13 @@ let s:cpo_save = &cpo
set cpo&vim
" BAT comment formatting
-setlocal comments=b:rem,b:@rem,b:REM,b:@REM,:::
-setlocal commentstring=::\ %s
+setlocal comments=b:rem,b:@rem,b:REM,b:@REM
+if exists("dosbatch_colons_comment")
+ setlocal comments+=:::
+ setlocal commentstring=::\ %s
+else
+ setlocal commentstring=REM\ %s
+endif
setlocal formatoptions-=t formatoptions+=rol
" Lookup DOS keywords using Windows command help.
diff --git a/runtime/ftplugin/fish.vim b/runtime/ftplugin/fish.vim
new file mode 100644
index 0000000000..7acbf44210
--- /dev/null
+++ b/runtime/ftplugin/fish.vim
@@ -0,0 +1,15 @@
+" Vim filetype plugin file
+" Language: fish
+" Maintainer: Nicholas Boyle (github.com/nickeb96)
+" Repository: https://github.com/nickeb96/fish.vim
+" Last Change: February 1, 2023
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+setlocal iskeyword=@,48-57,_,192-255,-,.
+setlocal comments=:#
+setlocal commentstring=#%s
+setlocal formatoptions+=crjq
diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim
index b64bb55d68..a2cbc28971 100644
--- a/runtime/ftplugin/vim.vim
+++ b/runtime/ftplugin/vim.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Vim
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2022 Nov 27
+" Last Change: 2023 Feb 07
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -98,18 +98,23 @@ if exists("loaded_matchit")
" func name
" require a parenthesis following, then there can be an "endfunc".
let b:match_words =
- \ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' .
- \ '\<\(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\<brea\%[k]\>:\%(\%(^\||\)\s*\)\@<=\<con\%[tinue]\>:\%(\%(^\||\)\s*\)\@<=\<end\(w\%[hile]\|fo\%[r]\)\>,' .
- \ '\<if\>:\%(\%(^\||\)\s*\)\@<=\<el\%[seif]\>:\%(\%(^\||\)\s*\)\@<=\<en\%[dif]\>,' .
- \ '{:},' .
- \ '\<try\>:\%(\%(^\||\)\s*\)\@<=\<cat\%[ch]\>:\%(\%(^\||\)\s*\)\@<=\<fina\%[lly]\>:\%(\%(^\||\)\s*\)\@<=\<endt\%[ry]\>,' .
- \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,'
+ \ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' ..
+ \ '\<\%(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\<brea\%[k]\>:\%(\%(^\||\)\s*\)\@<=\<con\%[tinue]\>:\%(\%(^\||\)\s*\)\@<=\<end\%(w\%[hile]\|fo\%[r]\)\>,' ..
+ \ '\<if\>:\%(\%(^\||\)\s*\)\@<=\<el\%[seif]\>:\%(\%(^\||\)\s*\)\@<=\<en\%[dif]\>,' ..
+ \ '{:},' ..
+ \ '\<try\>:\%(\%(^\||\)\s*\)\@<=\<cat\%[ch]\>:\%(\%(^\||\)\s*\)\@<=\<fina\%[lly]\>:\%(\%(^\||\)\s*\)\@<=\<endt\%[ry]\>,' ..
+ \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' ..
+ \ '\<class\>:\<endclass\>,' ..
+ \ '\<inte\%[rface]\>:\<endinterface\>,' ..
+ \ '\<enu\%[m]\>:\<endenum\>,'
+
" Ignore syntax region commands and settings, any 'en*' would clobber
" if-endif.
" - set spl=de,en
" - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ …
- let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name")
- \ =~? "comment\\|string\\|vimLetHereDoc\\|vimSynReg\\|vimSet"'
+ " Also ignore here-doc and dictionary keys (vimVar).
+ let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
+ \ =~? "comment\\|string\\|vimSynReg\\|vimSet\\|vimLetHereDoc\\|vimVar"'
endif
let &cpo = s:cpo_save