vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

sshpublickey.vim (1485B)


      1 " Vim syntax file
      2 " Language:     OpenSSH public key
      3 " Author:       Fionn Fitzmaurice (github.com/fionn)
      4 " Maintainer:   Fionn Fitzmaurice (github.com/fionn)
      5 " License:      Vim & Apache 2.0
      6 " Last Change:  2026 Jun 28
      7 " 2026 Sep 27 by Vim project: Add a new SSH key type
      8 " 2026 Sep 28 by Vim project: update syntax file
      9 
     10 if exists("b:current_syntax")
     11     finish
     12 endif
     13 
     14 syn iskeyword _,.,@-@,-,a-z,A-Z,48-57
     15 
     16 syn keyword sshKeyType ssh-mldsa44-ed25519 nextgroup=sshKeyBase64Encoded skipwhite
     17 syn keyword sshKeyType ssh-mldsa44-ed25519@openssh.com nextgroup=sshKeyBase64Encoded skipwhite
     18 syn keyword sshKeyType ssh-ed25519 nextgroup=sshKeyBase64Encoded skipwhite
     19 syn keyword sshKeyType sk-ssh-ed25519@openssh.com nextgroup=sshKeyBase64Encoded skipwhite
     20 syn keyword sshKeyType ecdsa-sha2-nistp256 nextgroup=sshKeyBase64Encoded skipwhite
     21 syn keyword sshKeyType ecdsa-sha2-nistp384 nextgroup=sshKeyBase64Encoded skipwhite
     22 syn keyword sshKeyType ecdsa-sha2-nistp521 nextgroup=sshKeyBase64Encoded skipwhite
     23 syn keyword sshKeyType sk-ecdsa-sha2-nistp256@openssh.com nextgroup=sshKeyBase64Encoded skipwhite
     24 syn keyword sshKeyType ssh-rsa nextgroup=sshKeyBase64Encoded skipwhite
     25 
     26 syn match sshKeyBase64Encoded "AAAA[a-zA-Z0-9/+]\{64,8000}=\{,2}" contained nextgroup=sshKeyComment
     27 syn match sshKeyComment ".*$" contained
     28 
     29 syn match sshKeyComment "#.*$"
     30 
     31 hi def link sshKeyType Type
     32 hi def link sshKeyBase64Encoded String
     33 hi def link sshKeyComment Comment
     34 
     35 let b:current_syntax = "sshpublickey"