" otty.vim — Vim / Neovim syntax for the Otty terminal config.
" Target file: ~/.config/otty/config.toml (Ghostty-style `key = value`).
"
" GENERATED by resources/editors/generate.py from packages/config/src/lib.rs
" (Config::known_keys()). Do not edit by hand — re-run the generator instead.

if exists('b:current_syntax')
  finish
endif

syn case match

" Comments ------------------------------------------------------------------
syn keyword ottyTodo    contained TODO FIXME XXX NOTE HACK
syn match   ottyComment /#.*$/ contains=ottyTodo

" Values --------------------------------------------------------------------
syn keyword ottyBoolean true false
syn match   ottyNumber  /\<\d\+\%(\.\d\+\)\?\>/
syn match   ottyEscape  /\\./ contained
syn region  ottyString  start=/"/ skip=/\\"/ end=/"/ contains=ottyColor,ottyEscape
" Hex colors: #rgb / #rrggbb / #rrggbbaa. `containedin` forces them to light
" up inside the quoted color values (the common case); the bare match also
" covers the rare unquoted color.
syn match   ottyColor   /#\x\{8}\|#\x\{6}\|#\x\{3}/ containedin=ottyString
" Enum-like literal values on the value side.
syn match   ottyEnum    /\<\%(first-line-with-content\|enclosed-alphanumerics\|last-line-with-content\|first-line-in-middle\|last-line-in-middle\|same-as-last-line\|geometric-shapes\|restore_session\|math-operators\|misc-technical\|after-current\|copy-or-paste\|multiple-tabs\|option-escape\|tab-unfocused\|block_hollow\|context-menu\|misc-symbols\|number-forms\|primary-only\|sidebar-left\|cursor-line\|default-app\|sixteen-bit\|tabs-bottom\|fullscreen\|macos-like\|new_window\|perceptual\|eight-bit\|last_used\|srgb-over\|synthetic\|underline\|whitelist\|ask_once\|dingbats\|disabled\|manually\|redacted\|tabs-top\|browser\|chinese\|current\|disable\|english\|focused\|process\|always\|arrows\|custom\|escape\|ignore\|linear\|smooth\|system\|allow\|block\|frame\|never\|paste\|plain\|right\|auto\|calt\|copy\|deny\|dlig\|grid\|home\|left\|none\|all\|ask\|bar\|end\|off\)\>/

" The assignment separator.
syn match   ottyAssign  /=/

