forked from outragedline/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
104 lines (84 loc) · 2.69 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/sh
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
zstyle ':vcs_info:git:*' formats '%b'
PROMPT=$'%F{%(#.blue.green)}┌──(%B%F{%(#.red.blue)}%n@%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}] [%B%F{reset}% ${vcs_info_msg_0_}%b%F{%(#.blue.green)}]\n└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} '
# Options
setopt appendhistory
setopt autocd extendedglob nomatch menucomplete
setopt interactive_comments
stty stop undef # Disable ctrl-s to freeze terminal.
zle_highlight=('paste:none')
HYPHEN_INSENSITIVE="true"
unsetopt BEEP
# completions
autoload -Uz compinit
zstyle ':completion:*' menu select
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zmodload zsh/complist
compinit
_comp_options+=(globdots) # Include hidden files.
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
# Colors
autoload -Uz colors && colors
# Plugins
# Install the plugin manager with the command bellow
# zsh <(curl -s https://raw.githubusercontent.com/zap-zsh/zap/master/install.zsh)
[ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh"
plug "zsh-users/zsh-syntax-highlighting"
plug "zsh-users/zsh-autosuggestions"
# Aliases
alias ls='ls --color=auto'
alias la='ls -a'
alias nv=nvim
alias reb='shutdown -r now'
alias shut='shutdown -P now'
alias ..='cd ..'
alias ...='cd ../..'
alias ran='ranger'
alias lg='lazygit'
alias mkd='mkdir'
alias py='python'
# Exports
HISTSIZE=1000000
SAVEHIST=1000000
PATH=$PATH:~/.local/share/nvim/mason/bin/:~/bin/
MSYS=winsymlinks:nativestrict
HISTFILE=~/.zsh_history
export MANPAGER='nvim +Man!'
export MANWIDTH=999
export EDITOR="nvim"
export TERMINAL="alacritty"
export BROWSER="firefox"
export QT_QPA_PLATFORMTHEME=qt5ct
# Vim mode
bindkey -v
export KEYTIMEOUT=1
function zle-keymap-select () {
case $KEYMAP in
vicmd) echo -ne '\e[1 q';; # block
viins|main) echo -ne '\e[5 q';; # beam
esac
}
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.
# Key-bindings
bindkey -s '^O' 'ranger^M'
bindkey "^[[3~" delete-char # Delete key.
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
bindkey "^[[5~" history-beginning-search-backward
bindkey "^[[6~" history-beginning-search-forward
autoload edit-command-line; zle -N edit-command-line
bindkey '^E' edit-command-line