Mercurial > vim
annotate runtime/ftplugin/modula2.vim @ 36549:07e948b0d33b draft default tip
runtime(doc): mention option-backslash at :h CompilerSet
Commit: https://github.com/vim/vim/commit/dbf231a4b7fba235fa9ccc8798b37c0b4a4943ae
Author: Christian Brabandt <cb@256bit.org>
Date: Wed Nov 13 20:28:43 2024 +0100
runtime(doc): mention option-backslash at :h CompilerSet
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 13 Nov 2024 20:45:02 +0100 |
parents | 7c7432a53a6c |
children |
rev | line source |
---|---|
24468 | 1 " Vim filetype plugin file |
2 " Language: Modula-2 | |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
34092
diff
changeset
|
4 " Last Change: 2024 Jan 14 |
35324
7c7432a53a6c
patch 9.1.0464: no whitespace padding in commentstring option in ftplugins
Christian Brabandt <cb@256bit.org>
parents:
34134
diff
changeset
|
5 " 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') |
24468 | 6 |
7 if exists("b:did_ftplugin") | |
8 finish | |
9 endif | |
10 let b:did_ftplugin = 1 | |
11 | |
12 let s:cpo_save = &cpo | |
13 set cpo&vim | |
14 | |
34092
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
15 let s:dialect = modula2#GetDialect() |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
16 |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
17 if s:dialect ==# "r10" |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
18 setlocal comments=s:(*,m:\ ,e:*),:! |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
19 setlocal commentstring=!\ %s |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
20 else |
35324
7c7432a53a6c
patch 9.1.0464: no whitespace padding in commentstring option in ftplugins
Christian Brabandt <cb@256bit.org>
parents:
34134
diff
changeset
|
21 setlocal commentstring=(*\ %s\ *) |
34092
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
22 setlocal comments=s:(*,m:\ ,e:*) |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
23 endif |
24468 | 24 setlocal formatoptions-=t formatoptions+=croql |
25 | |
34092
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
26 let b:undo_ftplugin = "setl com< cms< fo<" |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
27 |
24468 | 28 if exists("loaded_matchit") && !exists("b:match_words") |
34092
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
29 let b:match_ignorecase = 0 |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
30 " the second branch of the middle pattern is intended to match CASE labels |
24468 | 31 let b:match_words = '\<REPEAT\>:\<UNTIL\>,' .. |
34092
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
32 \ '\<\%(BEGIN\|CASE\|FOR\|IF\|LOOP\|WHILE\|WITH\|RECORD\)\>' .. |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
33 \ ':' .. |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
34 \ '\<\%(ELSIF\|ELSE\)\>\|\%(^\s*\)\@<=\w\+\%(\s*\,\s*\w\+\)\=\s*\:=\@!' .. |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
35 \ ':' .. |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
36 \ '\<END\>,' .. |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
37 \ '(\*:\*),<\*:\*>' |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
38 let b:match_skip = 's:Comment\|Pragma' |
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
39 let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_skip b:match_words" |
24468 | 40 endif |
41 | |
42 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
34092
diff
changeset
|
43 let b:browsefilter = "Modula-2 Source Files (*.def, *.mod)\t*.def;*.mod\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
34092
diff
changeset
|
44 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
34092
diff
changeset
|
45 let b:browsefilter ..= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
34092
diff
changeset
|
46 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
34092
diff
changeset
|
47 let b:browsefilter ..= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
34092
diff
changeset
|
48 endif |
34092
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
24468
diff
changeset
|
49 let b:undo_ftplugin ..= " | unlet! b:browsefilter" |
24468 | 50 endif |
51 | |
52 let &cpo = s:cpo_save | |
53 unlet s:cpo_save | |
54 | |
55 " vim: nowrap sw=2 sts=2 ts=8 noet: |