I know there is a short cut to make the fill column indicator visible. But I want it visible a most of the time anyway. Can I set an option or call a function to toggle it automatically at startup?
I have used :nmap [SPC]tf
to show what the key binding does. But I can't understand the result (quite new to vim):
n [SPC]tf * :<C-U>call call(function('<SNR>32_toggle_colorcolumn'), [])<CR>
I have done some more research as suggested by @filbranden. :scriptname 32
reveals the function:
function! s:toggle_colorcolumn() abort
if !s:ccflag
let &cc = g:spacevim_max_column
let s:ccflag = 1
else
set cc=
let s:ccflag = 0
endif
call SpaceVim#layers#core#statusline#toggle_mode('fill-column-indicator')
endfunction
This seems to toggle a script local boolean s:ccflag (not sure about the script local part) and then calls a function.
Setting the ccflag in my bootstrap function and calling the toggle_mode()
function did nothing.
if &cc ==# '80'
andlet s:ccflag = 1
, so maybeset cc=80
in your early initialization is enough to set it on and keep SpaceVim state consistent? It's odd that that doesn't necessarily matchg:spacevim_max_column
...