Skip to content

A simple colored bash prompt with exit status recognition and git branch detection.

License

Notifications You must be signed in to change notification settings

koljah-de/simple-bash-prompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-bash-prompt

A simple colored bash prompt with exit status recognition and git branch detection.

Screenshot

Installing

  1. Run git clone git@github.com:koljah-de/simple-bash-prompt.git or git clone https://github.com/koljah-de/simple-bash-prompt.git.
  2. Copy .bash_prompt to your home directory.
  3. Add source ~/.bash_prompt to your ~/.bashrc.

Or go to your git directory and run ./install.sh

Finished.

Better Tab Completion

For a better tab completion you can add these lines to your ~/.inputrc:

# Faster tab completion
set show-all-if-ambiguous on
set completion-ignore-case on

# TAB through the suggestions
TAB:menu-complete

# Move between words with Ctrl+Left and Ctrl+Right
"\e[1;5D":backward-word
"\e[1;5C":forward-word

# Enable the history search mode
"\e[A":history-search-backward
"\e[B":history-search-forward
"\e[C":forward-char
"\e[D":backward-char

# Enable colors
set colored-stats On
set visible-stats On
set mark-symlinked-directories On
set colored-completion-prefix On
set menu-complete-display-prefix On

# Disables the control echo after pressing Ctrl+C
set echo-control-characters off

Here you can find additional info and a better explanation of the commands:
https://wiki.archlinux.org/index.php/Readline

Some more useful options for the ~/.bashrc

# Stop logging of repeated identical commands or lines starting with space
export HISTCONTROL=ignoreboth

# Append to the history file, don't overwrite it
shopt -s histappend

# Check the window size after each command and, if necessary, update the values of LINES and COLUMNS
shopt -s checkwinsize

Better bash behavior

  • For a better bash behavior if a command not found and to get suggested packages install: command-not-found
  • For a better bash completion install the package: bash-completion