I arranged that when I press <C-L>
it toggles yank mode, in which the usual status line turns into a line displaying the yank regs.
I use Airline.
function! GetLine(timer)
if !exists('g:reg_tog')
return
endif
if g:reg_tog==0
return
endif
if (getreg('0')==getreg('*'))
let regs=['+','1','2','3','x','z','4','5']
else
let regs=['*','0','1','2','x','z','4','5']
endif
let tot=0
let wid=winwidth(0)
let s=""
let tl=0
let avg=0
let countmore=0
let lenlessthan=0
let lenmore=0
for it in regs
let t=printf('%s',getreg(it))
let t=substitute(t,"\<NL>","^M","g")
let t=substitute(t,"\t"," ","g")
let l= len(t)
if l<(wid-25)/(len(regs)+1)
let lenlessthan+=l
else
let lenmore+=l
let countmore+=1
endif
endfor
let neededavg = ((wid-25-(3*countmore)) - lenlessthan + 0.01) / (countmore+ 0.01)
for it in regs
let t=printf('%s',getreg(it))
let t=substitute(t,"\<NL>","","g")
let t=substitute(t,"\t"," ","g")
let l= len(t)
if l>=(wid-25)/(len(regs)+1)
let ll=min([len(t),float2nr(floor(neededavg))])
else
let ll=len(t)
endif
if ll>0
if (len(s)+ll<wid-25)
if ll<l
let s=s . printf('%s',it) . ': ' . t[0:ll] .'..| '
else
let s=s . printf('%s',it) . ': ' . t[0:ll] .' | '
endif
endif
endif
endfor
let g:line=s
endfunction
function! RegsToggle()
if !exists('g:reg_tog')
let g:reg_tog=0
endif
let g:reg_tog=!(g:reg_tog)
if g:reg_tog
let g:airline_section_a_temp= g:airline_section_a
let g:airline_section_a=""
let g:airline_section_x_temp= g:airline_section_x
let g:airline_section_x=""
let g:airline_section_y_temp= g:airline_section_y
let g:airline_section_y=""
let g:airline_section_z_temp= g:airline_section_z
let g:airline_section_z=""
let g:airline_section_c= "%{g:line}"
"*= %-0.40{printf('%s',getreg('*'))} 0= %-0.40{printf('%s',getreg(0))} 1= %-0.40{printf('%s',getreg(1))} 2= %-0.40{printf('%s',getreg(2))} 3= %-0.40{printf('%s',getreg(3))} x= %-0.40{printf('%s',getreg('x'))}"
let g:airline_section_error_temp= g:airline_section_error
let g:airline_section_error=""
let g:airline_section_warning_temp= g:airline_section_warning
let g:airline_section_warning=""
else
let g:airline_section_error= g:airline_section_error_temp
let g:airline_section_warning = g:airline_section_warning_temp
let g:airline_section_a= g:airline_section_a_temp
let g:airline_section_x= g:airline_section_x_temp
let g:airline_section_y= g:airline_section_y_temp
let g:airline_section_z= g:airline_section_z_temp
let g:airline_section_c= '%<%{tabpagenr()} %<%{getcwd()} | %f%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#'
endif
:AirlineRefresh
"call airline#extensions#tabline#buflist#invalidate()
":redraw!
endfunction
let g:autoreg=timer_start(2000,'GetLine',{'repeat':-1})
and added
nnoremap <C-L> :call RegsToggle()<CR>
Notice that added timer.
Notice that my c part is different in the usual display since it contains the current working directory.
so you can add
let g:airline_section_c= '%<%{getcwd()} | %f%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#'