mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-06 12:14:24 +08:00
cursormode: allow custom mode names
A new variable named cursormode_mode_func is used to store the function returning the current mode. This allows more customization in the mapping. The default value is the built-in mode function so there is no change in behavior. Add some documentation. Signed-off-by: Thomas Faivre <thomas.faivre@6wind.com>
This commit is contained in:
@@ -40,8 +40,12 @@ endfunction
|
||||
let s:iTerm_escape_template = '\033]Pl%s\033\\'
|
||||
let s:xterm_escape_template = '\033]12;%s\007'
|
||||
|
||||
function! s:get_mode()
|
||||
return call(get(g:, 'cursormode_mode_func', 'mode'), [])
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#cursormode#set(...)
|
||||
let mode = mode()
|
||||
let mode = s:get_mode()
|
||||
if mode !=# s:last_mode
|
||||
let s:last_mode = mode
|
||||
call s:set_cursor_color_for(mode)
|
||||
|
||||
Reference in New Issue
Block a user