diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-08-04 20:23:48 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-08-05 17:18:21 -0300 |
commit | aacd2e7d8dc7d84cf00ff63c6fdd932f1136f47c (patch) | |
tree | 957de13e5aac9914316fba2bf32e90b48c90a7b0 | |
parent | build(deps): bump github/codeql-action from 2.1.16 to 2.1.17 (diff) | |
download | firejail-aacd2e7d8dc7d84cf00ff63c6fdd932f1136f47c.tar.gz firejail-aacd2e7d8dc7d84cf00ff63c6fdd932f1136f47c.tar.zst firejail-aacd2e7d8dc7d84cf00ff63c6fdd932f1136f47c.zip |
docs: set vim filetype on man pages for syntax highlighting
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.
-rw-r--r-- | src/man/firecfg.txt | 1 | ||||
-rw-r--r-- | src/man/firejail-login.txt | 1 | ||||
-rw-r--r-- | src/man/firejail-profile.txt | 1 | ||||
-rw-r--r-- | src/man/firejail-users.txt | 1 | ||||
-rw-r--r-- | src/man/firejail.txt | 1 |
5 files changed, 5 insertions, 0 deletions
diff --git a/src/man/firecfg.txt b/src/man/firecfg.txt index 280a4aff1..42add6a41 100644 --- a/src/man/firecfg.txt +++ b/src/man/firecfg.txt | |||
@@ -146,3 +146,4 @@ Homepage: https://firejail.wordpress.com | |||
146 | .BR firejail-login (5), | 146 | .BR firejail-login (5), |
147 | .BR firejail-users (5), | 147 | .BR firejail-users (5), |
148 | .BR jailcheck (1) | 148 | .BR jailcheck (1) |
149 | .\" vim: set filetype=groff : | ||
diff --git a/src/man/firejail-login.txt b/src/man/firejail-login.txt index 05afd55b5..f03fc3c37 100644 --- a/src/man/firejail-login.txt +++ b/src/man/firejail-login.txt | |||
@@ -40,3 +40,4 @@ Homepage: https://firejail.wordpress.com | |||
40 | .BR firejail-profile (5), | 40 | .BR firejail-profile (5), |
41 | .BR firejail-users (5), | 41 | .BR firejail-users (5), |
42 | .BR jailcheck (1) | 42 | .BR jailcheck (1) |
43 | .\" vim: set filetype=groff : | ||
diff --git a/src/man/firejail-profile.txt b/src/man/firejail-profile.txt index be1f55f0f..ecfcabb87 100644 --- a/src/man/firejail-profile.txt +++ b/src/man/firejail-profile.txt | |||
@@ -1031,3 +1031,4 @@ Homepage: https://firejail.wordpress.com | |||
1031 | 1031 | ||
1032 | .UR https://github.com/netblue30/firejail/wiki/Creating-Profiles | 1032 | .UR https://github.com/netblue30/firejail/wiki/Creating-Profiles |
1033 | .UE | 1033 | .UE |
1034 | .\" vim: set filetype=groff : | ||
diff --git a/src/man/firejail-users.txt b/src/man/firejail-users.txt index e3cce7ed5..7aa151680 100644 --- a/src/man/firejail-users.txt +++ b/src/man/firejail-users.txt | |||
@@ -60,3 +60,4 @@ Homepage: https://firejail.wordpress.com | |||
60 | .BR firejail-profile (5), | 60 | .BR firejail-profile (5), |
61 | .BR firejail-login (5), | 61 | .BR firejail-login (5), |
62 | .BR jailcheck (1) | 62 | .BR jailcheck (1) |
63 | .\" vim: set filetype=groff : | ||
diff --git a/src/man/firejail.txt b/src/man/firejail.txt index 087d1c85a..029c9dd36 100644 --- a/src/man/firejail.txt +++ b/src/man/firejail.txt | |||
@@ -3611,3 +3611,4 @@ Homepage: https://firejail.wordpress.com | |||
3611 | .UE , | 3611 | .UE , |
3612 | .UR https://github.com/netblue30/firejail | 3612 | .UR https://github.com/netblue30/firejail |
3613 | .UE | 3613 | .UE |
3614 | .\" vim: set filetype=groff : | ||