From f66674cf429aa1fac79e522b45372d7e3d37a902 Mon Sep 17 00:00:00 2001 From: Radu Dineiu Date: Sat, 23 Aug 2025 13:47:51 +0200 Subject: [PATCH] runtime(fstab): Added mtab support to fstab syntax. closes: #18074 Signed-off-by: Radu Dineiu Signed-off-by: Christian Brabandt --- runtime/ftplugin/fstab.vim | 11 ++++++++--- runtime/syntax/fstab.vim | 29 +++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/runtime/ftplugin/fstab.vim b/runtime/ftplugin/fstab.vim index d340c4b8d5..dd5acfd303 100644 --- a/runtime/ftplugin/fstab.vim +++ b/runtime/ftplugin/fstab.vim @@ -2,10 +2,11 @@ " Language: fstab file " Maintainer: Radu Dineiu " URL: https://raw.github.com/rid9/vim-fstab/master/ftplugin/fstab.vim -" Last Change: 2025 Mar 31 -" Version: 1.0.1 +" Last Change: 2025 Aug 21 +" Version: 1.1.0 " " Changelog: +" - 2025 Aug 21 added support for mtab " - 2024 May 23 by Riley Bruins ('commentstring') " - 2025 Mar 31 added setlocal formatoptions-=t " @@ -20,6 +21,10 @@ let b:did_ftplugin = 1 setlocal commentstring=#\ %s setlocal formatoptions-=t -let b:undo_ftplugin = "setlocal commentstring< formatoptions<" +if expand('%:t') == 'mtab' + let b:fstab_enable_mtab = 1 +endif + +let b:undo_ftplugin = "setlocal commentstring< | setlocal formatoptions<" " vim: ts=8 ft=vim diff --git a/runtime/syntax/fstab.vim b/runtime/syntax/fstab.vim index 64d5bee3d0..442bc94f3c 100644 --- a/runtime/syntax/fstab.vim +++ b/runtime/syntax/fstab.vim @@ -2,8 +2,8 @@ " Language: fstab file " Maintainer: Radu Dineiu " URL: https://raw.github.com/rid9/vim-fstab/master/syntax/fstab.vim -" Last Change: 2024 Jul 11 -" Version: 1.6.4 +" Last Change: 2025 Aug 21 +" Version: 1.7.0 " " Credits: " David Necas (Yeti) @@ -18,6 +18,9 @@ " " let fstab_unknown_device_errors = 0 " do not highlight unknown devices as errors +" +" Changelog: +" - 2025 Aug 21 added support for mtab " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -402,6 +405,28 @@ syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster " Whole line comments syn match fsCommentLine /^#.*$/ contains=@Spell +if exists('b:fstab_enable_mtab') && b:fstab_enable_mtab == 1 + " mtab + " ---- + syn keyword fsDeviceKeyword contained binfmt_misc bpf cgroup2 configfs debugfs efivarfs fusectl hugetlbfs mqueue portal pstore securityfs udev ramfs + syn match fsDeviceKeyword contained /^systemd-1/ + syn match fsDeviceKeyword contained /^\/dev\S\+/ + + " devpts + syn match fsOptionsKeywords contained /\