" Keys ----------------------------------------------------------------------
" Any `key =` at line start (covers palette-N, keybind, future keys).
syn match   ottyKey      /^\s*\zs[a-z][a-z0-9-]*\ze\s*=/
" Known options override the generic key color (last definition wins), so a
" typo'd key stays dim while real options stand out.
syn match   ottyKnownKey /^\s*\zs\%(privilege-notification-on-watch-finish\|privilege-caffeinate-agent-processing\|privilege-notify-agent-awaiting-input\|privilege-badge-agent-awaiting-input\|privilege-notify-agent-task-complete\|privilege-badge-agent-task-complete\|editor-default-to-preview-readonly\|new-window-when-all-windows-closed\|autocomplete-description-language\|session-restore-process-allowlist\|shell-integration-disabled-shells\|bypass-mouse-reporting-modifiers\|font-family-fallback-bold-italic\|privilege-badge-agent-processing\|privilege-notification-on-finish\|autocomplete-on-device-learning\|privilege-notification-on-error\|terminal-scroll-past-end-sticky\|terminal-scroll-past-first-line\|autocomplete-inline-suggestion\|clipboard-paste-bracketed-safe\|clipboard-trim-trailing-spaces\|privilege-resume-agent-session\|quick-terminal-persist-session\|live-resize-sigwinch-delay-ms\|quit-after-last-window-closed\|autocomplete-show-candidates\|ipc-allow-sensitive-sessions\|privilege-notification-shell\|autocomplete-history-ignore\|font-family-fallback-italic\|privilege-badge-exit-status\|selection-backspace-deletes\|session-restore-multiplayer\|window-hide-dirty-indicator\|clipboard-paste-protection\|dock-icon-animate-progress\|link-click-over-mouse-mode\|open-quickly-folders-limit\|editor-visible-whitespace\|font-family-fallback-bold\|global-hotkey-open-window\|privilege-clipboard-shell\|selection-clear-on-typing\|session-restore-processes\|dedup-repaint-scrollback\|editor-show-line-numbers\|privilege-badge-activity\|privilege-sound-on-error\|terminal-resume-protocol\|terminal-scroll-past-end\|window-working-directory\|font-family-bold-italic\|font-ligatures-alphabet\|mouse-hide-while-typing\|mouse-scroll-multiplier\|notification-foreground\|osc-color-report-format\|secure-input-indication\|selection-clear-on-copy\|split-working-directory\|unfocused-split-opacity\|arrow-box-drawing-join\|ctrl-hold-threshold-ms\|editor-scroll-past-end\|hide-auto-approve-pill\|notification-attention\|session-restore-banner\|terminal-scroll-smooth\|windows-text-rendering\|autocomplete-shortcut\|command-history-scope\|detect-awaiting-input\|dock-icon-error-badge\|link-scheme-allowlist\|mouse-shift-to-select\|privilege-mouse-shell\|privilege-sound-shell\|privilege-title-shell\|progress-bar-commands\|tab-working-directory\|vt-keypad-app-allowed\|auto-approve-enabled\|auto-hide-tabs-panel\|auto-theme-dark-mode\|confirm-close-window\|cursor-click-to-move\|font-family-fallback\|frecency-auto-record\|selection-background\|selection-foreground\|cli-allow-overwrite\|details-panel-width\|focus-follows-mouse\|freeze-inactive-tab\|ipc-allow-send-keys\|macos-option-as-alt\|recipe-replay-saved\|session-log-size-mb\|ui-panel-background\|adjust-cell-height\|background-opacity\|confirm-close-pane\|cursor-style-blink\|default-git-client\|font-family-italic\|notification-sound\|quick-terminal-cwd\|recipe-replay-file\|right-click-action\|shift-arrow-select\|strip-cjk-wrap-pad\|tab-icon-placement\|auto-hide-tab-bar\|auto-secure-input\|confirm-close-tab\|open-with-command\|shell-integration\|show-auto-approve\|ui-text-secondary\|working-directory\|zoxide-local-path\|cursor-animation\|editor-line-wrap\|enquiry-response\|folder-open-with\|font-antialiased\|font-family-bold\|history-up-arrow\|minimum-contrast\|new-tab-position\|omit-otty-prefix\|scroll-to-bottom\|scrollback-limit\|scrollback-lines\|session-log-mode\|ui-border-subtle\|ui-panel-surface\|ui-text-tertiary\|window-height-px\|clipboard-write\|default-profile\|editor-tab-size\|mouse-reporting\|sidebar-visible\|ssh-integration\|ui-panel-border\|ui-text-primary\|widen-ambiguous\|window-width-px\|clipboard-read\|copy-on-select\|ctrl-shortcuts\|cursor-opacity\|file-open-with\|font-ligatures\|kitty-keyboard\|link-open-with\|login-greeting\|text-underline\|title-from-osc\|ui-font-family\|vt-kam-allowed\|window-opacity\|window-profile\|zoxide-enabled\|agent-command\|ctrl-c-action\|faint-opacity\|font-blending\|link-previews\|open-with-app\|sidebar-width\|split-profile\|window-layout\|cursor-color\|cursor-style\|details-view\|flow-control\|font-thicken\|hint-pattern\|link-schemes\|title-report\|ui-font-size\|cursor-text\|font-family\|font-smooth\|tab-profile\|text-italic\|window-cols\|window-rows\|window-size\|background\|bold-color\|editor-vim\|foreground\|text-blink\|theme-dark\|font-size\|ligatures\|on-launch\|text-bold\|ui-accent\|ui-active\|language\|tab-rule\|ui-hover\|command\|keybind\|palette\|profile\|shell\|theme\|bidi\|term\|env\)\ze\s*=/

hi def link ottyComment  Comment
hi def link ottyTodo     Todo
hi def link ottyBoolean  Boolean
hi def link ottyNumber   Number
hi def link ottyColor    Constant
hi def link ottyString   String
hi def link ottyEscape   SpecialChar
hi def link ottyEnum     Constant
hi def link ottyAssign   Operator
hi def link ottyKey      Identifier
hi def link ottyKnownKey Keyword

let b:current_syntax = 'otty'
