def list-registers -docstring 'populate the *registers* buffer with the content of registers' %{ edit! -scratch *registers* evaluate-commands %sh{ # empty scratch buffer echo 'exec \%d' # paste the content of each register on a separate line for reg in {'%','.','#','"','@','/','^','|',{a..z},{0..9}}; do echo "exec 'i${reg}\"${reg}pGjo'" done # hide empty registers (lines with less than 4 chars) echo 'exec \%.{4,}d' # make sure all registers are easily visible echo 'exec gg' } } # beware, it wipes the content of reg x def info-registers -docstring 'populate an info box with the content of registers' %{ list-registers exec -save-regs \%| '%|cut-c-30%"xyga' info -title registers -- %reg{x} set-register x '' }