1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-24 20:13:00 +03:00

Modularize r file support

This commit is contained in:
Maxime Coste 2019-11-26 21:32:19 +11:00
parent 2209b5d415
commit 8691ee8d4a

View File

@ -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