blob: cd2680ef584a589f6792033495c1698df942c338 [file] [log] [blame]
Bram Moolenaara6c27c42019-05-09 19:16:22 +02001" Vim filetype plugin
2" Language: roff(7)
Bram Moolenaar23515b42020-11-29 14:36:24 +01003" Maintainer: Aman Verma
4" Homepage: https://github.com/a-vrma/vim-nroff-ftplugin
Wu, Zhenyu8f3277f2025-02-12 20:58:57 +01005" Document: https://www.gnu.org/software/groff/manual/groff.html
Riley Bruins0a083062024-06-03 20:40:45 +02006" Previous Maintainer: Chris Spiegel <cspiegel@gmail.com>
Wu, Zhenyu8f3277f2025-02-12 20:58:57 +01007" Last Changes:
8" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring' #14843)
9" 2025 Feb 12 by Wu, Zhenyu <wuzhenyu@ustc.edu> (matchit configuration #16619)
Eisuke Kawashimafbbaa6e2025-04-16 18:20:59 +020010" 2025 Apr 16 by Eisuke Kawashima (cpoptions #17121)
Eisuke Kawashimae36a9312025-04-24 22:26:02 +020011" 2025 Apr 24 by Eisuke Kawashima (move options from syntax to ftplugin #17174)
Bram Moolenaara6c27c42019-05-09 19:16:22 +020012
13if exists("b:did_ftplugin")
14 finish
15endif
16let b:did_ftplugin = 1
17
Eisuke Kawashimafbbaa6e2025-04-16 18:20:59 +020018let s:cpo_save = &cpo
19set cpo&vim
20
Riley Bruins0a083062024-06-03 20:40:45 +020021setlocal commentstring=.\\\"\ %s
Bram Moolenaar23515b42020-11-29 14:36:24 +010022setlocal comments=:.\\\"
23setlocal sections+=Sh
Wu, Zhenyu8f3277f2025-02-12 20:58:57 +010024setlocal define=.\s*de
Bram Moolenaar23515b42020-11-29 14:36:24 +010025
Eisuke Kawashimae36a9312025-04-24 22:26:02 +020026if get(b:, 'preprocs_as_sections')
27 setlocal sections=EQTSPS[\ G1GS
28endif
29
30let b:undo_ftplugin = 'setlocal commentstring< comments< sections& define<'
31
32if get(b:, 'nroff_is_groff')
33 " groff_ms exdented paragraphs are not in the default paragraphs list.
34 setlocal paragraphs+=XP
35 let b:undo_ftplugin .= ' paragraphs&'
36endif
Wu, Zhenyu8f3277f2025-02-12 20:58:57 +010037
38if exists('loaded_matchit')
39 let b:match_words = '^\.\s*ie\>:^\.\s*el\>'
40 \ . ',^\.\s*LB\>:^\.\s*LI\>:^\.\s*LE\>'
41 \ . ',^\.\s*TS\>:^\.\s*TE\>'
42 \ . ',^\.\s*PS\>:^\.\s*P[EF]\>'
43 \ . ',^\.\s*EQ\>:^\.\s*EN\>'
44 \ . ',^\.\s*[\>:^\.\s*]\>'
45 \ . ',^\.\s*FS\>:^\.\s*FE\>'
46 let b:undo_ftplugin .= "| unlet b:match_words"
47endif
Eisuke Kawashimafbbaa6e2025-04-16 18:20:59 +020048
49let &cpo = s:cpo_save
50unlet s:cpo_save