bash tweaks
This commit is contained in:
parent
d0bd25c235
commit
e5b61becc6
@ -76,7 +76,7 @@ if tput setaf 1 &> /dev/null; then
|
|||||||
gray=$(tput setaf 242);
|
gray=$(tput setaf 242);
|
||||||
blue=$(tput setaf 109);
|
blue=$(tput setaf 109);
|
||||||
green=$(tput setaf 143);
|
green=$(tput setaf 143);
|
||||||
cyan=$(tput setaf 110);
|
cyan=$(tput setaf 43);
|
||||||
orange=$(tput setaf 173);
|
orange=$(tput setaf 173);
|
||||||
purple=$(tput setaf 125);
|
purple=$(tput setaf 125);
|
||||||
red=$(tput setaf 167);
|
red=$(tput setaf 167);
|
||||||
|
71
.bashrc
71
.bashrc
@ -10,33 +10,64 @@ esac
|
|||||||
# SHELL OPTIONS
|
# SHELL OPTIONS
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
# don't put duplicate lines or lines starting with space in the history.
|
|
||||||
# See bash(1) for more options
|
|
||||||
HISTCONTROL=ignoreboth
|
|
||||||
|
|
||||||
# Append to the Bash history file, rather than overwriting it
|
# Append to the Bash history file, rather than overwriting it
|
||||||
shopt -s histappend
|
shopt -s histappend
|
||||||
|
|
||||||
|
# Save multi-line commands as one command
|
||||||
|
shopt -s cmdhist
|
||||||
|
|
||||||
|
# Avoid duplicate entries
|
||||||
|
HISTCONTROL="erasedups:ignoreboth"
|
||||||
|
|
||||||
|
# Don't record some commands
|
||||||
|
export HISTIGNORE="&:[ ]*:exit:ls:bg:fg:history:clear"
|
||||||
|
|
||||||
# fuck that you have new mail shit
|
# fuck that you have new mail shit
|
||||||
unset MAILCHECK
|
unset MAILCHECK
|
||||||
|
|
||||||
# Case-insensitive globbing (used in pathname expansion)
|
# Case-insensitive globbing (used in pathname expansion)
|
||||||
shopt -s nocaseglob
|
shopt -s nocaseglob
|
||||||
|
|
||||||
# Autocorrect typos in path names when using `cd`
|
# Turn on recursive globbing (enables ** to recurse all directories)
|
||||||
shopt -s cdspell
|
shopt -s globstar 2> /dev/null
|
||||||
|
|
||||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
# Prepend cd to directory names automatically
|
||||||
HISTSIZE=1000
|
shopt -s autocd 2> /dev/null
|
||||||
HISTFILESIZE=2000
|
|
||||||
|
|
||||||
# check the window size after each command and, if necessary,
|
# Correct spelling errors during tab-completion
|
||||||
# update the values of LINES and COLUMNS.
|
shopt -s dirspell 2> /dev/null
|
||||||
|
|
||||||
|
# Correct spelling errors in arguments supplied to cd
|
||||||
|
shopt -s cdspell 2> /dev/null
|
||||||
|
|
||||||
|
# Update window size after every command
|
||||||
shopt -s checkwinsize
|
shopt -s checkwinsize
|
||||||
|
|
||||||
# If set, the pattern "**" used in a pathname expansion context will
|
# Automatically trim long paths in the prompt (requires Bash 4.x)
|
||||||
# match all files and zero or more directories and subdirectories.
|
PROMPT_DIRTRIM=4
|
||||||
#shopt -s globstar
|
|
||||||
|
# Perform file completion in a case insensitive fashion
|
||||||
|
bind "set completion-ignore-case on"
|
||||||
|
|
||||||
|
# Treat hyphens and underscores as equivalent
|
||||||
|
bind "set completion-map-case on"
|
||||||
|
|
||||||
|
# Display matches for ambiguous patterns at first tab press
|
||||||
|
bind "set show-all-if-ambiguous on"
|
||||||
|
|
||||||
|
# Immediately add a trailing slash when autocompleting symlinks to directories
|
||||||
|
bind "set mark-symlinked-directories on"
|
||||||
|
|
||||||
|
# enable programmable completion features (you don't need to enable
|
||||||
|
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||||
|
# sources /etc/bash.bashrc).
|
||||||
|
if ! shopt -oq posix; then
|
||||||
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||||
|
. /usr/share/bash-completion/bash_completion
|
||||||
|
elif [ -f /etc/bash_completion ]; then
|
||||||
|
. /etc/bash_completion
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# LSCOLORS
|
# LSCOLORS
|
||||||
export CLICOLOR=1
|
export CLICOLOR=1
|
||||||
@ -53,15 +84,3 @@ if [ -x /usr/bin/dircolors ]; then
|
|||||||
alias fgrep='fgrep --color=auto'
|
alias fgrep='fgrep --color=auto'
|
||||||
alias egrep='egrep --color=auto'
|
alias egrep='egrep --color=auto'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# enable programmable completion features (you don't need to enable
|
|
||||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
|
||||||
# sources /etc/bash.bashrc).
|
|
||||||
if ! shopt -oq posix; then
|
|
||||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
|
||||||
. /usr/share/bash-completion/bash_completion
|
|
||||||
elif [ -f /etc/bash_completion ]; then
|
|
||||||
. /etc/bash_completion
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
Loading…
Reference in New Issue
Block a user