Skip to content

Instantly share code, notes, and snippets.

@pocari
Last active January 2, 2020 17:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pocari/84c78efa38b5c2fc1f659d1aac3face8 to your computer and use it in GitHub Desktop.
Save pocari/84c78efa38b5c2fc1f659d1aac3face8 to your computer and use it in GitHub Desktop.
Using lightline.vim prompt in Denite.nvim prompt
if exists('g:loaded_lightline')
" lightline.vim側で描画するのでdeniteでstatuslineを描画しないようにする
call denite#custom#option('default', 'statusline', v:false)
endif
" lightlineでmodeを描画する時ようのfunction
function! MyMode()
if &ft == 'denite'
" deniteは自分でinsertモード normalモードを管理しているので
" lightlineのハイライト関数をdeniteのモードに合わせた値(-- NORMAL -- ならn)
" にしてハイライト関数を呼ぶ
let mode_str = substitute(denite#get_status_mode(), "-\\| ", "", "g")
call lightline#link(tolower(mode_str[0]))
return mode_str
else
return winwidth('.') > 60 ? lightline#mode() : ''
endif
endfunction
let g:lightline = {
" 〜略〜
\ 'component_function': {
\ 'mode': 'MyMode',
\ },
" 〜略〜
\ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment