kakoune

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

eruby.kak (775B)


      1 # eRuby
      2 # http://www2a.biglobe.ne.jp/~seki/ruby/erb.html
      3 
      4 hook global BufCreate '.*\.erb' %{
      5   set-option buffer filetype eruby
      6 }
      7 
      8 hook global WinSetOption filetype=eruby %{
      9   require-module eruby
     10   add-highlighter window/eruby ref eruby
     11   hook -group eruby-indent window InsertChar '\n' html-indent-on-new-line
     12   hook -always -once window WinSetOption filetype=.* %{
     13     remove-highlighter window/eruby
     14     remove-hooks window eruby-.+
     15   }
     16 }
     17 
     18 provide-module eruby %{
     19   require-module ruby
     20   require-module html
     21   add-highlighter shared/eruby regions
     22   add-highlighter shared/eruby/html default-region ref html
     23   add-highlighter shared/eruby/simple-comment-tag region '<%#' '%>' fill comment
     24   add-highlighter shared/eruby/simple-execution-tag region (?<=<%) '%>' ref ruby
     25 }