kakoune

Fork of kakoune, an acceptable text editor
git clone git://git.laack.co/kakoune.git
Log | Files | Refs

mercurial.kak (1082B)


      1 # https://www.mercurial-scm.org/
      2 # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
      3 
      4 # Detection
      5 # ‾‾‾‾‾‾‾‾‾
      6 
      7 hook global BufCreate .*hg-editor-.*\.txt$ %{
      8     set-option buffer filetype hg-commit
      9 }
     10 
     11 hook global WinSetOption filetype=hg-commit %{
     12     require-module hg-commit
     13 }
     14 
     15 hook -group hg-commit-highlight global WinSetOption filetype=hg-commit %{
     16     add-highlighter window/hg-commit ref hg-commit
     17     hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/hg-commit-highlight }
     18 }
     19 
     20 provide-module hg-commit %{
     21 
     22 # Faces
     23 # ‾‾‾‾‾
     24 
     25 set-face global MercurialCommitComment cyan
     26 
     27 # Highlighters
     28 # ‾‾‾‾‾‾‾‾‾‾‾‾
     29 
     30 add-highlighter shared/hg-commit regions
     31 add-highlighter shared/hg-commit/comments region ^HG:\  $ group
     32 add-highlighter shared/hg-commit/comments/ fill comment
     33 add-highlighter shared/hg-commit/comments/ regex \
     34 	"\b(?:(changed)|(removed)|(added)|(bookmark)|(branch)|(user:)) (\N*)$" \
     35 	      1:yellow  2:red     3:green 4:blue     5:magenta 6:white
     36 
     37 }