NeoRoot.lua
NeoRoot.lua copied to clipboard
Feat. Request: Mode indicator.
As title. An eye-catching emoji will be great, and it should be configured via setup.
If you add this in neo-root.lua
function M.getMode()
return CUR_MODE
end
you can fetch the state with require'neo-root'.getMode() and use this in your vim setup as you use
eg. for lightline
let s:NeoRootGetMode = luaeval("require'neo-root'.getMode")
function NeoRootMode()
if s:NeoRootGetMode() == 1
return "🐒"
else
return "🌳"
endif
endfunction
" status line configuration
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'readonly', 'filename', 'modified', 'neoroot' ] ],
\ 'right': [
\ [ 'percent' ],
\ [ 'fileformat', 'fileencoding', 'filetype' ] ] },
\ 'component_function': {
\ 'neoroot': 'NeoRootMode'
\ },
\ }
Adding this function or a similar should be easier and more flexible than any status line shenanigans.