From 84cd87908e81da33c8daa5646668939d7ea6afa7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 29 Jun 2026 07:48:17 +0800 Subject: vim-patch:9.2.0742: filetype: SSH keys and related filetypes not recognized (#40469) Problem: filetype: SSH keys and related filetypes not recognized Solution: Detect sshpublickey, sshknownhosts sshauthorizedkeys and sshallowedsigners filetypes, add syntax scripts for those filetypes (Fionn Fitzmaurice) This adds syntax highlighting for SSH public keys, as well as related filetypes derived from this (SSH authorized keys, SSH known hosts and SSH allowed signers). Also add filetype detection based on the path and name. closes: vim/vim#20635 https://github.com/vim/vim/commit/6e66ebc0fdd7804db4baa076e62c78d208adaeaf Co-authored-by: Fionn Fitzmaurice --- runtime/lua/vim/filetype.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 6c4e5fd43a..d04a355cf5 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1279,6 +1279,7 @@ local extension = { srt = 'srt', ssa = 'ssa', ass = 'ssa', + allowed_signers = 'sshallowedsigners', st = 'st', ipd = 'starlark', sky = 'starlark', @@ -1981,8 +1982,9 @@ local filename = { Snakefile = 'snakemake', ['.sqlite_history'] = 'sql', ['squid.conf'] = 'squid', - ['ssh_config'] = 'sshconfig', - ['sshd_config'] = 'sshdconfig', + allowed_signers = 'sshallowedsigners', + ssh_config = 'sshconfig', + sshd_config = 'sshdconfig', ['/etc/sudoers'] = 'sudoers', ['sudoers.tmp'] = 'sudoers', ['/etc/sysctl.conf'] = 'sysctl', @@ -2181,9 +2183,11 @@ local pattern = { ['/etc/slp%.conf$'] = 'slpconf', ['/etc/slp%.reg$'] = 'slpreg', ['/etc/slp%.spi$'] = 'slpspi', - ['/etc/sudoers%.d/'] = starsetf('sudoers'), ['/etc/ssh/ssh_config%.d/.*%.conf$'] = 'sshconfig', ['/etc/ssh/sshd_config%.d/.*%.conf$'] = 'sshdconfig', + ['^/etc/ssh/ssh_known_hosts$'] = 'sshknownhosts', + ['^/etc/ssh/.+%.pub$'] = 'sshpublickey', + ['/etc/sudoers%.d/'] = starsetf('sudoers'), ['/etc/sudoers$'] = 'sudoers', ['/etc/sysctl%.conf$'] = 'sysctl', ['/etc/sysctl%.d/.*%.conf$'] = 'sysctl', @@ -2543,6 +2547,9 @@ local pattern = { ['/%.pinforc$'] = 'pinfo', ['^${HOME}/%.xinitrc$'] = 'sh', ['^${HOME}/%.xserverrc$'] = 'sh', + ['/%.ssh/authorized_keys$'] = 'sshauthorizedkeys', + ['/%.ssh/known_hosts$'] = 'sshknownhosts', + ['/%.ssh/.+%.pub$'] = 'sshpublickey', ['/%.cargo/credentials$'] = 'toml', ['/%.init/.*%.override$'] = 'upstart', ['/%.kube/kuberc$'] = 'yaml', -- cgit