-
Notifications
You must be signed in to change notification settings - Fork 14
/
.myownrc
65 lines (49 loc) · 2.25 KB
/
.myownrc
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
# ----------------------------------------------------------------------------
# BASIC ENVIRONMENTAL VARIABLES ---------------------------------------------
export EDITOR=micro
export VISUAL=micro
# ----------------------------------------------------------------------------
# ALIASES -------------------------------------------------------------------
# show numerical permissions of content of the current directory
alias statt='stat -c "%A %a %n" *'
# ip command with colors
alias ip='ip --color=auto'
# ----------------------------------------------------------------------------
# FZF -----------------------------------------------------------------------
# fzf just filters whatever default command gives it
# fd is simpler and faster find command so it is used
export FZF_DEFAULT_COMMAND='fd --hidden'
export FZF_DEFAULT_OPTS="--exact"
# ----------------------------------------------------------------------------
# NNN FILE MANAGER ----------------------------------------------------------
# nnn alias that shows hidden files, ownership and filter without entering
# nnn starts in starting_dir if it exists
starting_dir="$HOME/docker"
if [ -d "$starting_dir" ]; then
alias n="cd $starting_dir && nnn -H -U -A"
else
alias n="nnn -H -U -A"
fi
# sudo version
alias nnnn='sudo -E nnn -H -U -A'
# enable trash; different colors for tabs; bookmarks
export NNN_TRASH=1
export NNN_COLORS='2136'
export NNN_BMS='h:~;d:~/docker;e:/etc;s:/etc/systemd/system;m:/mnt;v:/var'
export NNN_PLUG='f:fzcd;' # to use fzf in nnn press ";f"
# shell opened from nnn using ! hotkey has indication of depth
[ -n "$NNNLVL" ] && PS1="N$NNNLVL $PS1"
# ----------------------------------------------------------------------------
# ZSH CUSTOM HOTKEYS ---------------------------------------------------------
# ctr+f prepends sudo on current line
add_sudo (){
BUFFER="sudo $BUFFER"
zle -w end-of-line
}
zle -N add_sudo
bindkey "^f" add_sudo
# ----------------------------------------------------------------------------
# DUF fixing color------------------------------------------------------------
export COLORTERM=truecolor
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------