Bram Moolenaar | a6c27c4 | 2019-05-09 19:16:22 +0200 | [diff] [blame] | 1 | " Vim filetype plugin |
| 2 | " Language: roff(7) |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 3 | " Maintainer: Aman Verma |
| 4 | " Homepage: https://github.com/a-vrma/vim-nroff-ftplugin |
Wu, Zhenyu | 8f3277f | 2025-02-12 20:58:57 +0100 | [diff] [blame] | 5 | " Document: https://www.gnu.org/software/groff/manual/groff.html |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 6 | " Previous Maintainer: Chris Spiegel <cspiegel@gmail.com> |
Wu, Zhenyu | 8f3277f | 2025-02-12 20:58:57 +0100 | [diff] [blame] | 7 | " 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 Kawashima | fbbaa6e | 2025-04-16 18:20:59 +0200 | [diff] [blame] | 10 | " 2025 Apr 16 by Eisuke Kawashima (cpoptions #17121) |
Eisuke Kawashima | e36a931 | 2025-04-24 22:26:02 +0200 | [diff] [blame] | 11 | " 2025 Apr 24 by Eisuke Kawashima (move options from syntax to ftplugin #17174) |
jtmr05 | e4c157b | 2025-06-18 18:41:14 +0200 | [diff] [blame] | 12 | " 2025 Jun 18 by Vim Project: update commentstring option (#17516) |
Bram Moolenaar | a6c27c4 | 2019-05-09 19:16:22 +0200 | [diff] [blame] | 13 | |
| 14 | if exists("b:did_ftplugin") |
| 15 | finish |
| 16 | endif |
| 17 | let b:did_ftplugin = 1 |
| 18 | |
Eisuke Kawashima | fbbaa6e | 2025-04-16 18:20:59 +0200 | [diff] [blame] | 19 | let s:cpo_save = &cpo |
| 20 | set cpo&vim |
| 21 | |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 22 | setlocal commentstring=.\\\"\ %s |
jtmr05 | e4c157b | 2025-06-18 18:41:14 +0200 | [diff] [blame] | 23 | setlocal comments=:.\\\",:\\\",:'\\\",:''' |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 24 | setlocal sections+=Sh |
Wu, Zhenyu | 8f3277f | 2025-02-12 20:58:57 +0100 | [diff] [blame] | 25 | setlocal define=.\s*de |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 26 | |
Eisuke Kawashima | e36a931 | 2025-04-24 22:26:02 +0200 | [diff] [blame] | 27 | if get(b:, 'preprocs_as_sections') |
| 28 | setlocal sections=EQTSPS[\ G1GS |
| 29 | endif |
| 30 | |
| 31 | let b:undo_ftplugin = 'setlocal commentstring< comments< sections& define<' |
| 32 | |
| 33 | if get(b:, 'nroff_is_groff') |
| 34 | " groff_ms exdented paragraphs are not in the default paragraphs list. |
| 35 | setlocal paragraphs+=XP |
| 36 | let b:undo_ftplugin .= ' paragraphs&' |
| 37 | endif |
Wu, Zhenyu | 8f3277f | 2025-02-12 20:58:57 +0100 | [diff] [blame] | 38 | |
| 39 | if exists('loaded_matchit') |
| 40 | let b:match_words = '^\.\s*ie\>:^\.\s*el\>' |
| 41 | \ . ',^\.\s*LB\>:^\.\s*LI\>:^\.\s*LE\>' |
| 42 | \ . ',^\.\s*TS\>:^\.\s*TE\>' |
| 43 | \ . ',^\.\s*PS\>:^\.\s*P[EF]\>' |
| 44 | \ . ',^\.\s*EQ\>:^\.\s*EN\>' |
| 45 | \ . ',^\.\s*[\>:^\.\s*]\>' |
| 46 | \ . ',^\.\s*FS\>:^\.\s*FE\>' |
| 47 | let b:undo_ftplugin .= "| unlet b:match_words" |
| 48 | endif |
Eisuke Kawashima | fbbaa6e | 2025-04-16 18:20:59 +0200 | [diff] [blame] | 49 | |
| 50 | let &cpo = s:cpo_save |
| 51 | unlet s:cpo_save |