leximaとambicmdをcmdlineで併用する
設定はこう
code:vim
function! s:expand_command(key) abort
let key2char = { "\<Space>": ' ', "\<CR>": "\r" }
let key2lexima = { "\<Space>": '<Space>', "\<CR>": '<CR>' }
let lexima = lexima#expand(key2leximaa:key, ':') if lexima !=# key2chara:key if a:key ==# "\<CR>"
call histadd(':', getcmdline())
endif
return lexima
endif
let ambicmd = ambicmd#expand(a:key)
if ambicmd !=# key2chara:key if a:key ==# "\<CR>"
call histadd(':', getcmdline())
endif
redraw
return ambicmd
endif
return a:key
endfunction
cnoremap <expr> <Space> <SID>expand_command("\<Space>")
cnoremap <expr> <CR> <SID>expand_command("\<CR>")