kakoune

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

conf.kak (838B)


      1 hook global BufCreate .+\.(repo|cfg|properties|desktop) %{
      2     set-option buffer filetype conf
      3 }
      4 
      5 hook global WinCreate .+\.ini %{
      6     try %{
      7         execute-keys /^\h*#<ret>
      8         set-option buffer filetype conf
      9     }
     10 }
     11 
     12 hook global WinSetOption filetype=conf %{
     13     require-module conf
     14 }
     15 
     16 hook -group conf-highlight global WinSetOption filetype=conf %{
     17     add-highlighter window/conf ref conf
     18     hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/conf }
     19 }
     20 
     21 provide-module conf %{
     22 
     23 add-highlighter shared/conf regions
     24 add-highlighter shared/conf/code default-region group
     25 add-highlighter shared/conf/comment region '(^|\h)\K#' $ fill comment
     26 
     27 add-highlighter shared/conf/code/ regex "(?S)^\h*(\[.+?\])\h*$" 1:title
     28 add-highlighter shared/conf/code/ regex "^\h*([^\[][^=\n]*)=(\N*)" 1:variable 2:value
     29 
     30 }