neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 756043760b59adb2e708cfbb6c8f5c0674ba4537
parent 5582005ac76640f9cbda24937662a83fb5a65abb
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Thu, 13 Nov 2025 08:22:11 +0800

vim-patch:9.1.1909: filetype: .mom files recognized as nroff files (#36543)

Problem:  filetype: .mom files recognized as nroff files
Solution: Detect *.mom files as groff filetype instead
          (Callum Andrew)

Reference:
- mom macros are written specifically for groff:
  https://www.schaffter.ca/mom/

closes: vim/vim#18718

https://github.com/vim/vim/commit/23e12c0b7ec02cc374f111fd9dfaa84734dbb7f5

Co-authored-by: Callum Andrew <dev@candrew.net>
Diffstat:
Mruntime/lua/vim/filetype.lua | 3++-
Mtest/old/testdir/test_filetype.vim | 3++-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua @@ -549,6 +549,8 @@ local extension = { graphql = 'graphql', graphqls = 'graphql', gretl = 'gretl', + groff = 'groff', + mom = 'groff', gradle = 'groovy', groovy = 'groovy', gsp = 'gsp', @@ -874,7 +876,6 @@ local extension = { roff = 'nroff', tmac = 'nroff', man = 'nroff', - mom = 'nroff', nr = 'nroff', tr = 'nroff', nsi = 'nsis', diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim @@ -343,6 +343,7 @@ func s:GetFilenameChecks() abort \ 'grads': ['file.gs'], \ 'graphql': ['file.graphql', 'file.graphqls', 'file.gql'], \ 'gretl': ['file.gretl'], + \ 'groff': ['file.groff', 'file.mom'], \ 'groovy': ['file.gradle', 'file.groovy', 'Jenkinsfile'], \ 'group': ['any/etc/group', 'any/etc/group-', 'any/etc/group.edit', 'any/etc/gshadow', 'any/etc/gshadow-', 'any/etc/gshadow.edit', 'any/var/backups/group.bak', 'any/var/backups/gshadow.bak', '/etc/group', '/etc/group-', '/etc/group.edit', '/etc/gshadow', '/etc/gshadow-', '/etc/gshadow.edit', '/var/backups/group.bak', '/var/backups/gshadow.bak'], \ 'grub': ['/boot/grub/menu.lst', '/boot/grub/grub.conf', '/etc/grub.conf', 'any/boot/grub/grub.conf', 'any/boot/grub/menu.lst', 'any/etc/grub.conf'], @@ -573,7 +574,7 @@ func s:GetFilenameChecks() abort \ 'nix': ['file.nix'], \ 'norg': ['file.norg'], \ 'nqc': ['file.nqc'], - \ 'nroff': ['file.tr', 'file.nr', 'file.roff', 'file.tmac', 'file.mom', 'tmac.file'], + \ 'nroff': ['file.tr', 'file.nr', 'file.roff', 'file.tmac', 'tmac.file'], \ 'nsis': ['file.nsi', 'file.nsh'], \ 'ntriples': ['file.nt'], \ 'nu': ['file.nu'],