-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot-zshrc
94 lines (83 loc) · 2.67 KB
/
dot-zshrc
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
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
export EDITOR=nvim
export VISUAL=nvim
unsetopt beep
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/mayank/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Aliases
function vol ()
{
pamixer --set-volume=$1
}
function xbl ()
{
xbacklight -set $1
}
funtion floating (){
$1 &
sleep 0.5
i3-msg "$(xprop -root | awk '/WM_CLASS\(STRINGS\)/{print $NF}') floating enable"
}
alias logout="i3-msg exit"
alias ls="eza --color=always --long --git --icons=always --no-user --no-permissions --all"
function tma () {
tmux attach -t $1
}
alias obsidiansync="~/.config/scripts/zsh/ObsidianSync.sh"
alias clock="tty-clock -S -n -c"
function kbl (){
setxkbmap $1
echo "Current Keyboard Layout set to: $(setxkbmap -query | grep layout | awk '{ print $2 }')"
}
# THEME
eval "$(starship init zsh)"
# FZF and FD
eval "$(fzf --zsh)"
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \
--color=fg:#c0caf5,bg:#1a1b26,hl:#ff9e64 \
--color=fg+:#c0caf5,bg+:#292e42,hl+:#ff9e64 \
--color=info:#7aa2f7,prompt:#7dcfff,pointer:#7dcfff \
--color=marker:#9ece6a,spinner:#9ece6a,header:#9ece6a"
export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git"
_fzf_compgen_path() {
fd --hidden --exclude .git . "$1"
}
_fzf_compgen_dir() {
fd --type=d --hidden --exclude .git . "$1"
}
source ~/.config/fzf-git/fzf-git.sh
export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always --line-range :500 {}'"
export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always {} | head -200'"
# Advanced customization of fzf options via _fzf_comprun function
# - The first argument to the function is the name of the command.
# - You should make sure to pass the rest of the arguments to fzf.
_fzf_comprun() {
local command=$1
shift
case "$command" in
cd) fzf --preview 'eza --tree --color=always {} | head -200' "$@" ;;
export|unset) fzf --preview "eval 'echo \$'{}" "$@" ;;
ssh) fzf --preview 'dig {}' "$@" ;;
*) fzf --preview "bat -n --color=always --line-range :500 {}" "$@" ;;
esac
}
# BAT
export BAT_THEME=tokyonight_night
# ZOXIDE
eval "$(zoxide init zsh)"
alias cd="z"
# PLUGINS
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
export PATH=$PATH:/home/mayank/.cargo/bin
export PATH=$PATH:/home/mayank/.local/bin