-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zshrc
90 lines (64 loc) · 2.47 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
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
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/jaakko/.zshrc'
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit && compinit -i
zstyle ':completion:*' menu select
compinit
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
# End of lines added by compinstall
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh
unset zle_bracketed_paste
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
PROMPT_EOL_MARK=''
# Prompt
export PS1="%F{39}%n %F{white}%c %F{39}$ %F{white}"
# Adding color
alias ls='ls -hN --color=auto --group-directories-first'
alias git-lines='git ls-files | xargs wc -l'
cdl() { cd $1 && ls }
# vi mode
bindkey -v
export KEYTIMEOUT=1
# -----------------------------------
# Keybindings
# -----------------------------------
typeset -g -A key
key[Home]="${terminfo[khome]}"
key[End]="${terminfo[kend]}"
key[Backspace]="${terminfo[kbs]}"
[[ -n "${key[Backspace]}" ]] && bindkey -- "${key[Backspace]}" backward-delete-char
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
bindkey "^H" backward-delete-word
bindkey "^[[1;5D" backward-word
bindkey "^[[1;5C" forward-word
# Change cursor shape for different vi modes.
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]] || [[ $1 = 'block' ]]; then
echo -ne '\e[1 q'
elif [[ ${KEYMAP} == main ]] || [[ ${KEYMAP} == viins ]] || [[ ${KEYMAP} = '' ]] || [[ $1 = 'beam' ]]; then
echo -ne '\e[5 q'
fi
}
zle -N zle-keymap-select
zle-line-init() {
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
echo -ne "\e[5 q"
}
zle -N zle-line-init
echo -ne '\e[5 q' # Use beam shape cursor on startup.
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/home/jaakko/Lataukset/google-cloud-sdk/path.zsh.inc' ]; then . '/home/jaakko/Lataukset/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/home/jaakko/Lataukset/google-cloud-sdk/completion.zsh.inc' ]; then . '/home/jaakko/Lataukset/google-cloud-sdk/completion.zsh.inc'; fi
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /usr/bin/terraform terraform