-
Notifications
You must be signed in to change notification settings - Fork 715
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'krobelus/ini-hash-comments'
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
hook global BufCreate .+\.(repo|cfg|properties|desktop) %{ | ||
set-option buffer filetype conf | ||
} | ||
|
||
hook global WinCreate .+\.ini %{ | ||
try %{ | ||
execute-keys /^\h*#<ret> | ||
set-option buffer filetype conf | ||
} | ||
} | ||
|
||
hook global WinSetOption filetype=conf %{ | ||
require-module conf | ||
} | ||
|
||
hook -group conf-highlight global WinSetOption filetype=conf %{ | ||
add-highlighter window/conf ref conf | ||
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/conf } | ||
} | ||
|
||
provide-module conf %{ | ||
|
||
add-highlighter shared/conf regions | ||
add-highlighter shared/conf/code default-region group | ||
add-highlighter shared/conf/comment region '(^|\h)\K#' $ fill comment | ||
|
||
add-highlighter shared/conf/code/ regex "(?S)^\h*(\[.+?\])\h*$" 1:title | ||
add-highlighter shared/conf/code/ regex "^\h*([^\[][^=\n]*)=([^\n]*)" 1:variable 2:value | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters