Mercurial > vim
annotate runtime/ftplugin/asm.vim @ 34879:900719093984
ftplugin(asm): add Matchit support
Commit: https://github.com/vim/vim/commit/dbca7d80457d026f6d6a5cc7e916b94df0ca6e03
Author: Wu, Zhenyu <wuzhenyu@ustc.edu>
Date: Wed Apr 10 22:57:31 2024 +0200
ftplugin(asm): add Matchit support
closes: https://github.com/vim/vim/issues/14461
Refer https://github.com/vim/vim/blob/master/runtime/ftplugin/masm.vim#L18-L29
Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 10 Apr 2024 23:00:04 +0200 |
parents | 02939ae3aaca |
children | 7c7432a53a6c |
rev | line source |
---|---|
20753 | 1 " Vim filetype plugin file |
2 " Language: asm | |
3 " Maintainer: Colin Caine <cmcaine at the common googlemail domain> | |
34879
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
4 " Last Change: 2020 May 23 |
33051
02939ae3aaca
runtime: Set b:undo_ftplugin where missing (#12943)
Christian Brabandt <cb@256bit.org>
parents:
20753
diff
changeset
|
5 " 2023 Aug 28 by Vim Project (undo_ftplugin) |
34879
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
6 " 2024 Apr 09 by Vim Project (add Matchit support) |
20753 | 7 |
8 if exists("b:did_ftplugin") | finish | endif | |
33051
02939ae3aaca
runtime: Set b:undo_ftplugin where missing (#12943)
Christian Brabandt <cb@256bit.org>
parents:
20753
diff
changeset
|
9 let b:did_ftplugin = 1 |
20753 | 10 |
34879
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
11 setl include=^\\s*%\\s*include |
20753 | 12 setl comments=:;,s1:/*,mb:*,ex:*/,:// |
13 setl commentstring=;%s | |
14 | |
34879
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
15 let b:undo_ftplugin = "setl commentstring< comments< include<" |
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
16 |
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
17 " Matchit support |
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
18 if !exists('b:match_words') |
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
19 let b:match_skip = 's:comment\|string\|character\|special' |
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
20 let b:match_words = '^\s*%\s*if\%(\|num\|idn\|nidn\)\>:^\s*%\s*elif\>:^\s*%\s*else\>:^\s*%\s*endif\>,^\s*%\s*macro\>:^\s*%\s*endmacro\>,^\s*%\s*rep\>:^\s*%\s*endrep\>' |
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
21 let b:match_ignorecase = 1 |
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
22 let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:match_skip" |
900719093984
ftplugin(asm): add Matchit support
Christian Brabandt <cb@256bit.org>
parents:
33051
diff
changeset
|
23 endif |