-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_exports
executable file
Β·107 lines (68 loc) Β· 3.38 KB
/
bash_exports
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
# Bash Variables.
# https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Stop the macOS Terminal from showing a warning
# message when Zsh is not the default shell.
#
# https://support.apple.com/en-us/HT208050
export BASH_SILENCE_DEPRECATION_WARNING=1
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Make `vim` the default editor.
export EDITOR="vim"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Ignore commands that start with spaces and duplicates.
export HISTCONTROL=ignoreboth
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Increase the maximum number of lines of history
# persisted in the history file (default value is 500).
export HISTFILESIZE=10000
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Don't add certain commands to the history file.
export HISTIGNORE="&:[bf]g:c:clear:history:exit:q:pwd:* --help"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Increase the maximum number of commands recorded
# in the command history (default value is 500).
export HISTSIZE=10000
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Prefer US English and use UTF-8 encoding.
export LANG="en_US"
export LC_ALL="en_US.UTF-8"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Use custom `less` colors for `man` pages.
export LESS_TERMCAP_md="$(tput bold 2> /dev/null; tput setaf 2 2> /dev/null)"
export LESS_TERMCAP_me="$(tput sgr0 2> /dev/null)"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Don't clear the screen after quitting a `man` page.
export MANPAGER="less -X"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Increase the maximum number of lines of history persisted
# in the `Node` REPL history file (default value is 1000).
#
# https://github.com/nodejs/node/blob/c948877688ff2b6a37f2c88724b656aae495c7b2/doc/api/repl.md#persistent-history
export NODE_REPL_HISTORY_SIZE=10000
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# If not set, make new shells get the history lines from all previous
# shells instead of the default "last window closed" history.
if ! printf "%s" "$PROMPT_COMMAND" | grep "history -a" &> /dev/null; then
export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
fi
# Remove `update_terminal_cwd` from the `PROMPT_COMMAND`
# environment variable if it doesn't exist in the current shell.
#
# On macOS `update_terminal_cwd` is added to the `PROMPT_COMMAND`
# environment variable however, `/etc/bashrc_Apple_Terminal`
# that contains the shell function definition is only executed
# for `Terminal.app`. Other terminals (e.g.: VS Code's terminal)
# will not have the shell function, hence, they will show the
#
# bash: update_terminal_cwd: command not found
#
# error everytime the prompt is displayed.
if printf "%s" "$PROMPT_COMMAND" | grep "update_terminal_cwd" &> /dev/null &&
! command -v update_terminal_cwd &> /dev/null; then
export PROMPT_COMMAND="$(printf "%s" "$PROMPT_COMMAND" | sed 's/\(.*\)update_terminal_cwd;*\(.*\)/\1\2/g')"
fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Make Python use UTF-8 encoding for output to stdin/stdout/stderr.
export PYTHONIOENCODING="UTF-8"