Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ~/.bashrc
- # Set the default editor
- export EDITOR='vim'
- # Enable color support for the terminal
- force_color_prompt=yes
- # Git integration: Check for the current git branch and show it in the prompt
- parse_git_branch() {
- git branch 2>/dev/null | grep '\*' | sed 's/\* \(.*\)/ (\1)/'
- }
- # Set up the prompt
- if [ -n "$force_color_prompt" ]; then
- PS1='\[\e[0;32m\]\u@\h' # Username and hostname in green
- PS1+='\[\e[0;34m\] \w' # Current directory in blue
- PS1+='\[\e[0;31m\]$(parse_git_branch)' # Git branch in red
- PS1+='\[\e[0m\] \$ ' # Reset color and add dollar prompt
- else
- PS1='\u@\h \w $(parse_git_branch) \$ '
- fi
- # Enable Git prompt if we're in a Git repo
- source /usr/share/git/completion/git-prompt.sh
- # Add aliases
- alias ll='ls -la'
- alias gs='git status'
- alias gc='git commit'
- alias ga='git add'
- alias gp='git push'
- alias gl='git pull'
- # Enable colored output for `ls` and `grep`
- alias ls='ls --color=auto'
- alias grep='grep --color=auto'
- # Custom PATH (example, add your directories here)
- export PATH="$HOME/bin:$PATH"
- # Use 256-color terminal if supported
- if tput setaf 1 &>/dev/null; then
- export TERM=xterm-256color
- fi
- # If we have the `dircolors` program, load it
- if [ -f "$HOME/.dir_colors" ]; then
- eval "$(dircolors -b $HOME/.dir_colors)"
- fi
- # Use the 'history' command to show timestamps
- HISTTIMEFORMAT="%F %T "
- # Enable command auto-completion
- if [ -f /etc/bash_completion ]; then
- . /etc/bash_completion
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement