Files
neovim/runtime/syntax/screen.vim
zeertzjq 6f4ebdad80 vim-patch:a65741c: runtime(screen): Bring the syntax up to version 5
* Match command names introduced in v.5.0.0 (August 2024):
  "auth", "multiinput", "status", "truecolor".
* Match command names introduced in v.4.5.0 (January 2017):
  "defdynamictitle" and "dynamictitle".
* Deprecate command names that have been retired thus far:
  "debug", "maxwin", "nethack", "password", "time".
* Remove a spurious "defzombie" command name (this name is
  just lamented over in the documentation entry for the
  "zombie" command as being more fitting than "zombie"
  because its effects are not local to a window; no such
  name is entered in "comm.c").
* Separately group the Braille navigation commands, "bd_*",
  that may belong to another, superset program Dotscreen:
  (see doc/README.DOTSCREEN and commit 848af83f5 elsewhere).
* Revise string escape characters:
    - Recognise more characters, "%[`<>=eEfFHOPSxX]".
    - Recognise undocumented characters, "%[gNpT]", and list
      relevant Screen commits in the comments.
    - Match optional qualifiers, "%\%([-+L]\|\d\+\).".
* Match more items in double-quoted command arguments.
* Match unquoted environment variable references.
* Match octal numbers, e.g. "defmode 0622".
* Match escaped octal numbers, e.g. "bind \077 help".

Unless a Dotscreen program (c. 1995) or an older than
v.4.3.1 (c. 2015) Screen program, that was compiled with
"HAVE_BRAILLE" defined, is installed and needs configuring,
add to ".vim/after/syntax/screen.vim":
-----------------------------------------------------------
if hlexists('dotscreenCommands')
    syn clear dotscreenCommands
endif
-----------------------------------------------------------

To BACKPORT the updated syntax file to version 4 of Screen,
add to ".vim/after/syntax/screen.vim":
-----------------------------------------------------------
if hlexists('screenDeprecatedCommands')
    syn clear screenDeprecatedCommands
endif

if hlexists('screenVersion5Commands')
    syn clear screenVersion5Commands
endif
-----------------------------------------------------------

References:
https://lists.gnu.org/archive/html/info-gnu/2024-08/msg00004.html
https://lists.gnu.org/archive/html/info-gnu/2017-01/msg00007.html
https://git.savannah.gnu.org/git/screen.git

closes: vim/vim#20550

a65741c8b3

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Co-authored-by: Dmitri Vereshchagin <dmitri.vereshchagin@gmail.com>
2026-07-02 08:14:48 +08:00

298 lines
11 KiB
VimL

