Vim syntaxfile: Difference between revisions
From wikinotes
Line 16: | Line 16: | ||
" Define marker colours (CLI/GUI) | " Define marker colours (CLI/GUI) | ||
let s:todo_colour | let s:todo_colour = 'magenta' | ||
let s:gui_todo_colour | let s:gui_todo_colour = '#F57900' | ||
" Define Regexes | " Define Regexes | ||
let s:todo_regex | let s:todo_regex = '\(^\s*\)\@<=\*\([a-zA-Z]\)\@!' | ||
Revision as of 22:52, 2 October 2022
This tutorial looks really good
http://jeromyanglim.blogspot.com/2011/04/case-study-in-customising-syntax.html
TODO:
pick apart my vimscripts and fill out this article.
Example
if exists("b:current_syntax") finish endif " Define marker colours (CLI/GUI) let s:todo_colour = 'magenta' let s:gui_todo_colour = '#F57900' " Define Regexes let s:todo_regex = '\(^\s*\)\@<=\*\([a-zA-Z]\)\@!' " Define syntax for Regexes execute "syntax match todolistsimple_todo '". s:todo_regex ."'" " Apply highlighting execute ' highlight todolistsimple_todo ctermfg='. s:todo_colour .' guifg='. s:gui_todo_colour .' ctermbg=none cterm=bold gui=bold' " Register filetype (ex. ft=todolist_simple) let b:current_syntax = "todolist_simple"