[PR #5296] [MERGED] docs: set vim filetype on man pages for syntax highlighting #5431

Closed
opened 2026-05-05 10:38:16 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/5296
Author: @kmk3
Created: 8/5/2022
Status: Merged
Merged: 8/14/2022
Merged by: @netblue30

Base: masterHead: docs-man-vim-ft


📝 Commits (1)

  • aacd2e7 docs: set vim filetype on man pages for syntax highlighting

📊 Changes

5 files changed (+5 additions, -0 deletions)

View changed files

📝 src/man/firecfg.txt (+1 -0)
📝 src/man/firejail-login.txt (+1 -0)
📝 src/man/firejail-profile.txt (+1 -0)
📝 src/man/firejail-users.txt (+1 -0)
📝 src/man/firejail.txt (+1 -0)

📄 Description

Since the man pages in src/man use a ".txt" file extension (rather than
".1" or ".5"), their filetype is detected by (neo)vim as "text".

So at the bottom of every man page, add a vim modeline in a comment and
set the filetype to "groff", to enable syntax highlighting.

Note: All of the generated ".man", ".1" and ".5" files are currently
being detected as "nroff".

Note2: Set the filetype to "groff" rather than "nroff" because at least
.UR and .UE are groff extensions. These macros look the same with
either filetype, but there may be more extensions being used and the
nroff.vim syntax file (which is included by groff.vim) does things
differently based on which filetype is used.

Based on the following example from (neo)vim's filetype.txt:

or add this modeline to the file:
        /* vim: set filetype=idl : */

See :help groff.vim and :help filetype.txt in (neo)vim.

See also groff_man(7) for the man page macros (including extensions).

Environment: neovim 0.7.2-3 on Artix Linux.

Misc: I noticed this on #5290.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/5296 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 8/5/2022 **Status:** ✅ Merged **Merged:** 8/14/2022 **Merged by:** [@netblue30](https://github.com/netblue30) **Base:** `master` ← **Head:** `docs-man-vim-ft` --- ### 📝 Commits (1) - [`aacd2e7`](https://github.com/netblue30/firejail/commit/aacd2e7d8dc7d84cf00ff63c6fdd932f1136f47c) docs: set vim filetype on man pages for syntax highlighting ### 📊 Changes **5 files changed** (+5 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/man/firecfg.txt` (+1 -0) 📝 `src/man/firejail-login.txt` (+1 -0) 📝 `src/man/firejail-profile.txt` (+1 -0) 📝 `src/man/firejail-users.txt` (+1 -0) 📝 `src/man/firejail.txt` (+1 -0) </details> ### 📄 Description Since the man pages in src/man use a ".txt" file extension (rather than ".1" or ".5"), their filetype is detected by (neo)vim as "text". So at the bottom of every man page, add a vim modeline in a comment and set the filetype to "groff", to enable syntax highlighting. Note: All of the generated ".man", ".1" and ".5" files are currently being detected as "nroff". Note2: Set the filetype to "groff" rather than "nroff" because at least .UR and .UE are groff extensions. These macros look the same with either filetype, but there may be more extensions being used and the nroff.vim syntax file (which is included by groff.vim) does things differently based on which filetype is used. Based on the following example from (neo)vim's filetype.txt: or add this modeline to the file: /* vim: set filetype=idl : */ See `:help groff.vim` and `:help filetype.txt` in (neo)vim. See also groff_man(7) for the man page macros (including extensions). Environment: neovim 0.7.2-3 on Artix Linux. Misc: I noticed this on #5290. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:38:16 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#5431
No description provided.