-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecutable_dot_postinitialization.sh
More file actions
58 lines (50 loc) · 1.36 KB
/
executable_dot_postinitialization.sh
File metadata and controls
58 lines (50 loc) · 1.36 KB
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
#! /bin/bash
# shellcheck disable=SC2139
# global aliases and functions
alias sha="shasum -a 256"
alias ff="fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'"
alias gll='git log --graph --pretty=oneline --abbrev-commit'
alias gst='git status'
alias gco='git commit'
alias lg='lazygit'
alias fd='fd -H'
alias rp='resticprofile'
alias grep='grep --colour=auto'
if [[ "${OSNAME}" == "Darwin" ]]; then
LS='gls'
else
LS='ls'
fi
if type l 2>/dev/null 1>&2; then
unalias 'l'
fi
alias l="${LS} -lah --color --hyperlink=never"
alias ll="${LS} -lah --color --hyperlink=never"
alias lr="${LS} -lahtr --color --hyperlink=never"
logtail() {
tail -f "$@" | bat --paging=never -l log
}
fcd() {
NEWCWD=$(fd --type d --hidden --exclude .git --exclude node_modules --exclude .cache | fzf)
# shellcheck disable=SC2181
if [[ $? -eq 0 ]]; then
cd "${NEWCWD}" || exit
fi
}
dnotify() {
local title=$1
shift 1
IFS=" "
local body=$*
if [[ -z "${TMUX}" ]]; then
printf "\x1b]777;notify;%s;%s\x1b\\" "${title}" "${body}"
else
printf "\x1bPtmux;\x1b\x1b]777;notify;%s;%s\x1b\x1b\\" "${title}" "${body}"
fi
}
if [[ "${OSNAME}" == "Linux" && "${OSRELEASE}" =~ "-microsoft-" ]]; then
alias open="explorer.exe"
fi
# load company / work specific aliases
# shellcheck source=./.company_aliases.sh
[[ ! -s "${HOME}/.company_aliases.sh" ]] || \. "${HOME}/.company_aliases.sh"