diff options
| author | jdhao <jdhao@hotmail.com> | 2020-11-08 20:02:30 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2020-11-08 20:02:30 +0800 |
| commit | 99cedb6c94d42fe3055256822aab4c526a4e59b2 (patch) | |
| tree | f6cacb09b4000dada7ffa2080c456c040556a962 /core | |
| parent | badaed84ca4f85a39c03f66122eb096e92af6183 (diff) | |
Do no show file time for not listed buffers.
Diffstat (limited to 'core')
| -rw-r--r-- | core/options.vim | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/core/options.vim b/core/options.vim index 7722d0f..1e918d6 100644 --- a/core/options.vim +++ b/core/options.vim @@ -104,11 +104,20 @@ set autowrite " lastmod time is drawn from https://stackoverflow.com/q/8426736/6064933 set title set titlestring= -if g:is_linux - set titlestring+=%(%{hostname()}\ \ %) -endif -set titlestring+=%(%{expand('%:p:~')}\ \ %) -set titlestring+=%{strftime('%Y-%m-%d\ %H:%M',getftime(expand('%')))} +set titlestring=%{Get_titlestr()} + +function! Get_titlestr() abort + let l:title_str = '' + if g:is_linux + let l:title_str = hostname() . ' ' + endif + let l:title_str = l:title_str . expand('%:p:~') . ' ' + if &buflisted + let l:title_str = l:title_str . strftime('%Y-%m-%d %H:%M',getftime(expand('%'))) + endif + + return l:title_str +endfunction " Persistent undo even after you close a file and re-open it set undofile |
