Skip to content

Tab completion

Takuto ASAKURA edited this page Jun 7, 2018 · 5 revisions

If you want to use simple tab completion like:

$ texdoc bx[Tab]
bxbase  bxcjkjatype   bxdvidriver  bxenclose   bxjaprnind  bxnewfont   bxpapersize  bxtexlogo
bxcalc  bxdpx-beamer  bxeepic      bxjalipsum  bxjscls     bxorigcapt  bxpdfver

try to write the following line to your .bashrc or .zshrc:

  • for bash
complete -W "$(awk '/^name[^.]*$/ {print $2}' $(kpsewhich -var-value TEXMFROOT)/tlpkg/texlive.tlpdb)" texdoc
  • for zsh
compctl -k "(($(awk '/^name[^.]*$/ {print $2}' $(kpsewhich -var-value TEXMFROOT)/tlpkg/texlive.tlpdb)))" texdoc

Sources:

Clone this wiki locally