Skip to content

Tab completion

Takuto ASAKURA edited this page Jul 25, 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

A complete function written by a Texdoc author is available from gist.

Simpler version is here:

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

Sources:

Clone this wiki locally