Mercurial > vim
annotate runtime/ftplugin/mf.vim @ 36557:9f484a1841eb draft v9.1.0864
patch 9.1.0864: message history is fixed to 200
Commit: https://github.com/vim/vim/commit/4bd9b2b2467e696061104a029000e9824c6c609e
Author: Shougo Matsushita <Shougo.Matsu@gmail.com>
Date: Thu Nov 14 22:31:48 2024 +0100
patch 9.1.0864: message history is fixed to 200
Problem: message history is fixed to 200
Solution: Add the 'msghistory' option, increase the default
value to 500 (Shougo Matsushita)
closes: #16048
Co-authored-by: Milly <milly.ca@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 14 Nov 2024 22:45:04 +0100 |
parents | 8ae680be2a51 |
children |
rev | line source |
---|---|
29756 | 1 vim9script |
2 | |
3 # Vim filetype plugin file | |
4 # Language: METAFONT | |
5 # Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> | |
6 # Former Maintainers: Nikolai Weibull <now@bitwi.se> | |
7 # Latest Revision: 2022 Aug 12 | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29756
diff
changeset
|
8 # 2024 Jan 14 by Vim Project (browsefilter) |
7 | 9 |
10 if exists("b:did_ftplugin") | |
11 finish | |
12 endif | |
13 | |
29756 | 14 b:did_ftplugin = 1 |
15 b:undo_ftplugin = "setl com< cms< fo< sua< inc< def< ofu<" | |
1698 | 16 |
29756 | 17 setlocal comments=:% |
18 setlocal commentstring=%\ %s | |
19 setlocal formatoptions+=cjroql2 | |
20 setlocal formatoptions-=t | |
21 setlocal omnifunc=syntaxcomplete#Complete | |
10244
876fbdd84e52
commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents:
1698
diff
changeset
|
22 setlocal suffixesadd=.mf |
876fbdd84e52
commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents:
1698
diff
changeset
|
23 |
29756 | 24 &l:include = '\<input\>' |
25 &l:define = '\<\%(let\|newinternal\|interim\|def\|vardef\)\>\|\<\%(primary\|secondary\|tertiary\)def\>\s*[^ .]\+' | |
389 | 26 |
29756 | 27 g:omni_syntax_group_include_mf = 'mf\w\+' |
28 g:omni_syntax_group_exclude_mf = 'mfTodoComment' | |
10244
876fbdd84e52
commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents:
1698
diff
changeset
|
29 |
29756 | 30 if exists("g:loaded_matchit") && !exists("b:match_words") |
31 b:match_ignorecase = 0 | |
32 b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name") =~# "mf\\(Comment\\|String\\)$"' | |
33 b:match_words = '\<if\>:\<else\%[if]\>:\<fi\>,' | |
34 .. '\<for\%(\|suffixes\|ever\)\>:\<exit\%(if\|unless\)\>:\<endfor\>,' | |
35 .. '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' | |
36 .. '\<begingroup\>:\<endgroup\>,' | |
37 .. '\<begin\%(logo\)\?char\>:\<endchar\>' | |
38 b:undo_ftplugin ..= "| unlet! b:match_ignorecase b:match_words b:match_skip" | |
10244
876fbdd84e52
commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents:
1698
diff
changeset
|
39 endif |
389 | 40 |
29756 | 41 if !get(g:, 'no_mf_maps', 0) && !get(g:, 'no_plugin_maps', 0) |
42 const mf_regex = { | |
43 'beginsection': '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|beginchar\|beginlogochar\)\>', | |
44 'endsection': '^\s*\%(enddef\|endchar\)\>', | |
45 'beginblock': '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>', | |
46 'endblock': '^\s*\%(endgroup\|fi\|endfor\)\>'} | |
47 | |
48 def MoveAround(count: number, what: string, flags: string) | |
49 search(mf_regex[what], flags .. 's') # 's' sets previous context mark | |
50 var i = 2 | |
51 while i <= count | |
52 search(mf_regex[what], flags) | |
53 i += 1 | |
54 endwhile | |
55 enddef | |
56 | |
57 # Macros to move around | |
58 nnoremap <silent><buffer> [[ <scriptcmd>MoveAround(v:count1, "beginsection", "bW")<cr> | |
59 vnoremap <silent><buffer> [[ <scriptcmd>MoveAround(v:count1, "beginsection", "bW")<cr> | |
60 nnoremap <silent><buffer> ]] <scriptcmd>MoveAround(v:count1, "beginsection", "W") <cr> | |
61 vnoremap <silent><buffer> ]] <scriptcmd>MoveAround(v:count1, "beginsection", "W") <cr> | |
62 nnoremap <silent><buffer> [] <scriptcmd>MoveAround(v:count1, "endsection", "bW")<cr> | |
63 vnoremap <silent><buffer> [] <scriptcmd>MoveAround(v:count1, "endsection", "bW")<cr> | |
64 nnoremap <silent><buffer> ][ <scriptcmd>MoveAround(v:count1, "endsection", "W") <cr> | |
65 vnoremap <silent><buffer> ][ <scriptcmd>MoveAround(v:count1, "endsection", "W") <cr> | |
66 nnoremap <silent><buffer> [{ <scriptcmd>MoveAround(v:count1, "beginblock", "bW")<cr> | |
67 vnoremap <silent><buffer> [{ <scriptcmd>MoveAround(v:count1, "beginblock", "bW")<cr> | |
68 nnoremap <silent><buffer> ]} <scriptcmd>MoveAround(v:count1, "endblock", "W") <cr> | |
69 vnoremap <silent><buffer> ]} <scriptcmd>MoveAround(v:count1, "endblock", "W") <cr> | |
70 | |
71 for mapping in ["[[", "]]", "[]", "][", "[{", "]}"] | |
72 b:undo_ftplugin ..= printf(" | silent! execute 'nunmap <buffer> %s'", mapping) | |
73 b:undo_ftplugin ..= printf(" | silent! execute 'vunmap <buffer> %s'", mapping) | |
74 endfor | |
75 endif | |
76 | |
77 if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter') | |
78 b:browsefilter = "METAFONT Source Files (*.mf)\t*.mf\n" | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29756
diff
changeset
|
79 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29756
diff
changeset
|
80 b:browsefilter ..= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29756
diff
changeset
|
81 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29756
diff
changeset
|
82 b:browsefilter ..= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29756
diff
changeset
|
83 endif |
29756 | 84 b:undo_ftplugin ..= ' | unlet! b:browsefilter' |
85 endif | |
86 | |
87 # vim: sw=2 fdm=marker |