Skip to content

Commit

Permalink
Disable bash autocompletion, make it optional. Add relevant documenta…
Browse files Browse the repository at this point in the history
…tion. Closes wting#140.
  • Loading branch information
wting committed Nov 23, 2012
1 parent 96d9d83 commit 024d550
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ ADDITIONAL CONFIGURATION

export AUTOJUMP_KEEP_SYMLINKS=1

- Autocomplete Additional Commands (Bash only)

Autojump can be used to autocomplete other commands (e.g. cp or
vim). To use this feature, add the following environmental variable
in your \~/.bashrc:

export AUTOJUMP_AUTOCOMPLETE_CMDS='cp vim'

Changes require reloading autojump to take into effect.

ADVANCED USAGE
--------------

Expand Down
2 changes: 1 addition & 1 deletion bin/autojump
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import re
import shutil
from tempfile import NamedTemporaryFile

VERSION = 'release-v21.1.1'
VERSION = 'release-v21.1.2'
MAX_KEYWEIGHT = 1000
MAX_STORED_PATHS = 1000
COMPLETION_SEPARATOR = '__'
Expand Down
5 changes: 4 additions & 1 deletion bin/autojump.bash
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ _autojump_files()
EOF
fi
}
complete -o default -o bashdefault -F _autojump_files cp mv meld diff kdiff3 vim emacs

if [[ -n ${AUTOJUMP_AUTOCOMPLETE_CMDS} ]]; then
complete -o default -o bashdefault -F _autojump_files ${AUTOJUMP_AUTOCOMPLETE_CMDS}
fi

#determine the data directory according to the XDG Base Directory Specification
if [[ -n ${XDG_DATA_HOME} ]] && [[ ${XDG_DATA_HOME} =~ ${USER} ]]; then
Expand Down
17 changes: 17 additions & 0 deletions docs/autojump.1
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,23 @@ export\ AUTOJUMP_KEEP_SYMLINKS=1
\f[]
.fi
.RE
.IP \[bu] 2
Autocomplete Additional Commands (Bash only)
.RS 2
.PP
Autojump can be used to autocomplete other commands (e.g.
cp or vim).
To use this feature, add the following environmental variable in your
~/.bashrc:
.IP
.nf
\f[C]
export\ AUTOJUMP_AUTOCOMPLETE_CMDS=\[aq]cp\ vim\[aq]
\f[]
.fi
.PP
Changes require reloading autojump to take into effect.
.RE
.SS ADVANCED USAGE
.IP \[bu] 2
Using Multiple Arguments
Expand Down
9 changes: 9 additions & 0 deletions docs/body.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ Options must be passed to 'autojump' and not the 'j' wrapper function.

export AUTOJUMP_KEEP_SYMLINKS=1

- Autocomplete Additional Commands (Bash only)

Autojump can be used to autocomplete other commands (e.g. cp or vim). To use
this feature, add the following environmental variable in your ~/.bashrc:

export AUTOJUMP_AUTOCOMPLETE_CMDS='cp vim'

Changes require reloading autojump to take into effect.

## ADVANCED USAGE

- Using Multiple Arguments
Expand Down

0 comments on commit 024d550

Please sign in to comment.