-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
117 lines (90 loc) · 3.34 KB
/
.bashrc
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
108
109
110
111
112
113
114
115
116
117
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
[[ -f ~/.welcome_screen ]] && . ~/.welcome_screen
alias ls='ls --color=auto'
alias ll='ls -lav --ignore=..' # show long listing of all except ".."
alias l='ls -lav --ignore=.?*' # show long listing but no hidden dotfiles except "."
[[ "$(whoami)" = "root" ]] && return
[[ -z "$FUNCNEST" ]] && export FUNCNEST=100 # limits recursive functions, see 'man bash'
# Avoid duplicates in history
export HISTCONTROL=ignoredups:erasedups # Ignore duplicate lines and erase older duplicates
# Set the maximum number of lines in the history file
export HISTFILESIZE=100000 # Big enough for your needs (adjustable)
# Set the number of commands to save in the history list (in-memory)
export HISTSIZE=100000 # Adjust as per your needs
# Append to the history file, don't overwrite it
shopt -s histappend
# Share history across all open shells
export PROMPT_COMMAND="history -a; history -n; $PROMPT_COMMAND"
# Ignore specific commands (like `ls`, `exit`, etc.) in history
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
# Save multi-line commands as one command
shopt -s cmdhist
## Use the up and down arrow keys for finding a command in history
## (you can write some initial letters of the command first).
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
################################################################################
## Some generally useful functions.
##
_open_files_for_editing() {
# Open any given document file(s) for editing (or just viewing).
# Note1:
# - Do not use for executable files!
# Note2:
# - Uses 'mime' bindings, so you may need to use
# e.g. a file manager to make proper file bindings.
if [ -x /usr/bin/exo-open ] ; then
echo "exo-open $@" >&2
setsid exo-open "$@" >& /dev/null
return
fi
if [ -x /usr/bin/xdg-open ] ; then
for file in "$@" ; do
echo "xdg-open $file" >&2
setsid xdg-open "$file" >& /dev/null
done
return
fi
echo "$FUNCNAME: package 'xdg-utils' or 'exo' is required." >&2
}
#------------------------------------------------------------
# exports and customizations
################################################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
if [ -r /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -r /etc/bash_completion ]; then
. /etc/bash_completion
fi
# User specific environment
if ! [[ "$PATH" = *"$HOME/.local/bin:$HOME/bin:"* ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
. ~/.bash.d/cht.sh
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
source <(kitty + complete setup bash)
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
eval "$(register-python-argcomplete pipx)"
export GLFW_IM_MODULE=ibus
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export KITTY_CONFIG_DIRECTORY=~/.config/kitty
export PS1='\[\e[1;33m\]\W \[\e[1;36m\]\$ \[\e[0m\]'
#-------
# golang
############
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:$GOPATH/bin
alias config='/usr/bin/git --git-dir=/home/mdriscoll/.cfg/ --work-tree=/home/mdriscoll'