-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
52 lines (38 loc) · 1.26 KB
/
.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
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
#ZSH_THEME="robbyrussell"
ZSH_THEME="jreese"
plugins=(git zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
# ----------------------------------------------------------------------
[ -f ~/.aliases ] && source ~/.aliases
[ -f ~/fzf/.fzf.zsh ] && source ~/fzf/.fzf.zsh
# https://github.com/Aloxaf/fzf-tab
source ~/fzf-tab/fzf-tab.plugin.zsh
[ -f ~/.completion.zsh ] && source ~/.completion.zsh
# ----------------------------------------------------------------------
sudo-it() {
prefix="sudo"
BUFFER="$prefix $BUFFER"
CURSOR=$(($CURSOR + $#prefix + 1))
}
zle -N sudo-it
bindkey "^S" sudo-it
comment-it() { # TODO change this to toggle-comment to be able both comment and uncomment
BUFFER="# $BUFFER"
CURSOR=$(($#BUFFER))
zle accept-line
}
zle -N comment-it
bindkey "^[#" comment-it # alt-# (alt-shift-#/3)
bindkey "^[3" comment-it # alt-3 (easy alt-#)
bindkey "^Q" clear-screen
bindkey -s '^W' 'ls -lh^M'
bindkey -s '^[^W' 'ls -lah^M'
bindkey -s '^[^S' 'sudo su -^M'
bindkey -s '^[^I' 'sudo apt install '
bindkey -s '^[t' 'tmux new-session -A -s default^M'
# ----------------------------------------------------------------------
stty -ixon
#PROMPT=${PROMPT/\%c/\%~}
#RPROMPT="%S%F{blue}%T%f%s"