robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqvim-patch:ce4fbda: runtime(fish): Add matchit support to filetype plugin (#38399)6d84209eae

master
1.1 KiB41 linesraw
1" Vim filetype plugin file
2" Language:     fish
3" Maintainer:   Nicholas Boyle (github.com/nickeb96)
4" Repository:   https://github.com/nickeb96/fish.vim
5" Last Change:  February 1, 2023
6"               2023 Aug 28 by Vim Project (undo_ftplugin)
7"               2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
8"               2026 Mar 16 by Phạm Bình An (add matchit support)
9
10if exists("b:did_ftplugin")
11    finish
12endif
13
14let s:saved_cpo = &cpo
15set cpo-=C
16
17let b:did_ftplugin = 1
18
19setlocal iskeyword=@,48-57,_,192-255,-,.
20setlocal comments=:#
21setlocal commentstring=#\ %s
22setlocal formatoptions+=crjq
23
24let b:undo_ftplugin = "setl cms< com< fo< isk<"
25
26" Define patterns for the matchit plugin
27if exists("loaded_matchit") && !exists("b:match_words")
28  let b:match_words =
29      \ '\<\%(else\s\+\)\@<!if\>\|\<\%(switch\|begin\|function\|while\|for\)\>:' ..
30      \ '\<else\%(\s\+if\)\?\>\|\<case\>:' ..
31      \ '\<end\>'
32
33  let b:match_ignorecase = 0
34  let b:match_skip = "S:keyword"
35
36  let b:undo_ftplugin ..= " | unlet! b:match_words b:match_ignorecase b:match_skip"
37endif
38
39" Restore 'cpo' to its original value
40let &cpo = s:saved_cpo
41unlet s:saved_cpo