Skip to content

Instantly share code, notes, and snippets.

@timomitchel
Last active September 9, 2019 03:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save timomitchel/0981eeba8d69d435f94ab44f161f9bf4 to your computer and use it in GitHub Desktop.
Save timomitchel/0981eeba8d69d435f94ab44f161f9bf4 to your computer and use it in GitHub Desktop.
For Students in Mod-0 to Add tab completion

Enabling Tab Completion in Terminal

Run: cd ~ to go home quickly from any directory. Make sure you are in your home directory.

Run atom .bash_profile to begin editing the .bash_profile file.

Copy and Paste this: [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion into the top of the file.

Make sure: [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion is on its own line.

Save the file - is autosave enabled for you in Atom? It should be!

You should now be able to begin typing a command and use the tab key to complete it IF the directory, command, or file exits.

For example if you type git stat and then hit tab it should autocomplete to status.

You can also type cd with a space and double tap the tab button quickly to easily see the contents of the directory you are in and where you can go. This works for cd ../ or any other cd command while you're navigating the file system. This is similar to what you see when you type ls, but it's showing you the options you have for the cd command. So, it will only show the sub-directories and not the files.

If there are multiple options for you when you hit tab then the tab_complete will show you those options. For example if you type: git sta and hit tab your computer will make a low-frequency noise. But if you hittab again it will show you all of your options which should be: stage, stash, and status. This should save you some time when running commands in your terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment