Last active
January 2, 2020 17:03
-
-
Save pocari/84c78efa38b5c2fc1f659d1aac3face8 to your computer and use it in GitHub Desktop.
Using lightline.vim prompt in Denite.nvim prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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