Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
Raghu R edited this pageDec 8, 2022 ·27 revisions

TOC

Highlighters

Syntax highlighting is supported through highlighters. You may add your own Syntax definitions in therc directory. There is a syntax highlighting section in thehighlighters.asciidoc file.

There is a good overview of highlighters in Kakounehere.

Examples

column, line

# same ideas apply to `line`addhl column 4 red           # all chars in column 4 will be have a red coloraddhl column 5 red,blue+b    # all chars in column 5 will be red on blue and in boldaddhl column 6 PrimaryCursor # all chars in column 6 will be the same face than `PrimaryCursor` (see below)

https://github.com/insipx/kak-crosshairs provides automatic highlighting of current Line/Column

ranges

declare-option range-specs foo                          # declare an option called foo, of type range-specsadd-highlighter window/ ranges foo                      # use this option as the parameterset-option buffer foo %val{timestamp} '2:3.1,3.10|blue' # update the option to trigger changes

ui.kak plugin

Theui.kak plugin provides commands and a user mode to quickly toggle various highlighters and related hooks.

Search highlighting

First add asearch face. Here, it will emphasis the searched word in bold and italic without changing the foreground or background colors:

set-faceglobal search +bi

Then enable search highlighting. Dynregex is plugged on the content of the search register/:

add-highlighterglobal/search dynregex'%reg{/}'0:search

Highlight a column

If you want a visual hint about code that exceeds a given width, try thecolumnhighlighter:

add-highlighterglobal/ column'%opt{autowrap_column}'default,red

...highlights the column named by theautowrap_column option with a red background, and will automatically move as the option is updated. Theautowrap_column option is used bythe autowrap script what column to wrap to, but even if you don't use autowrap's functionality, it's a good place to record the buffer's wrapping column so other wrapping and formatting hooks can find it.

FIXME/TODO/XXX keywords

The following highlighter will display words "FIXME"/"TODO"/"XXX"/"NOTE" in bold and reversed.

add-highlighterglobal/regex \b(TODO|FIXME|XXX|NOTE)\b0:default+rb

Faces

Faces can be taken from thecolorscheme files, which is what is usually done, or directly from the the list ofdefault faces:

NameForegroundBackgroundAttribute
DefaultDefaultDefault
PrimarySelectionWhiteBlue
SecondarySelectionBlackBlue
PrimaryCursorBlackWhite
SecondaryCursorBlackWhite
PrimaryCursorEolBlackCyan
SecondaryCursorEolBlackCyan
LineNumbersDefaultDefault
LineNumberCursorDefaultDefaultReverse
LineNumbersWrappedDefaultDefaultItalic
MenuForegroundWhiteBlue
MenuBackgroundBlueWhite
MenuInfoCyanDefault
InformationBlackYellow
ErrorBlackRed
StatusLineCyanDefault
StatusLineModeYellowDefault
StatusLineInfoBlueDefault
StatusLineValueGreenDefault
StatusCursorBlackCyan
PromptYellowDefault
MatchingCharDefaultDefaultBold
BufferPaddingBlueDefault
WhitespaceDefaultDefaultFinalFg
WrapMarkerBlueDefault
Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp