blob: c9cd972ac962c4b67319122507ee4c259ac72d3b (
plain) (
blame)
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
|
# If not running interactively, don’t do anything
[[ $- != *i* ]] && return
[ -f /etc/bashrc ] && . /etc/bashrc
function __dir_search {
local qry="$1"
local base="$2"
shift 2
local dir=$(
find "$base" "$@" -type d -printf '%P\n' \
| sed 1i. \
| sort -r \
| fzf -q "$qry"
)
[ -n "$dir" ] && pushd "$base/$dir"
}
function jr {
__dir_search "$1" "$REPODIR" -mindepth 2 -maxdepth 2
}
function jc {
__dir_search "$1" "$XDG_CONFIG_HOME" -maxdepth 1 -type d
}
function goto {
local dst="$(fzf --literal --filepath-word --walker=dir --walker-root="$HOME")" \
&& pushd "$dst"
}
alias irssi='irssi --config="$XDG_CONFIG_HOME/irssi/config" --home="$XDG_DATA_HOME/irssi"'
alias ..='cd ..'
alias d='git --git-dir="$REPODIR/@me/dotfiles.git" --work-tree="$HOME"'
alias g=git
alias grep='grep --color=auto'
alias la='ls --color=auto -Av --group-directories-first'
alias ll='ls --color=auto -AGhlv --group-directories-first --time-style="+%d %b %Y %T"'
alias ls='ls --color=auto -v --group-directories-first'
alias sl='sl -ac5'
alias de=doasedit
alias se=sudoedit
alias e="$VISUAL"
alias z='2>/dev/null zathura --fork "$@"'
__ps1_newline() {
local _ y x _
local RESET="\e[0m"
local HL="\e[30;47m"
IFS='[;' read -p $'\e[6n' -d R -rs _ y x _
[[ "$x" != 1 ]] && printf "${HL}␀\n${RESET}"
}
PS1="\$(__ps1_newline)"'\[\e[96;1m\]\u \[\e[39m\]\W \[\e[96m\]〉\[\e[0m\]'
command -v fzf >/dev/null && eval "$(fzf --bash)"
command -v niri >/dev/null && eval "$(niri completions bash)"
if [ -d "$NVM_DIR" ]
then
. "$NVM_DIR/nvm.sh"
. "$NVM_DIR/bash_completion"
fi
|