diff options
author | 2023-06-09 15:48:23 -0300 | |
---|---|---|
committer | 2023-06-10 14:16:41 -0300 | |
commit | 6273865394760e9dbd522e5f348a837c8e02408a (patch) | |
tree | 9b05d8a3e99d2f238bdf91457668ea84d9050f57 /contrib/vim | |
parent | contrib/vim: sort paths in ftdetect (diff) | |
download | firejail-6273865394760e9dbd522e5f348a837c8e02408a.tar.gz firejail-6273865394760e9dbd522e5f348a837c8e02408a.tar.zst firejail-6273865394760e9dbd522e5f348a837c8e02408a.zip |
contrib/vim: match profile files more broadly
Currently it only sets the appropriate filetype for files in
`/etc/firejail` and `~/.config/firejail`.
With this commit, the firejail filetype should also be set when opening
`etc/inc/*.inc`, for example, as long as there is a "firejail" directory
somewhere before that (such as in `/foo/firejail/bar/etc/inc/*.inc`).
Note: At least `*/firejail/*.inc` needs to force the match (by using
`set filetype` rather than `setfiletype`), or else the default vim
checks take precedence (and the filetype for all files in
`etc/inc/*.inc` gets set to `pov`).
Fixes #4319.
Relates to #2679.
Co-authored-by: rusty-snake <41237666+rusty-snake@users.noreply.github.com>
Diffstat (limited to 'contrib/vim')
-rw-r--r-- | contrib/vim/ftdetect/firejail.vim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/vim/ftdetect/firejail.vim b/contrib/vim/ftdetect/firejail.vim index d69d66e6e..6180048f7 100644 --- a/contrib/vim/ftdetect/firejail.vim +++ b/contrib/vim/ftdetect/firejail.vim | |||
@@ -1,6 +1,12 @@ | |||
1 | " Default paths | ||
1 | autocmd BufNewFile,BufRead /etc/firejail/*.inc setfiletype firejail | 2 | autocmd BufNewFile,BufRead /etc/firejail/*.inc setfiletype firejail |
2 | autocmd BufNewFile,BufRead /etc/firejail/*.local setfiletype firejail | 3 | autocmd BufNewFile,BufRead /etc/firejail/*.local setfiletype firejail |
3 | autocmd BufNewFile,BufRead /etc/firejail/*.profile setfiletype firejail | 4 | autocmd BufNewFile,BufRead /etc/firejail/*.profile setfiletype firejail |
4 | autocmd BufNewFile,BufRead ~/.config/firejail/*.inc setfiletype firejail | 5 | autocmd BufNewFile,BufRead ~/.config/firejail/*.inc setfiletype firejail |
5 | autocmd BufNewFile,BufRead ~/.config/firejail/*.local setfiletype firejail | 6 | autocmd BufNewFile,BufRead ~/.config/firejail/*.local setfiletype firejail |
6 | autocmd BufNewFile,BufRead ~/.config/firejail/*.profile setfiletype firejail | 7 | autocmd BufNewFile,BufRead ~/.config/firejail/*.profile setfiletype firejail |
8 | |||
9 | " Arbitrary paths | ||
10 | autocmd BufNewFile,BufRead */firejail/*.inc set filetype=firejail | ||
11 | autocmd BufNewFile,BufRead */firejail/*.local set filetype=firejail | ||
12 | autocmd BufNewFile,BufRead */firejail/*.profile set filetype=firejail | ||