Commit ae7f735b3ccbee00f8f3a30bfc2b50d8e20710cc
1 parent
7e0b5c1e87
Exists in
master
and in
2 other branches
.bashrc: export ZCFG=$HOME/.config/zsh-config
Showing 1 changed file with 3 additions and 0 deletions Inline Diff
templates/bashrc.sh
1 | #@IgnoreInspection AddShebang | 1 | #@IgnoreInspection AddShebang |
2 | |||
3 | export ZCFG=$HOME/.config/zsh-config | ||
4 | |||
2 | # If not running interactively, don't do anything | 5 | # If not running interactively, don't do anything |
3 | case $- in | 6 | case $- in |
4 | *i*) ;; | 7 | *i*) ;; |
5 | *) return;; | 8 | *) return;; |
6 | esac | 9 | esac |
7 | 10 | ||
8 | ######################## | 11 | ######################## |
9 | # ******************** # | 12 | # ******************** # |
10 | # * * # | 13 | # * * # |
11 | # * COMPLETION * # | 14 | # * COMPLETION * # |
12 | # * * # | 15 | # * * # |
13 | # ******************** # | 16 | # ******************** # |
14 | ######################## | 17 | ######################## |
15 | 18 | ||
16 | # enable bash completion in interactive shells | 19 | # enable bash completion in interactive shells |
17 | if [ -f /etc/bash_completion ]; then | 20 | if [ -f /etc/bash_completion ]; then |
18 | . /etc/bash_completion | 21 | . /etc/bash_completion |
19 | fi | 22 | fi |
20 | 23 | ||
21 | # if the command-not-found package is installed, use it | 24 | # if the command-not-found package is installed, use it |
22 | if [ -x /usr/lib/command-not-found ]; then | 25 | if [ -x /usr/lib/command-not-found ]; then |
23 | function command_not_found_handle { | 26 | function command_not_found_handle { |
24 | # check because c-n-f could've been removed in the meantime | 27 | # check because c-n-f could've been removed in the meantime |
25 | if [ -x /usr/lib/command-not-found ]; then | 28 | if [ -x /usr/lib/command-not-found ]; then |
26 | /usr/bin/python /usr/lib/command-not-found -- $1 | 29 | /usr/bin/python /usr/lib/command-not-found -- $1 |
27 | return $? | 30 | return $? |
28 | else | 31 | else |
29 | return 127 | 32 | return 127 |
30 | fi | 33 | fi |
31 | } | 34 | } |
32 | fi | 35 | fi |
33 | 36 | ||
34 | ######################## | 37 | ######################## |
35 | # ******************** # | 38 | # ******************** # |
36 | # * * # | 39 | # * * # |
37 | # * HISTORY * # | 40 | # * HISTORY * # |
38 | # * * # | 41 | # * * # |
39 | # ******************** # | 42 | # ******************** # |
40 | ######################## | 43 | ######################## |
41 | 44 | ||
42 | # Eternal bash history. | 45 | # Eternal bash history. |
43 | # --------------------- | 46 | # --------------------- |
44 | export HISTFILESIZE= | 47 | export HISTFILESIZE= |
45 | export HISTSIZE= | 48 | export HISTSIZE= |
46 | export HISTTIMEFORMAT="[%F %T] " | 49 | export HISTTIMEFORMAT="[%F %T] " |
47 | # Change the file location | 50 | # Change the file location |
48 | export HISTFILE=~/.config/new_bash_history | 51 | export HISTFILE=~/.config/new_bash_history |
49 | # Force prompt to write history after every command | 52 | # Force prompt to write history after every command |
50 | PROMPT_COMMAND="history -a; $PROMPT_COMMAND" | 53 | PROMPT_COMMAND="history -a; $PROMPT_COMMAND" |
51 | 54 | ||
52 | 55 | ||
53 | # check the window size after each command | 56 | # check the window size after each command |
54 | shopt -s checkwinsize | 57 | shopt -s checkwinsize |
55 | 58 | ||
56 | # If set, the pattern "**" used in a pathname expansion context will | 59 | # If set, the pattern "**" used in a pathname expansion context will |
57 | # match all files and zero or more directories and subdirectories. | 60 | # match all files and zero or more directories and subdirectories. |
58 | #shopt -s globstar | 61 | #shopt -s globstar |
59 | 62 | ||
60 | # set variable identifying the chroot you work in (used in the prompt below) | 63 | # set variable identifying the chroot you work in (used in the prompt below) |
61 | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then | 64 | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then |
62 | debian_chroot=$(cat /etc/debian_chroot) | 65 | debian_chroot=$(cat /etc/debian_chroot) |
63 | fi | 66 | fi |
64 | 67 | ||
65 | # set a fancy prompt | 68 | # set a fancy prompt |
66 | case "$TERM" in | 69 | case "$TERM" in |
67 | xterm-color) color_prompt=yes;; | 70 | xterm-color) color_prompt=yes;; |
68 | esac | 71 | esac |
69 | 72 | ||
70 | # colored prompt | 73 | # colored prompt |
71 | force_color_prompt=yes | 74 | force_color_prompt=yes |
72 | 75 | ||
73 | if [ -n "$force_color_prompt" ]; then | 76 | if [ -n "$force_color_prompt" ]; then |
74 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | 77 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then |
75 | # We have color support; assume it's compliant with Ecma-48 | 78 | # We have color support; assume it's compliant with Ecma-48 |
76 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such | 79 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such |
77 | # a case would tend to support setf rather than setaf.) | 80 | # a case would tend to support setf rather than setaf.) |
78 | color_prompt=yes | 81 | color_prompt=yes |
79 | else | 82 | else |
80 | color_prompt= | 83 | color_prompt= |
81 | fi | 84 | fi |
82 | fi | 85 | fi |
83 | 86 | ||
84 | if [ "$color_prompt" = yes ]; then | 87 | if [ "$color_prompt" = yes ]; then |
85 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' | 88 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' |
86 | else | 89 | else |
87 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' | 90 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' |
88 | fi | 91 | fi |
89 | #unset color_prompt force_color_prompt | 92 | #unset color_prompt force_color_prompt |
90 | 93 | ||
91 | # enable color support of ls and also add handy aliases | 94 | # enable color support of ls and also add handy aliases |
92 | if [ -x /usr/bin/dircolors ]; then | 95 | if [ -x /usr/bin/dircolors ]; then |
93 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | 96 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" |
94 | alias ls='ls --color=auto' | 97 | alias ls='ls --color=auto' |
95 | alias dir='dir --color=auto' | 98 | alias dir='dir --color=auto' |
96 | alias vdir='vdir --color=auto' | 99 | alias vdir='vdir --color=auto' |
97 | 100 | ||
98 | alias grep='grep --color=auto' | 101 | alias grep='grep --color=auto' |
99 | alias fgrep='fgrep --color=auto' | 102 | alias fgrep='fgrep --color=auto' |
100 | alias egrep='egrep --color=auto' | 103 | alias egrep='egrep --color=auto' |
101 | fi | 104 | fi |
102 | 105 | ||
103 | # Environment | 106 | # Environment |
104 | if [ -f $ZCFG/dotfiles/environment.sh ]; then | 107 | if [ -f $ZCFG/dotfiles/environment.sh ]; then |
105 | . $ZCFG/dotfiles/environment.sh | 108 | . $ZCFG/dotfiles/environment.sh |
106 | fi | 109 | fi |
107 | 110 | ||
108 | 111 | ||
109 | # Alias definitions | 112 | # Alias definitions |
110 | if [ -f $ZCFG/templates/bash_aliases ]; then | 113 | if [ -f $ZCFG/templates/bash_aliases ]; then |
111 | . $ZCFG/templates/bash_aliases | 114 | . $ZCFG/templates/bash_aliases |
112 | fi | 115 | fi |
113 | 116 |