Changes between Initial Version and Version 1 of howto/bash-completion


Ignore:
Timestamp:
Mar 6, 2008, 2:33:17 AM (16 years ago)
Author:
raimue (Rainer Müller)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/bash-completion

    v1 v1  
     1[wiki:howto <- Back to the HOWTO section]
     2
     3= How to use bash-completion =
     4
     5 * Audience: All users
     6 * Requires: -
     7
     8== Introduction ==
     9
     10bash-completion is a set of bash scripts which enables customized completion for specific commands.
     11
     12This is not just for files and directories, but also e.g. for the commands of `port`. So you type `port <Tab>` and get a list of all possible commands.
     13
     14== Installation ==
     15
     16=== Step 1: '''Install bash-completion''' ===
     17
     18{{{
     19$ sudo port install bash-completion
     20}}}
     21
     22=== Step 2: '''Enable bash-completion in your `.bash_profile` ===
     23
     24You have to add bash-completion to your `.profile` or `.bash_profile`.
     25
     26First, locate the file you are using. If there is a `.bash_profile` edit this file, if there is only `.profile` you want to edit this.
     27
     28Open the file in any editor and add the following lines:
     29{{{
     30# bash-completion
     31if [ -f /opt/local/etc/bash_completion ]; then
     32    . /opt/local/etc/bash_completion
     33fi
     34}}}
     35Important: Reopen your Terminal afterwards.
     36
     37And you are done. From now on, you are able to use customized bash-completion.
     38
     39== Optional Parts ==
     40
     41=== '''Install +bash_completion variant automatically with all ports''' ===
     42
     43Open the file `/opt/local/etc/macports/variants.conf` in any editor and add a new line:
     44{{{
     45+bash_completion
     46}}}
     47
     48From now on, MacPorts will automatically select the bash_completion variant for all ports if available.
     49
     50[wiki:howto <- Back to the HOWTO section]