This is how I setup my terminal. It currently supports bash and zsh on Linux and Cygwin.
All you need is bash, git, and python 2 or 3 (for the installation script). I assume you have a decent .bashrc that colorizes your command line which you wish to extend without modifying too much.
Install on bash with:
$ cd ~
$ git clone https://github.com/vguarnaccia/.terminalrc.git
$ python ~/.terminalrc/installer.py --install bashrc
$ source ~/.bashrc
Uninstall bash config with:
$ python ~/.terminalrc/installer.py --remove bashrc
And then delete .terminalrc/
For zsh, follow the instructions above but replace bashrc with zshrc.
If you need any local configurations, you can add them to ~/.terminalrc/local
. This way they are read when using bash or zsh.
I've tested it on Ubuntu, Arch and Cygwin. It should also work on Mac, where it installs the script on .bash_profile
instead of .bashrc
.
- Each time you open a new bash terminal, a quick description of a random
- command will print. There's room for improvement on that feature but it's a good way to learn about more obscure commands.
- Smart Autocomplete: case-insensitive autocomplete for directories and git autocomplete.
- Colorized prompt, manpages and commands.
extract
command which will try to decompress various archive types.
l
: Horizontally list content (ls -CF
).ll
: Vertically list content (ls -AhlF
).cdl
: Change directory and list contents.mkcd
: Make directory and enter it.
- Replace
ls
with exa. See the example local file for aliases. - Instead of using
ls
andcd
everywhere when trying to understand a directory, use thetree
command orexa
. - When moving to a new directory, use autojump instead of
cd
. - Silver Searcher can be used in place of most
find
,xargs
,grep
combos. locate
is superior tofind
if the file you are looking for is a least a day old.- If you like to use
less
instead of cat, as I do, consider install first lesspipe.sh, then pygmentize. This will enable source code highlighting and archive inspecting.
Because git commands are too long to type fully. If you are doing any complicated git operations, it is worth using a GUI. I prefer GitKracken at the moment. It's currently freemium.
gs
:git status
ga
:git add
gd
:git diff
gdc
:git diff --cached
, surprisingly helpful.grm
:git rm
grc
:git rm --cached
gc
:git commit
gl
: likegit log
but much prettier.gpl
:git pull
gpu
:git push
gbr
:git branch -vv
-- verbose branchinggcache
: extend credentials timeout to 1 hour (forgpu
/gpl
). Useful for when you don't has ssh setup.