" Configuration for lightline " Do not duplicate modes set noshowmode " Main configuration let g:lightline = { \ 'colorscheme': 'one', \ 'active': { \ 'left': [['mode', 'paste'], ['file']], \ 'right': [['lineinfo'], ['percent'], ['filetype']], \ }, \ 'component_function': { \ 'mode': 'LightlineMode', \ 'file': 'LightlineFile' \ }, \} " Mode indicator function! LightlineMode() let label = GetPluginLabel() return label == '' ? lightline#mode() : label endfunction " File name + others function! LightlineFile() " Hide if using a plugin's window if GetPluginLabel() != '' return '' endif let filename = expand('%:t') " Hide if file name is empty (new file) if filename == '' return '' endif let modified = &modified ? ' [+]' : '' let is_rdonly = ((&readonly || !&modifiable) \ && &filetype !=# 'help' \ && &filetype !=# 'man') let readonly = is_rdonly ? ' [RO]' : '' return filename . modified . readonly endfunction " Helper function to get plugin label (shown in mode component) function! GetPluginLabel() if &filetype ==# 'vim-plug' return 'Plugins' endif return '' endfunction