Vim syntaxfile: Difference between revisions

From wikinotes
(Created page with "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. }}")
 
No edit summary
Line 6: Line 6:
pick apart my vimscripts and fill out this article.
pick apart my vimscripts and fill out this article.
}}
}}
= Example =
<blockquote>
<syntaxhighlight lang="vim">
" exit if syntax already loaded
if exists("b:current_syntax")
    finish
endif
let s:todo_regex          = '\(^\s*\)\@<=\*\([a-zA-Z]\)\@!'
execute "syntax match todosimple_todo '". s:todo_regex ."'"
let b:current_syntax = "todosimple"
</syntaxhighlight>
</blockquote><!-- Example -->

Revision as of 18:31, 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

" exit if syntax already loaded
if exists("b:current_syntax")
    finish
endif

let s:todo_regex          = '\(^\s*\)\@<=\*\([a-zA-Z]\)\@!'

execute "syntax match todosimple_todo '". s:todo_regex ."'"

let b:current_syntax = "todosimple"