command-line-interface-pages / syntax

Syntax definition and highlighting for different editors
4 stars 0 forks source link

Add Vim syntax highlighting #1

Open EmilyGraceSeville7cf opened 1 year ago

EmilyGraceSeville7cf commented 1 year ago

This question should be resolved to be able to do this.

EmilyGraceSeville7cf commented 1 year ago

The following code doesn't work as expected:

" Vim syntax file
" Language: Better TlDr
" Maintainer: Emily Grace Seville
" Latest Revision: 23 January 2023

if exists("b:current_syntax")
  finish
endif

let b:current_syntax = "btldr"

syntax match linePrefix '^[-#>]'
syntax match url 'https:[^ ]+'
syntax match option '--?[^ =]+=?'

syntax keyword placeholderType bool int float char string command file directory path any
syntax keyword streamType stdin stdout stderr

highlight def link linePrefix Type
highlight def link url Constant
highlight def link option Type

highlight def link placeholderType Type
highlight def link streamType Type

image

I don't know how to fix, I definitely need help with syntax highlighting for Vim.