From 24e9b86562c5454919d6c6148efc45bd9c54e3b9 Mon Sep 17 00:00:00 2001 From: Nicholas Ochiel Date: Sun, 15 Oct 2017 05:22:38 +0300 Subject: [PATCH] ref vim options.txt --- rc/extra/modeline.kak | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rc/extra/modeline.kak b/rc/extra/modeline.kak index 68b31acc..83af7d75 100644 --- a/rc/extra/modeline.kak +++ b/rc/extra/modeline.kak @@ -90,10 +90,13 @@ def -hidden modeline-parse-impl %{ # Add the following function to a hook on BufOpenFile to automatically parse modelines # Select the first and last `modelines` lines in the buffer, only keep modelines +# ref. options.txt (in vim `:help options`) : 2 forms of modelines: +# [text]{white}{vi:|vim:|ex:}[white]{options} +# [text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text] def modeline-parse -docstring "Read and interpret vi-format modelines at the beginning/end of the buffer" %{ try %{ eval -draft %{ exec \%s\`|.\' %opt{modelines}k %opt{modelines}X \ - s^[^\s]+?\s(vim?|kak(oune)?):\s?[^\n]+ + s^[^\s]*?\s(vim?|kak(oune)?):\s?[^\n]+ eval -draft -itersel modeline-parse-impl } } }