Background (added 10/2019): when I originally saw this I considered two possible interpretations of your (OP's) request. First, I thought you might be under the impression that syntax highlighting works in a similar fashion as Bash text coloring, i.e. escape codes or equivalent are inserted in plain text and they dictate coloring and formatting for displayed text (escape codes are hidden in display contexts). This is not how Vim works. No directives or meta text exist. It's a (regex) pattern driven system.
My alternate interpretation was that you want to deliberately type text that will be displayed with a particular highlighting (such as SpecialComment). That's what the original answer covers...
It depends. Highlighting is applied based on the current set of syntax highlighting rules. The current rules are dictated (usually) by the type of file we're editing. You can't open a random file and just know how to enter text "with keyboard" that will get highlighted with SpecialComment coloring. You must be familiar with the rules for the current file type.
For example, if I open a file with extension .java
I know one way to see SpecialComment highlighting is to enter the first line of text in a javadoc comment:
/**
* This text is highlighted as a SpecialComment
*
* This text is not.
*/
public void foo() {
...
The rules are stored in files under $VIMRUNTIME/syntax
. For the example above it would be java.vim
where you'll find:
hi def link javaCommentTitle SpecialComment
syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags,javaDocSeeTag
vim -Nu NONE
. DoesSpecialComment
appear? Now try open vim as usualvim
. DoesSpecialComment
appear?SpecialComment
is a syntax group name, are you asking what should be highlighted with this group? I feel lijke your question is a duplicate of this one but I'm not sure what you are looking for.whit -> with
, etc.) made it harder to read. Hope that helps!