From 9cee46ea4739e6fd8dd8f8258d0f72e327164cac Mon Sep 17 00:00:00 2001 From: navewindre Date: Wed, 11 Sep 2024 18:25:28 +0200 Subject: a --- vimrc | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 1909822..ca03404 100644 --- a/vimrc +++ b/vimrc @@ -264,7 +264,7 @@ let g:lightline = { \ [ 'readonly', 'filename', 'modified' ] ], \ 'right': [ [ 'lineinfo' ], \ [ 'percent' ], - \ [ 'fileformat', 'fileencoding', 'filetype', 'wpm' ] ] + \ [ 'fmtcustom', 'enccustom', 'ftcustom', 'wpm' ] ] \ }, \ 'tabline': { \ 'left': [ ['tabs'] ], @@ -272,19 +272,45 @@ let g:lightline = { \ }, \ 'component_function': { \ 'tabline_tabs': 'TablineTabs', - \ 'wpm': 'WPM' + \ 'wpm': 'WPM', + \ 'ftcustom': 'CustomFT', + \ 'enccustom': 'CustomEncode', + \ 'fmtcustom': 'CustomFileFormat' \ } \ } +function CustomFileFormat() + if &filetype != 'Avante' && &filetype != 'AvanteInput' + return &fileformat + endif + return '' +endfunction + +function CustomEncode() + if &filetype != 'Avante' && &filetype != 'AvanteInput' + return &fileencoding + endif + return '' +endfunction + +function CustomFT() + if &filetype != 'Avante' && &filetype != 'AvanteInput' + return &filetype + endif + return '' +endfunction + function WPM() - return (luaeval("require('wpm').historic_graph()") . ' ' . luaeval("require('wpm').wpm()")) . 'wpm' + if &filetype != 'Avante' && &filetype != 'AvanteInput' + return (luaeval("require('wpm').historic_graph()") . ' ' . luaeval("require('wpm').wpm()")) . 'wpm' + endif + return '' endfunction function! TablineTabs() return lightline#tabline() endfunction - let g:tabby_keybinding_accept = '' autocmd Filetype json let g:indentLine_setConceal = 0 @@ -312,7 +338,6 @@ function! GoToTab(tab_number) execute 'tabn ' . a:tab_number endfunction - function! InputTabNumber() let l:tab_number = nr2char(getchar()) if l:tab_number =~ '\d' -- cgit v1.2.3