Okosítsuk fel egy kicsit a bash-completiont (gyk. automata kiegészítés)!

Hozzuk létre a ~/.inputrc fájlt az alábbi tartalommal:


set show-all-if-ambiguous on

set show-all-if-unmodified on

set menu-complete-display-prefix on

"/t": menu-complete

"\e[Z": menu-complete-backward

"\e[A": history-search-backward

"\e[B": history-search-forward

"\eOA": history-search-backward

"\eOB": history-search-forward


Futassuk az exec bash parancsot, majd zárjuk be a terminált és nyissunk egy újat.

Mostantól a bash a zsh, fish, stb. módjára viselkedik, demó az ls paranccsal (az adott pozícióban nyomkodjuk a TAB billentyűt)!


lsTAB:


[berus@mga .vim]$ ls

ls lsb-release lsd lsirq lsmem lsns lspcidrake lsusb.py

lsattr lsb_release lsinitrd lslocks lsmod lsof lss3

lsblk lscpu lsipc lslogins lsnetdrake lspci lsusb


ls TAB:


[berus@mga .vim]$ ls

ftdetect/ spell/ syntax/


ls -TAB:

[berus@mga .vim]$ ls -

--all --full-time --quoting-style=

--almost-all --group-directories-first --recursive

--author --help --reverse

--block-size= --hide= --show-control-chars

--classify --hide-control-chars --si

--color --human-readable --size

--color= --hyperlink --sort

--context --ignore= --sort=

--dereference --ignore-backups --tabsize=

--dereference-command-line --indicator-style= --time

--dereference-command-line-symlink-to-dir --inode --time=

--directory --kibibytes --time-style=

--dired --literal --version

--escape --no-group --width=

--file-type --numeric-uid-gid

--format= --quote-name


Szuper, működik!




/linux/