Bash Completion

Some of these steps were taken from here:

I used MacPorts to install bash-completion:

sudo port install bash-completion

Save the following

to /opt/local/etc/bash_completion.d/

Add the following to .bash_profile or .profile as appropriate.

# for bash-completion
if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion
source /opt/local/etc/bash_completion.d/
source /opt/local/etc/bash_completion.d/

Now restart your Terminal.

Bash “Esc .” not pasting last typed command

I recently ran into an issue where a system I was accessing would paste the last command when typing “Esc .”  I know this is a Bash shortcut so I went to investigating

Turns out in /etc/bashrc I found set -o vi which tells the shell to use a vi-style command line editing interface.

Here is the output with no options given for my system:

[dlopez@dlodev ~]$ set -o
allexport       off
braceexpand     on
emacs           on
errexit         off
errtrace       off
functrace       off
hashall         on
histexpand     on
history         on
ignoreeof       off
interactive-comments on
keyword         off
monitor         on
noclobber       off
noexec         off
noglob         off
nolog           off
notify         off
nounset         off
onecmd         off
physical       off
pipefail       off
posix           off
privileged     off
verbose         off
vi             off
xtrace         off

The output of the command above produced vi on for the system not functioning as I expected.