Difference between revisions of "Package:Bash completion"

From Funtoo
Jump to navigation Jump to search
m (Corrected formatting and added details about global use of bash-completion)
 
(4 intermediate revisions by 4 users not shown)
Line 2: Line 2:
|Summary=Bash tab-completion
|Summary=Bash tab-completion
|CatPkg=app-shells/bash-completion
|CatPkg=app-shells/bash-completion
|Maintainer=
|Homepage=http://bash-completion.alioth.debian.org/
|Homepage=http://bash-completion.alioth.debian.org/
}}
}}
Line 8: Line 7:


<console>
<console>
# emerge -av bash-completion
###i## emerge -av bash-completion
</console>
</console>


Line 26: Line 25:


{{file|name=~/.bashrc|desc=enable bash completion|body=
{{file|name=~/.bashrc|desc=enable bash completion|body=
source /etc/profile.d/bash-completion.sh
source /etc/bash/bashrc.d/bash_completion.sh
}}
}}
Now you can enable completion for various programs with eselect.  
Now you can enable completion for various programs with eselect.  
<console>
<console>
$ eselect bashcomp list
$##i## eselect bashcomp list
$ eselect bashcomp enable gentoo
$##i## eselect bashcomp enable gentoo
</console>
</console>


To enable bash completion for all packages, you can use the following.
To enable bash completion for all packages, you can use the following.
<console>
<console>
# eselect bashcomp enable --global {0..476}
###i## eselect bashcomp enable --global {0..476}
</console>
</console>
Note that for tab completion to work with sftp, openssh must be compiled with libedit support.  You can add this to your package.use file:
{{file|name=/etc/portage/package.use|desc=enable tab completion for sftp|body=
net-misc/openssh libedit
}}


To disable bash completion for all packages, you can use the following.
To disable bash completion for all packages, you can use the following.
<console>
<console>
# eselect bashcomp disable --global {0..476}
###i## eselect bashcomp disable --global {0..476}
</console>
</console>
{{EbuildFooter}}
{{EbuildFooter}}

Latest revision as of 14:18, April 22, 2016

Bash completion

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Install

root # emerge -av bash-completion

If you want to enable bash completion for any package that supports it, you can set the global USE flag bash-completion:

   /etc/portage/make.conf - Set bash-completion globally
USE="$USE bash-completion"

And then emerge -avN @world to enable bash-completion on packages you formerly built without that support.

However, you probably won't need bash completion on every package you install. So for a lighter system and faster completion, prefer enabling it on a per package basis.

Enable bash completion

You need to add the following to your .bashrc to load bash-completion.

   ~/.bashrc - enable bash completion
source  /etc/bash/bashrc.d/bash_completion.sh

Now you can enable completion for various programs with eselect.

user $ eselect bashcomp list
user $ eselect bashcomp enable gentoo

To enable bash completion for all packages, you can use the following.

root # eselect bashcomp enable --global {0..476}

Note that for tab completion to work with sftp, openssh must be compiled with libedit support. You can add this to your package.use file:

   /etc/portage/package.use - enable tab completion for sftp
net-misc/openssh libedit

To disable bash completion for all packages, you can use the following.

root # eselect bashcomp disable --global {0..476}