From 8691ee8d4a297df0fc4c7f7ce647b3924ed09204 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 26 Nov 2019 21:32:19 +1100 Subject: [PATCH] Modularize r file support --- rc/filetype/r.kak | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rc/filetype/r.kak b/rc/filetype/r.kak index 80456f22e..ea8596f27 100644 --- a/rc/filetype/r.kak +++ b/rc/filetype/r.kak @@ -8,6 +8,8 @@ hook global BufCreate (.*/)?(\.Rprofile|.*\.[rR]) %{ set-option buffer filetype r } +provide-module r %§ + # Highlighters & Completion # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ @@ -124,15 +126,19 @@ define-command -hidden r-insert-on-newline %[ evaluate-commands -itersel -draft ] ] ] +§ + # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ hook -group r-highlight global WinSetOption filetype=r %{ + require-module r add-highlighter window/r ref r hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/r } } hook global WinSetOption filetype=r %~ + require-module r hook window ModeChange pop:insert:.* r-trim-indent hook window InsertChar \n r-insert-on-newline hook window InsertChar \n r-indent-on-newline