Function to toggle laststatus

2 Points

sbicknel sbicknel

10 years ago

Function to cycle state of laststatus setting (multi-window, never, always)

" toggle laststatus
function! ToggleLaststatus()
    if &laststatus == 2
	set laststatus=1
	echo "status line: multi-window"
    elseif &laststatus == 1
	set laststatus=0
	echo "status line: never"
    elseif &laststatus == 0
	set laststatus=2
	echo "status line: always"
    endif
    return
endfunction
nnoremap <f3> :call ToggleLaststatus()<cr>
vnoremap <f3> :call ToggleLaststatus()<cr>
inoremap <f3> <c-o>:call ToggleLaststatus()<cr>