autocomplete - Bash alias autocompletion that considers only *.foo files -
whenever want start editing latex sources launching, e.g., command vim pdeoptaff.tex
, find bash (tab)-autocompletion still tedious because folder typically contains bunch of files same name different endings:
$ ls pdaeoptaff.aux pdaeoptaff.out pdaeoptaff.tex.latexmain pdaeoptaff.bbl pdaeoptaff.pdf pdaeoptaff.toc pdaeoptaff.blg pdaeoptaff.synctex.gz pdaeoptaff.log pdaeoptaff.tex
since always want open the ~.tex
file, love have filter makes autocomplete expand ~.tex
files.
in addition, have alias defined: alias g='gvim --remote-silent'
. filter, in particular, should work alias.
try:
complete -f -x '!*.tex' g
then, can type:
g <tab>
and completions. note: doesn't complete directories. else may have better solution using compgen
.
there's helpful autocomplete guide on the linux documentation project too.
Comments
Post a Comment