author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sun, 06 May 2018 15:11:56 +0300 | |
changeset 892 | 5bb386e5dbf6 |
parent 888 | ec96d18f51b0 |
child 894 | 338878a7ff51 |
permissions | -rw-r--r-- |
250
405b343c1214
Add remainder how debug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
242
diff
changeset
|
1 |
|
405b343c1214
Add remainder how debug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
242
diff
changeset
|
2 |
# set -x |
405b343c1214
Add remainder how debug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
242
diff
changeset
|
3 |
# set -u |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
4 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
5 |
# XXX |
265
acd29a6e6d8d
Use bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
264
diff
changeset
|
6 |
# [[ -f /etc/bashrc ]] && . /etc/bashrc |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
7 |
|
653
a5566b182446
Use .env file as common env var settings for Bash and Zsh.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
648
diff
changeset
|
8 |
if [[ -f ~/.env ]]; then |
a5566b182446
Use .env file as common env var settings for Bash and Zsh.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
648
diff
changeset
|
9 |
. ~/.env |
282 | 10 |
fi |
11 |
||
892
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
12 |
hr() { |
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
13 |
local ruler='' |
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
14 |
for (( i=${COLUMNS:-78}; i>0; i-=1 )) do |
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
15 |
ruler+='=' |
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
16 |
done |
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
17 |
echo $ruler |
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
18 |
} |
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
19 |
HR=`hr` |
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
20 |
|
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
21 |
PS1='\n'`hr`'\r$?|\u@\h \w \nbash# ' |
633
ef2436c18276
Print current dir at prompt. Remove broken code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
619
diff
changeset
|
22 |
PS2='> ' |
849
04cb764675f3
Do not try to set title inside Emacs term emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
848
diff
changeset
|
23 |
|
182
af9e9693646e
Set magenta bold font.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
181
diff
changeset
|
24 |
case "$TERM" in |
860
ddc40e485d91
Added support for ConEmu.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
849
diff
changeset
|
25 |
xterm*|eterm-color|screen|linux|cygwin) |
892
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
26 |
PS1=$'\n\e[34m\e[1m'`hr`$'\r$?|\e[31m\u\e[35m@\h\e[0m\e[36m \w \n\[\e[1m\e[31m\]bash#\[\e[0m\] ' |
828
235bf6715fc6
Use $'' syntax to get rid of \033 in flavor of \e.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
811
diff
changeset
|
27 |
PS2=$'\[\e[32m\]> \[\e[0m\]' |
182
af9e9693646e
Set magenta bold font.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
181
diff
changeset
|
28 |
;; |
af9e9693646e
Set magenta bold font.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
181
diff
changeset
|
29 |
esac |
892
5bb386e5dbf6
Set length of ruler line to terminal width. Made it more visible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
888
diff
changeset
|
30 |
unset hr |
849
04cb764675f3
Do not try to set title inside Emacs term emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
848
diff
changeset
|
31 |
# Set current directory in terminal emulator title. |
04cb764675f3
Do not try to set title inside Emacs term emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
848
diff
changeset
|
32 |
case "$TERM" in |
860
ddc40e485d91
Added support for ConEmu.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
849
diff
changeset
|
33 |
xterm*|screen|linux|cygwin) |
849
04cb764675f3
Do not try to set title inside Emacs term emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
848
diff
changeset
|
34 |
PS1=$'\e]0;bash \w\a'"$PS1" |
04cb764675f3
Do not try to set title inside Emacs term emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
848
diff
changeset
|
35 |
;; |
04cb764675f3
Do not try to set title inside Emacs term emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
848
diff
changeset
|
36 |
esac |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
37 |
|
304
c6ae628708d5
Enable dircolors. Check for 'dircolors' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
300
diff
changeset
|
38 |
if command -v dircolors >/dev/null 2>&1 && [[ -f ~/.dircolors ]]; then |
c6ae628708d5
Enable dircolors. Check for 'dircolors' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
300
diff
changeset
|
39 |
eval "`dircolors -b ~/.dircolors`" |
c6ae628708d5
Enable dircolors. Check for 'dircolors' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
300
diff
changeset
|
40 |
fi |
208
ba6619e43b22
Add '.dircolors' but don't enable it.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
193
diff
changeset
|
41 |
|
482
3860547a5594
Set HISTTIMEFORMAT to force Bash to store timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
481
diff
changeset
|
42 |
# Can be XXX /visible. I like bell. |
3860547a5594
Set HISTTIMEFORMAT to force Bash to store timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
481
diff
changeset
|
43 |
# set bell-style visible |
3860547a5594
Set HISTTIMEFORMAT to force Bash to store timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
481
diff
changeset
|
44 |
|
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
45 |
# Don't store duplicate adjacent items in the history. |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
46 |
# ignorespace do not save lines that start with space |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
47 |
# erasedups all previous lines matching the current line to be removed from |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
48 |
# the history list before that line is saved |
481 | 49 |
HISTCONTROL=ignorespace:erasedups |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
50 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
51 |
# Don't store noisy/dumb items. |
104
653e4ea98ff9
Exclude 'cd' command from history which comes from MC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
93
diff
changeset
|
52 |
# TIP: MC command start with space. |
107
43f69ef5ec58
Remove ? from patterns as I previously incorrectly understand its meaning.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
53 |
HISTIGNORE=\ |
294
91a01838d930
Remember 'cd ..' commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
290
diff
changeset
|
54 |
" cd *":\ |
107
43f69ef5ec58
Remove ? from patterns as I previously incorrectly understand its meaning.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
106
diff
changeset
|
55 |
"vlc *":ls:pwd |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
56 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
57 |
# To these options assigned default value, as they satisfy my needs I comment them. |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
58 |
# HISTFILE=~/.bash_history # where is command history stored |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
59 |
# HISTFILESIZE=500 # how many lines been in $HISTFILE |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
60 |
# HISTSIZE=500 # how many lines been stored in bash process |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
61 |
|
482
3860547a5594
Set HISTTIMEFORMAT to force Bash to store timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
481
diff
changeset
|
62 |
HISTTIMEFORMAT="%F %T " |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
63 |
|
171
47aa0a6acc75
Make Bash append rather than overwrite the history.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
168
diff
changeset
|
64 |
# Make Bash append rather than overwrite the history. |
47aa0a6acc75
Make Bash append rather than overwrite the history.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
168
diff
changeset
|
65 |
shopt -s histappend |
47aa0a6acc75
Make Bash append rather than overwrite the history.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
168
diff
changeset
|
66 |
|
193
2e4cebaae3cc
histreedit histverify
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
67 |
shopt -s histreedit |
2e4cebaae3cc
histreedit histverify
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
68 |
shopt -s histverify |
2e4cebaae3cc
histreedit histverify
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
182
diff
changeset
|
69 |
|
483
f02dbcb71260
Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
482
diff
changeset
|
70 |
# Technique to share command history across Bash secctions. |
f02dbcb71260
Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
482
diff
changeset
|
71 |
# Just run: |
f02dbcb71260
Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
482
diff
changeset
|
72 |
# history -n |
f02dbcb71260
Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
482
diff
changeset
|
73 |
# to reload history. |
f02dbcb71260
Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
482
diff
changeset
|
74 |
# This setting automatically update history file, but ignore HISTCONTROL=erasedups settings. |
f02dbcb71260
Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
482
diff
changeset
|
75 |
# PROMPT_COMMAND='history -a' |
f02dbcb71260
Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
482
diff
changeset
|
76 |
|
28
da6841fb89e9
Minor errors in the spelling of a directory component in a cd command will be corrected.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
77 |
# Minor errors in the spelling of a directory component in a cd command will |
da6841fb89e9
Minor errors in the spelling of a directory component in a cd command will be corrected.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
78 |
# be corrected. |
da6841fb89e9
Minor errors in the spelling of a directory component in a cd command will be corrected.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
79 |
shopt -s cdspell |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
80 |
|
43
6c53a61678d7
Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
42
diff
changeset
|
81 |
# Save all lines of a multiple-line command in the same history entry. |
6c53a61678d7
Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
42
diff
changeset
|
82 |
shopt -s cmdhist |
6c53a61678d7
Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
42
diff
changeset
|
83 |
|
6c53a61678d7
Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
42
diff
changeset
|
84 |
# Allows files beginning with a dot ('.') to be returned in the results of path-name expansion. |
6c53a61678d7
Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
42
diff
changeset
|
85 |
shopt -s dotglob |
6c53a61678d7
Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
42
diff
changeset
|
86 |
|
168
0371cfe5a8f5
ksh-88 egrep-style extended pattern matching .
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
157
diff
changeset
|
87 |
# ksh-88 egrep-style extended pattern matching. |
0371cfe5a8f5
ksh-88 egrep-style extended pattern matching .
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
157
diff
changeset
|
88 |
shopt -s extglob |
0371cfe5a8f5
ksh-88 egrep-style extended pattern matching .
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
157
diff
changeset
|
89 |
|
619
8080fc135a18
Enable '**' patttern matching. If the pattern is followed by a /, only dirs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
618
diff
changeset
|
90 |
# Enable '**' patttern matching. If the pattern is followed by a /, only dirs match. |
8080fc135a18
Enable '**' patttern matching. If the pattern is followed by a /, only dirs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
618
diff
changeset
|
91 |
shopt -s globstar |
8080fc135a18
Enable '**' patttern matching. If the pattern is followed by a /, only dirs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
618
diff
changeset
|
92 |
|
8080fc135a18
Enable '**' patttern matching. If the pattern is followed by a /, only dirs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
618
diff
changeset
|
93 |
# Ignore case in glob. |
8080fc135a18
Enable '**' patttern matching. If the pattern is followed by a /, only dirs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
618
diff
changeset
|
94 |
shopt -s nocaseglob |
8080fc135a18
Enable '**' patttern matching. If the pattern is followed by a /, only dirs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
618
diff
changeset
|
95 |
|
8080fc135a18
Enable '**' patttern matching. If the pattern is followed by a /, only dirs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
618
diff
changeset
|
96 |
# Show stopped jobs before exit. Next ^D force to leave bash... |
8080fc135a18
Enable '**' patttern matching. If the pattern is followed by a /, only dirs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
618
diff
changeset
|
97 |
shopt -s checkjobs |
8080fc135a18
Enable '**' patttern matching. If the pattern is followed by a /, only dirs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
618
diff
changeset
|
98 |
|
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
99 |
# Adjust settings according to current terminal window width |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
100 |
# which may have changed while the last command was running |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
101 |
# (which is a common occurance for vim/less/etc.) |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
102 |
# Note this is already set in /etc/bashrc on Fedora 8 at least. |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
103 |
shopt -s checkwinsize |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
104 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
105 |
# Let me have core dumps |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
106 |
ulimit -c unlimited |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
107 |
|
44
e4703f904e4b
Use bash-completion, if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
43
diff
changeset
|
108 |
################################################################ |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
109 |
# shortcut aliases |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
110 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
111 |
alias ..="cd .." #go to parent dir |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
112 |
alias ...="cd ../.." #go to grandparent dir |
109
40feef132306
Fix "alias: --: неправильная опция".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
107
diff
changeset
|
113 |
alias -- -="cd -" # go to previous dir |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
114 |
alias l.='ls -d .*' #list hidden files |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
115 |
alias ll='ls -lhrt' #extra info compared to "l" |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
116 |
alias lld='ls -lUd */' #list directories |
231
84c9533f2675
I prefer EN man pages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
230
diff
changeset
|
117 |
# I prefer EN man pages. |
84c9533f2675
I prefer EN man pages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
230
diff
changeset
|
118 |
alias man='LANG=C man' |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
119 |
|
251
30e947dddaa3
Shorter alias for jobs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
250
diff
changeset
|
120 |
alias j='jobs ' |
30e947dddaa3
Shorter alias for jobs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
250
diff
changeset
|
121 |
|
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
122 |
# make and change to a directory |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
123 |
md () { mkdir -p "$1" && cd "$1"; } |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
124 |
|
704
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
125 |
myfind() { find . -iname "$1"; } |
783
b1ace79cf017
Because I remove utils/pathsearch project I save some usage example from man page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
777
diff
changeset
|
126 |
|
b1ace79cf017
Because I remove utils/pathsearch project I save some usage example from man page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
777
diff
changeset
|
127 |
# Usage example: |
b1ace79cf017
Because I remove utils/pathsearch project I save some usage example from man page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
777
diff
changeset
|
128 |
# mypath EMACSLOADPATH '*.el' \; |
b1ace79cf017
Because I remove utils/pathsearch project I save some usage example from man page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
777
diff
changeset
|
129 |
# mypath TEXINPUTS "*cyr*" |
b1ace79cf017
Because I remove utils/pathsearch project I save some usage example from man page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
777
diff
changeset
|
130 |
# VAR=`cygpath -p '$INCLUDE'` mypath VAR "windows*" |
704
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
131 |
mypath() { |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
132 |
local var="$2" |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
133 |
[[ -z $var ]] && var=PATH |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
134 |
local delim="$3" |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
135 |
[[ -z $delim ]] && delim=: |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
136 |
local split |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
137 |
IFS="$delim" command eval "read -ra split <<< \"\${$var}\"" |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
138 |
for dir in "${split[@]}"; do |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
139 |
[[ -z "$dir" ]] && continue |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
140 |
if [[ -f "$dir"/"$1" ]]; then |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
141 |
echo "$dir"/"$1" |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
142 |
else |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
143 |
ls -d "$dir"/$1 2>/dev/null | cat |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
144 |
fi |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
145 |
done |
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
146 |
} |
705
4a77587b0617
Completion for mypath Bash helper.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
147 |
_mypath() { |
4a77587b0617
Completion for mypath Bash helper.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
148 |
if [[ $COMP_CWORD = 2 ]]; then |
4a77587b0617
Completion for mypath Bash helper.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
149 |
COMPREPLY=( $(compgen -v -- "${COMP_WORDS[2]}") ) |
4a77587b0617
Completion for mypath Bash helper.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
150 |
fi |
4a77587b0617
Completion for mypath Bash helper.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
151 |
} |
4a77587b0617
Completion for mypath Bash helper.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
704
diff
changeset
|
152 |
complete -F _mypath mypath |
704
e1347fd80853
myfind and mypath interactive bash session helper function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
703
diff
changeset
|
153 |
|
305
72032902cdd1
Enable colours for 'ls' and 'grep'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
304
diff
changeset
|
154 |
# LANG=C for speed. |
884
e400725dd13d
It's impossible to disable -n so it's better to remove it.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
860
diff
changeset
|
155 |
alias grep='GREP_COLOR="31;47" LANG=C grep --color=auto' |
799
c85ac0f4c0f5
Fix: ls --color=auto does not work in NetBSD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
156 |
case $OSTYPE in |
c85ac0f4c0f5
Fix: ls --color=auto does not work in NetBSD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
157 |
linux*|cygwin) alias ls='ls --color=auto' ;; |
c85ac0f4c0f5
Fix: ls --color=auto does not work in NetBSD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
795
diff
changeset
|
158 |
esac |
306 | 159 |
alias minicom='minicom -c on' |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
160 |
|
656
ed0f6aece96c
Remove '-3' option from calendar as it conflict with year argument.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
161 |
# Weeks start on Monday. |
ed0f6aece96c
Remove '-3' option from calendar as it conflict with year argument.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
653
diff
changeset
|
162 |
alias ncal='ncal -M' |
306 | 163 |
|
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
164 |
# alias diff='LC_ALL=C TZ=GMT0 diff -Naur' #normalise diffs for distribution |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
165 |
# alias sudo='sudo env PATH=$PATH' #work around sudo built --with-secure-path (ubuntu) |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
166 |
# alias vim='vim -X' #don't try to contact xserver (which can hang on network issues) |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
167 |
# alias gdb='gdb -tui' #enable the text window interface if possible |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
168 |
|
596
f6be61efe78f
Add 'dquilt' alias for Debian package development.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
594
diff
changeset
|
169 |
alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg" |
f6be61efe78f
Add 'dquilt' alias for Debian package development.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
594
diff
changeset
|
170 |
|
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
171 |
# what most people want from od (hexdump) |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
172 |
# alias hd='od -Ax -tx1z -v' |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
173 |
|
57
99d0eb7974d6
Remove --comment-delimiters-on-blank-lines option from indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
45
diff
changeset
|
174 |
# --blank-lines-after-procedures --break-before-boolean-operator --braces-on-if-line --braces-on-struct-decl-line |
99d0eb7974d6
Remove --comment-delimiters-on-blank-lines option from indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
45
diff
changeset
|
175 |
# --comment-indentationn --space-after-cast --line-comments-indentationn --declaration-indentationn --honour-newlines |
99d0eb7974d6
Remove --comment-delimiters-on-blank-lines option from indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
45
diff
changeset
|
176 |
# --no-space-after-function-call-names --no-tabs --struct-brace-indentationn --start-left-side-of-comments |
99d0eb7974d6
Remove --comment-delimiters-on-blank-lines option from indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
45
diff
changeset
|
177 |
alias indent-bifit="indent -bap -bbo -br -brs -cdw -ce -cli0 -c0 -cs -d0 -di0 -hnl -l120 -lc90 -i4 -npcs -ppi 3 -npsl -nut -sbi4 -sc" |
45
5c94d2613433
Added alias for reindent code for our job rules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
44
diff
changeset
|
178 |
|
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
179 |
# canonicalize path (including resolving symlinks) |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
180 |
# alias realpath='readlink -f' |
32
031655c93305
Special case for CYGWIN to properly display russian letters in rxvt.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
30
diff
changeset
|
181 |
|
469 | 182 |
# Fix lang under X. |
477
d0c29482707d
Switch to kbdd program for manage input method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
469
diff
changeset
|
183 |
alias en="dbus-send --dest=ru.gentoo.KbddService /ru/gentoo/KbddService ru.gentoo.kbdd.set_layout uint32:0" |
d0c29482707d
Switch to kbdd program for manage input method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
469
diff
changeset
|
184 |
alias ут="dbus-send --dest=ru.gentoo.KbddService /ru/gentoo/KbddService ru.gentoo.kbdd.set_layout uint32:0" |
469 | 185 |
|
150 | 186 |
################################################################ |
174
f862e6d84d02
Move key binding as dabbrev-expand defined only in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
171
diff
changeset
|
187 |
# Key binding. |
f862e6d84d02
Move key binding as dabbrev-expand defined only in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
171
diff
changeset
|
188 |
|
176 | 189 |
set -o emacs |
190 |
||
686
8c21afb3d2b6
Don't bind in noninteractive mode to prevent from printing warnings:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
685
diff
changeset
|
191 |
if [[ $- == *i* ]]; then |
8c21afb3d2b6
Don't bind in noninteractive mode to prevent from printing warnings:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
685
diff
changeset
|
192 |
bind '"\e/": dabbrev-expand' |
8c21afb3d2b6
Don't bind in noninteractive mode to prevent from printing warnings:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
685
diff
changeset
|
193 |
bind '"\ee": edit-and-execute-command' |
8c21afb3d2b6
Don't bind in noninteractive mode to prevent from printing warnings:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
685
diff
changeset
|
194 |
fi |
174
f862e6d84d02
Move key binding as dabbrev-expand defined only in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
171
diff
changeset
|
195 |
|
f862e6d84d02
Move key binding as dabbrev-expand defined only in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
171
diff
changeset
|
196 |
################################################################ |
150 | 197 |
# Completion. |
198 |
||
284
3351fda649d5
Switch to Bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
283
diff
changeset
|
199 |
if [[ -f /etc/bash_completion ]]; then |
795
6e8756ef4fdd
Enable bash_completion for Cygwin because new bash version support delayed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
200 |
# in Debian |
6e8756ef4fdd
Enable bash_completion for Cygwin because new bash version support delayed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
201 |
. /etc/bash_completion |
6e8756ef4fdd
Enable bash_completion for Cygwin because new bash version support delayed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
202 |
complete -F _quilt_completion dquilt |
6e8756ef4fdd
Enable bash_completion for Cygwin because new bash version support delayed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
203 |
elif [[ -f /usr/share/bash-completion/bash_completion ]]; then |
6e8756ef4fdd
Enable bash_completion for Cygwin because new bash version support delayed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
204 |
# in Cygwin |
6e8756ef4fdd
Enable bash_completion for Cygwin because new bash version support delayed
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
788
diff
changeset
|
205 |
. /usr/share/bash-completion/bash_completion |
284
3351fda649d5
Switch to Bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
283
diff
changeset
|
206 |
elif [[ -f ~/usr/etc/bash_completion ]]; then |
3351fda649d5
Switch to Bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
283
diff
changeset
|
207 |
. ~/usr/etc/bash_completion |
240
62bea4f80160
Take more priority for 'bash_completion' instead my completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
239
diff
changeset
|
208 |
fi |
283
eb383cf7ba80
Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
282
diff
changeset
|
209 |
# Load local completions. |
284
3351fda649d5
Switch to Bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
283
diff
changeset
|
210 |
if [[ -f ~/.bash_completion ]]; then |
283
eb383cf7ba80
Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
282
diff
changeset
|
211 |
. ~/.bash_completion |
eb383cf7ba80
Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
282
diff
changeset
|
212 |
fi |
284
3351fda649d5
Switch to Bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
283
diff
changeset
|
213 |
if [[ -d ~/.bash_completion.d ]]; then |
283
eb383cf7ba80
Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
282
diff
changeset
|
214 |
for f in ~/.bash_completion.d/* ~/.bash_completion.d/.*; do |
290
e19be6298b09
Fix error: "bash: .: /cygdrive/d/home/.bash_completion.d/..: является директорией"
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
284
diff
changeset
|
215 |
[[ -f "$f" ]] && . "$f" |
283
eb383cf7ba80
Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
282
diff
changeset
|
216 |
done |
eb383cf7ba80
Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
282
diff
changeset
|
217 |
fi |
eb383cf7ba80
Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
282
diff
changeset
|
218 |
|
449
63fe7a1ebae4
Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
309
diff
changeset
|
219 |
################################################################ |
63fe7a1ebae4
Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
309
diff
changeset
|
220 |
# Load custom settings (user editable). |
63fe7a1ebae4
Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
309
diff
changeset
|
221 |
# Placed to the end to allow override skel settings. |
63fe7a1ebae4
Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
309
diff
changeset
|
222 |
|
653
a5566b182446
Use .env file as common env var settings for Bash and Zsh.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
648
diff
changeset
|
223 |
if [[ -f ~/.env.local ]]; then |
a5566b182446
Use .env file as common env var settings for Bash and Zsh.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
648
diff
changeset
|
224 |
. ~/.env.local |
449
63fe7a1ebae4
Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
309
diff
changeset
|
225 |
fi |
63fe7a1ebae4
Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
309
diff
changeset
|
226 |
|
685
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
227 |
################################################################ |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
228 |
# Useful functions. |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
229 |
|
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
230 |
datediff() { |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
231 |
[[ -n "$1" ]] || { echo first argument is missing; return 1; } |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
232 |
[[ -n "$2" ]] || { echo second argument is missing; return 1; } |
834
31202b672717
Switch arguments order.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
828
diff
changeset
|
233 |
local diff=$(( $(date -d "$1" +%s) - $(date -d "$2" +%s) )) |
685
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
234 |
local sec=$(( diff % 60 )) |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
235 |
diff=$(( diff / 60 )) |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
236 |
local min=$(( diff % 60 )) |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
237 |
diff=$(( diff / 60 )) |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
238 |
local hour=$(( diff % 24 )) |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
239 |
local day=$(( diff / 24 )) |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
240 |
echo $day days $hour hours $min minutes $sec seconds |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
241 |
} |
c2b825bf0353
Add datediff useful function.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
656
diff
changeset
|
242 |
|
811
b41cb471a3d0
Add function for linguistic analysis.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
799
diff
changeset
|
243 |
# For linguistic analysis. |
b41cb471a3d0
Add function for linguistic analysis.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
799
diff
changeset
|
244 |
myfreq() { |
b41cb471a3d0
Add function for linguistic analysis.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
799
diff
changeset
|
245 |
ag --nofilename -C1 -- "$1" |
b41cb471a3d0
Add function for linguistic analysis.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
799
diff
changeset
|
246 |
printf '\n\n\e[31mtotal:\e[0m ' |
b41cb471a3d0
Add function for linguistic analysis.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
799
diff
changeset
|
247 |
ag --nofilename --count -- "$1" | awk '{c += $1} END {print c}' |
b41cb471a3d0
Add function for linguistic analysis.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
799
diff
changeset
|
248 |
} |
888
ec96d18f51b0
Command to spoof git commit date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
249 |
|
ec96d18f51b0
Command to spoof git commit date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
250 |
mygit-date() { |
ec96d18f51b0
Command to spoof git commit date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
251 |
echo GIT_COMMITTER_DATE='"'"$1"'"' git commit --amend --no-edit --date '"'"$1"'"' |
ec96d18f51b0
Command to spoof git commit date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
252 |
GIT_COMMITTER_DATE="$1" git commit --amend --no-edit --date "$1" |
ec96d18f51b0
Command to spoof git commit date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
253 |
} |
ec96d18f51b0
Command to spoof git commit date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
884
diff
changeset
|
254 |