Files
ghostty-rs/crates/ghostty-build-data/src/chunks_vim.rs
T
ddidderr b192fdb046 feat(dist): generate completions, editor syntax, man pages, translations
Ports Ghostty's build-data helpers (main_build_data.zig, src/extra/*,
build/mdgen) as the ghostty-build-data binary: bash/zsh/fish
completions, Vim syntax/ftdetect/ftplugin/compiler, Sublime syntax (also
used by bat), terminfo source and ghostty(1)/ghostty(5) markdown. With
the version set to the installed 1.3.1-arch2, all generated files are
byte-identical to the installed Ghostty's.

- `just docs` renders man pages and HTML with pandoc.
- po/: Ghostty's 29 translation catalogs; `just locales` compiles them
  into the com.mitchellh.ghostty gettext domain.
- `just install PREFIX FLATPAK SYSTEM_PACKAGE` installs everything incl.
  terminfo text/termcap outputs and mirrors GhosttyResources.zig install
  modes (Flatpak D-Bus template without systemd; lib/systemd/user for
  system packages).
- Build metadata (version, tip/stable channel, commit, build mode) is
  derived at build time like build_config.zig; GTK/libadwaita
  compile-time versions come from pkg-config instead of constants.

Test Plan:
- cargo run -p ghostty-build-data -- +bash | diff - \
  /usr/share/bash-completion/completions/ghostty (same for zsh/fish/vim)
- just install /tmp/prefix
2026-10-12 04:39:14 +02:00

75 lines
1.8 KiB
Rust

// Generated from the Zig multiline strings of extra/vim.zig. Do not edit.
pub const C0: &str = r####"" Vim filetype detect file
" Language: Ghostty config file
" Maintainer: Ghostty <https://github.com/ghostty-org/ghostty>
"
" THIS FILE IS AUTO-GENERATED
au BufRead,BufNewFile */ghostty/config,*/*.ghostty/config,*/ghostty/themes/*,*.ghostty setf ghostty
"####;
pub const C1: &str = r####"" Vim filetype plugin file
" Language: Ghostty config file
" Maintainer: Ghostty <https://github.com/ghostty-org/ghostty>
"
" THIS FILE IS AUTO-GENERATED
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal commentstring=#\ %s
setlocal iskeyword+=-
" Use syntax keywords for completion
setlocal omnifunc=syntaxcomplete#Complete
let b:undo_ftplugin = 'setl cms< isk< ofu<'
if !exists('current_compiler')
compiler ghostty
let b:undo_ftplugin .= " makeprg< errorformat<"
endif
"####;
pub const C2: &str = r####"" Vim compiler file
" Language: Ghostty config file
" Maintainer: Ghostty <https://github.com/ghostty-org/ghostty>
"
" THIS FILE IS AUTO-GENERATED
if exists("current_compiler")
finish
endif
let current_compiler = "ghostty"
CompilerSet makeprg=ghostty\ +validate-config\ --config-file=%:S
CompilerSet errorformat=%f:%l:%m,%m
"####;
pub const C3: &str = r####"" Vim syntax file
" Language: Ghostty config file
" Maintainer: Ghostty <https://github.com/ghostty-org/ghostty>
"
" THIS FILE IS AUTO-GENERATED
if exists('b:current_syntax')
finish
endif
let b:current_syntax = 'ghostty'
let s:cpo_save = &cpo
set cpo&vim
syn iskeyword @,48-57,-
syn keyword ghosttyConfigKeyword"####;
pub const C4: &str = r####"
syn match ghosttyConfigComment /^\s*#.*/ contains=@Spell
hi def link ghosttyConfigComment Comment
hi def link ghosttyConfigKeyword Keyword
let &cpo = s:cpo_save
unlet s:cpo_save
"####;