" Vim syntax file
" Language: screen(1) configuration file
" Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com>
" Previous Maintainers: Dmitri Vereshchagin <dmitri.vereshchagin@gmail.com>
" Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2026 Jun 29
if exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
syn match screenEscape '\\.' contains=screenOctalNumber
syn keyword screenTodo contained TODO FIXME XXX NOTE
syn region screenComment display oneline start='#' end='$'
\ contains=screenTodo,@Spell
syn region screenString display oneline start=+"+ skip=+\\"+ end=+"+
\ contains=screenVariable,screenSpecials,screenEscape
syn region screenLiteral display oneline start=+'+ skip=+\\'+ end=+'+
syn match screenVariable display '$\%(\h\w*\|{\h\w*}\)'
syn keyword screenBoolean on off
syn match screenDecimalNumber display '\<\d\+\>'
syn match screenOctalNumber display '\<0\o\+\>'
" FIXME: Undocumented escape characters (winmsg.h): "g" (see commit
" 945ad5414), "N" (49f592e21), "p" (6ead6f557), "T" (60893c465).
syn region screenSpecials contained start=+%{+ end=+}+
syn match screenSpecials contained '%[%aAdeEfFghHlmNPsStTuxXyY?:]'
syn match screenSpecials contained '%\d*[n`=<>]' contains=screenSpecialsQualifier
syn match screenSpecials contained '%0\?[cC]' contains=screenSpecialsQualifier
syn match screenSpecials contained '%L\?[DMW]' contains=screenSpecialsQualifier
syn match screenSpecials contained '%-\?O' contains=screenSpecialsQualifier
syn match screenSpecials contained '%+\?p' contains=screenSpecialsQualifier
syn match screenSpecials contained '%[-+]\?L\?[w=<>]' contains=screenSpecialsQualifier
syn match screenSpecialsQualifier contained '\d\+'
syn match screenSpecialsQualifier contained '[-+L]'
syn keyword screenCommands
\ acladd
\ aclchg
\ acldel
\ aclgrp
\ aclumask
\ activity
\ addacl
\ allpartial
\ altscreen
\ at
\ attrcolor
\ autodetach
\ autonuke
\ backtick
\ bce
\ bell
\ bell_msg
\ bind
\ bindkey
\ blanker
\ blankerprg
\ break
\ breaktype
\ bufferfile
\ bumpleft
\ bumpright
\ c1
\ caption
\ chacl
\ charset
\ chdir
\ cjkwidth
\ clear
\ collapse
\ colon
\ command
\ compacthist
\ console
\ copy
\ crlf
\ debug
\ defautonuke
\ defbce
\ defbreaktype
\ defc1
\ defcharset
\ defdynamictitle
\ defencoding
\ defescape
\ defflow
\ defgr
\ defhstatus
\ defkanji
\ deflog
\ deflogin
\ defmode
\ defmonitor
\ defmousetrack
\ defnonblock
\ defobuflimit
\ defscrollback
\ defshell
\ defsilence
\ defslowpaste
\ defutf8
\ defwrap
\ defwritelock
\ detach
\ digraph
\ dinfo
\ displays
\ dumptermcap
\ dynamictitle
\ echo
\ encoding
\ escape
\ eval
\ exec
\ fit
\ flow
\ focus
\ focusminsize
\ gr
\ group
\ hardcopy
\ hardcopy_append
\ hardcopydir
\ hardstatus
\ height
\ help
\ history
\ hstatus
\ idle
\ ignorecase
\ info
\ kanji
\ kill
\ lastmsg
\ layout
\ license
\ lockscreen
\ log
\ logfile
\ login
\ logtstamp
\ mapdefault
\ mapnotnext
\ maptimeout
\ markkeys
\ maxwin
\ meta
\ monitor
\ mousetrack
\ msgminwait
\ msgwait
\ multiuser
\ nethack
\ next
\ nonblock
\ number
\ obuflimit
\ only
\ other
\ partial
\ password
\ paste
\ pastefont
\ pow_break
\ pow_detach
\ pow_detach_msg
\ prev
\ printcmd
\ process
\ quit
\ readbuf
\ readreg
\ redisplay
\ register
\ remove
\ removebuf
\ rendition
\ reset
\ resize
\ screen
\ scrollback
\ select
\ sessionname
\ setenv
\ setsid
\ shell
\ shelltitle
\ silence
\ silencewait
\ sleep
\ slowpaste
\ sorendition
\ sort
\ source
\ split
\ startup_message
\ stuff
\ su
\ suspend
\ term
\ termcap
\ termcapinfo
\ terminfo
\ time
\ title
\ umask
\ unbindall
\ unsetenv
\ utf8
\ vbell
\ vbell_msg
\ vbellwait
\ verbose
\ version
\ wall
\ width
\ windowlist
\ windows
\ wrap
\ writebuf
\ writelock
\ xoff
\ xon
\ zmodem
\ zombie
\ zombie_timeout
syn keyword screenVersion5Commands
\ auth
\ multiinput
\ status
\ truecolor
" Braille navigation commands from a superset program Dotscreen (see some
" descriptions in doc/README.DOTSCREEN).
syn keyword dotscreenCommands
\ bd_bc_down
\ bd_bc_left
\ bd_bc_right
\ bd_bc_up
\ bd_bell
\ bd_braille_table
\ bd_eightdot
\ bd_info
\ bd_link
\ bd_lower_left
\ bd_lower_right
\ bd_ncrc
\ bd_port
\ bd_scroll
\ bd_skip
\ bd_start_braille
\ bd_type
\ bd_upper_left
\ bd_upper_right
\ bd_width
syn keyword screenDeprecatedCommands
\ debug
\ maxwin
\ nethack
\ password
\ time
hi def link screenEscape Special
hi def link screenComment Comment
hi def link screenTodo Todo
hi def link screenString String
hi def link screenLiteral String
hi def link screenVariable Identifier
hi def link screenBoolean Boolean
hi def link screenNumbers Number
hi def link screenDecimalNumber screenNumbers
hi def link screenOctalNumber screenNumbers
hi def link screenSpecials Special
hi def link screenCommands Keyword
hi def link screenSpecialsQualifier Underlined
hi def link screenVersion5Commands screenCommands
hi def link dotscreenCommands screenCommands
let b:current_syntax = "screen"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2 et