-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
executable file
·145 lines (112 loc) · 4.43 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# ~/.zshrc
# vi:ft=zsh
[ $(tput cols) -ge 100 ] && fastfetch
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
[[ -r "$XDG_CACHE_HOME/p10k-instant-prompt-${(%):-%n}.zsh" ]] &&
source "$XDG_CACHE_HOME/p10k-instant-prompt-${(%):-%n}.zsh"
# [[ $- != *i* ]] && return
# Source the global shell-agnostic script
. $HOME/.shrc
# autoload -U colors && colors
# Set up the prompt
autoload -Uz promptinit
promptinit
unsetopt nomatch
# PROMPT='%F{10}%n%f@%F{12}%m%f in %F{11}%~%f
# %F{13}-%F{14}-%F{9}%# '
# RPROMPT=''
# TODO: Figure out what to do with KEYTIMEOUT
# KEYTIMEOUT=
setopt histignorealldups sharehistory autocd
# FIXME: Separate histories into separate files (30-day intervals?)
# FIXME: Scrub empty lines
# Keep 100000 lines of history within the shell and save it to ~/.shhis
HISTSIZE=100000
SAVEHIST=100000
HISTFILE=$HOME/.shhis
HISTCONTROL=ignoreboth
# Use zinit as the zsh plugin manager
source $XDG_DATA_HOME/zinit/zinit.git/zinit.zsh
setopt COMPLETE_ALIASES
zstyle ':completion:*' menu select
zstyle ':completion:*' rehash true
zstyle ':completion::complete:*' gain-privileges 1
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zmodload zsh/complist
# Use zsh's modern completion system
autoload -Uz compinit
compinit
_comp_options+=(globdots)
# Plugin loading
zinit light-mode for \
zdharma-continuum/fast-syntax-highlighting \
zsh-users/zsh-autosuggestions \
zsh-users/zsh-completions \
jeffreytse/zsh-vi-mode \
romkatv/powerlevel10k \
zdharma-continuum/zinit-annex-as-monitor \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
# light-mode zdharma/history-search-multi-word \
# light-mode mbenford/zsh-tmux-auto-title \
# light-mode zsh-users/zsh-history-substring-search \
# zinit wait lucid for \
# atinit"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \
# zdharma/fast-syntax-highlighting \
# blockf \
# zsh-users/zsh-completions \
# zdharma/history-search-multi-word \
# atload"!_zsh_autosuggest_start" \
# zsh-users/zsh-autosuggestions
zstyle :plugin:history-search-multi-word reset-prompt-protect 1
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=fg=5
# export ZSH_TMUX_AUTO_TITLE_IDLE_TEXT="%last"
export ZSH_TMUX_AUTO_TITLE_IDLE_TEXT="%pwd"
# export ZVM_INSERT_MODE_CURSOR="white blinking bar"
# export MODE_CURSOR_REPLACE="$MODE_CURSOR_VIINS white"
# export MODE_CURSOR_VICMD="white block"
# export ZVM_SEARCH_MODE_CURSOR="#ff00ff steady underline"
# export ZVM_VISUAL_MODE_CURSOR="$MODE_CURSOR_VICMD steady bar"
# export MODE_CURSOR_VLINE="$MODE_CURSOR_VISUAL white"
export ZLE_RPROMPT_INDENT=0
# Keybinds
exit_shell() { exit; }
lf_from_shell() { lfcd; }
yazi_from_shell() { yazicd; }
zvm_define_widget exit_shell
zvm_define_widget lf_from_shell
zvm_define_widget yazi_from_shell
zvm_bindkey vicmd 'q' exit_shell
zvm_bindkey vicmd 'Q' exit_shell
# zvm_bindkey vicmd 'z' lf_from_shell
# zvm_bindkey viins '^o' lf_from_shell
zvm_bindkey vicmd 'z' yazi_from_shell
zvm_bindkey viins '^o' yazi_from_shell
# bindkey -M isearch " " magic-space # normal space during searches
# bindkey -M vicmd '/' history-incremental-search-backward
# bindkey -M vicmd '?' history-incremental-search-forward
# Disable all escape sequences in normal mode
# bindkey -rpM viins '\e'
# bindkey -rpM viins '\e\e'
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -M menuselect '^[[Z' reverse-menu-complete
zvm_after_init()
{
zinit light momo-lab/zsh-abbrev-alias && source ~/.zshal
}
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
source ~/.p10k.zsh
# source /home/ty/.nix-profile/etc/profile.d/nix.sh
# source /home/ty/.config/broot/launcher/bash/br
export NVM_DIR="$HOME/.config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
if [ -e /home/tyler/.nix-profile/etc/profile.d/nix.sh ]; then . /home/tyler/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer