You are not logged in.

#1 2009-05-03 02:13:52

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

bash: How can I get Ubuntu-style autocompletion?

A little background. When I used Ubuntu (up until maybe a week ago), almost all the commands had special autocompletion "rules" as I guess you might call them. For instance, I could type "sudo apt-get install libsdl", hit tab twice, and get a list of all the available packages related to libsdl.

How can I configure this in Arch?

Offline

#2 2009-05-03 02:24:11

s3kt0r
Member
Registered: 2009-01-20
Posts: 208

Re: bash: How can I get Ubuntu-style autocompletion?

Hi, check this link out: http://wiki.archlinux.org/index.php/Bas … Completion

Relevant part of .bashrc:

# enable auto completion on sudo commands
complete -cf sudo
# enable bash completion in interactive shells
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

Last edited by s3kt0r (2009-05-03 02:32:06)


box1: Arch (linux-3.17-rc5)
box2: Gentoo (linux-3.17-rc5)
wm: subtle

Offline

#3 2009-05-03 02:53:06

peart
Member
From: Kanuckistan
Registered: 2003-07-28
Posts: 510

Re: bash: How can I get Ubuntu-style autocompletion?

The bash-completion package adds a file in /etc/profile.d which gets sourced at login time.  There is no need to add anything to ~/.bashrc.

Offline

#4 2009-05-03 03:28:12

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: bash: How can I get Ubuntu-style autocompletion?

Hey thanks, it worked!

Offline

#5 2009-05-04 21:27:22

s3kt0r
Member
Registered: 2009-01-20
Posts: 208

Re: bash: How can I get Ubuntu-style autocompletion?

peart wrote:

The bash-completion package adds a file in /etc/profile.d which gets sourced at login time.  There is no need to add anything to ~/.bashrc.

Cool m8, didn't know that. hmm

Thanks cool


box1: Arch (linux-3.17-rc5)
box2: Gentoo (linux-3.17-rc5)
wm: subtle

Offline

#6 2009-05-23 22:31:03

zatricky
Member
From: Stockholm
Registered: 2008-09-03
Posts: 55
Website

Re: bash: How can I get Ubuntu-style autocompletion?

peart wrote:

The bash-completion package adds a file in /etc/profile.d which gets sourced at login time.  There is no need to add anything to ~/.bashrc.

Care to adjust the wiki? Right now it specifically states that the .bashrc needs to be modified.


pacman russian roulette: yes | pacman -Rcs $(pacman -Q | LANG=C sort -R | head -n $((RANDOM % 10)))
(yes, I know its broken)

Offline

#7 2009-05-24 03:46:52

peart
Member
From: Kanuckistan
Registered: 2003-07-28
Posts: 510

Re: bash: How can I get Ubuntu-style autocompletion?

It's done, zatricky.

Offline

Board footer

Powered by FluxBB