You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.. function:: apply_commands() -> None
Apply inline commands from projectionist templates.
This allows you to include a normal mode command within a template by ending
a line with the string ``]|[`` and followed by a normal mode command. For
example, ``]|[yyp`` would duplicate the current line.
.. function:: apply_options() -> None
Apply |vim| options from projectionist configuration.
This allows you to configure |vim| from within ``vim-projectionist``’s
:file:`.projections.json`. We take advantage of :repo:`securemodelines
<JNRowe/securemodelines>`’s allow list to block options that *may* be
dangerous.
function plugins#vim_projectionist#apply_options() abort
let l:data = projectionist#query('vim_options')
for [l:_, l:options] in reverse(l:data)
for l:s in l:options
let l:optname = split(l:s, '[\^\-+]\?=')[0]
if index(g:secure_modelines_allowed_items, l:optname) != -1
execute 'setlocal ' .. l:s
else
echohl WarningMsg
echo printf('Not setting “%s” from projection', l:optname)
echohl None
endif
endfor
endfor
endfunction