This repository has been archived by the owner on Dec 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bashrc.maclin
92 lines (79 loc) · 3.82 KB
/
bashrc.maclin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 foldmethod=marker filetype=bash
# ----------------------------------------------------------------------------
# Author: Mubarak Alrashidi (DeaDSouL)
# Package: dsBash
# Info: Setting up your bash environment
# License: GNU/GPL v3
# URL: https://gitlab.com/DeaDSouL/dsBash
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# History configuration (.bash_history) #{{{
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
# HISTCONTROL is a colon-separated list of values controlling how
# commands are saved in the
# ignorespace = don’t save lines which begin with a <space> character
# ignoredups = don’t save lines matching the previous history entry
# ignoreboth = use both ‘ignorespace’ and ‘ignoredups’
# erasedups = eliminate duplicates across the whole history
export HISTCONTROL=ignoreboth
# Ignore Specific Commands
# HISTIGNORE is a colon-separated list of patterns used to decide
# which command lines should be saved in the history file.
# ex:
# export HISTIGNORE="ls:ps:history"
# export HISTIGNORE="s*"
# Use one command per line
# Store multi-line commands in one history entry:
shopt -s cmdhist
# Change the History File Name
# if you want to use something else than '.bash_history'
#export HISTFILE=~/.custom_file
# For setting history length see HISTSIZE and HISTFILESIZE in bash(1)
export HISTSIZE=9999999
export HISTFILESIZE=9999999
# Add date & time
export HISTTIMEFORMAT="%h %d %H:%M:%S "
# Enable history appending instead of overwriting. #139609
shopt -s histappend
#}}}
# Change Prompt (PS1 & PS2) #{{{
#export PS1="\h:\W \u\$"
#export PS2=">"
#export PS1="________________________________________________________________________________\n| \w @ \h (\u) \n| => "
#export PS2="| => "
#export PS1="________________________________________________________________________________\n| \[\033[01;37m\]\$? \$(if [[ \$? == 0 ]]; then echo \"\[\033[01;32m\]\342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi) $(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]\h'; else echo '\[\033[01;32m\]\u@\h'; fi)\[\033[01;34m\] \w \$\[\033[00m\] \n| => "
#export PS2="| => "
export PS1="\[\033[01;37m\]\$? \$(if [[ \$? == 0 ]]; then echo \"\[\033[01;32m\]\342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi) $(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]\u@\h'; else echo '\[\033[01;32m\]\u@\h'; fi)\[\033[01;34m\] \w \$\[\033[00m\] "
export PS2="| => "
#}}}
# Set Default Editor (change 'vim' to the editor of your choice) #{{{
export EDITOR=/usr/bin/vim
export VISUAL=/usr/bin/vim
#}}}
# Set default blocksize for ls, df, du #{{{
# from this: http://hints.macworld.com/comment.php?mode=view&cid=24491
export BLOCKSIZE=1k
#}}}
# Setting colors to PAGER (manual pages) #{{{
# Less Colors for Man Pages
# Source: https://wiki.archlinux.org/index.php/man_page#Using_less_.28Recommended.29
# export LESS_TERMCAP_mb=$'\e[01;31m' # begin blinking
# export LESS_TERMCAP_md=$'\e[01;38;5;74m' # begin bold
# export LESS_TERMCAP_me=$'\e[0m' # end mode
# export LESS_TERMCAP_se=$'\e[0m' # end standout-mode
# export LESS_TERMCAP_so=$'\e[38;5;246m' # begin standout-mode - info box
# export LESS_TERMCAP_ue=$'\e[0m' # end underline
# export LESS_TERMCAP_us=$'\e[04;38;5;146m' # begin underline
man() {
env LESS_TERMCAP_mb=$'\E[01;31m' \
LESS_TERMCAP_md=$'\E[01;38;5;74m' \
LESS_TERMCAP_me=$'\E[0m' \
LESS_TERMCAP_se=$'\E[0m' \
LESS_TERMCAP_so=$'\E[38;5;246m' \
LESS_TERMCAP_ue=$'\E[0m' \
LESS_TERMCAP_us=$'\E[04;38;5;146m' \
man "$@"
}
#}}}
# ----------------------------------------------------------------------------