-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_zshrc.tmpl
More file actions
78 lines (64 loc) · 2.48 KB
/
dot_zshrc.tmpl
File metadata and controls
78 lines (64 loc) · 2.48 KB
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
# 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.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='mvim'
fi
# Make NeoVim the default editor
export EDITOR="nvim"
export VISUAL="nvim"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load -- powerlevel10k is preferred.
ZSH_THEME="powerlevel10k/powerlevel10k"
# Install plugins via `git clone` into $ZSH_CUSTOM/plugins/
# NOTE: plugins=(git) # breaks GCL
plugins=(
zsh-autosuggestions
zsh-syntax-highlighting
zsh-vi-mode
)
source $ZSH/oh-my-zsh.sh
# Source zsh plugins according to where they're installed on the OS
{{- if eq .machine "google_linux" }}
source $HOME/zsh-autosuggestions/zsh-autosuggestions.zsh
source $HOME/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $HOME/zsh-vim-mode/zsh-vim-mode.zsh
{{- else if eq .chezmoi.os "darwin" }}
# iTerm2 Integration
source $HOME/.iterm2_shell_integration.zsh
# Add Node to PATH
echo 'export PATH="/opt/homebrew/opt/node@20/bin:$PATH"' >> ~/.zshrc
# Homebrew added to zsh
source $HOME/.zprofile
{{- end}}
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
source ~/.zsh_aliases
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Find directories faster using via `zoxide` autocomplete instead of `cd`.
eval "$(zoxide init zsh)"
# Use the default zsh config for fuzzyfinder
source <(fzf --zsh)
# Enable Vim in the shell (used by fzf)
bindkey -v
# Run google-specific commands for gLinux or gMac, or personal commands.
{{- if (or
(eq .machine "google_macbook")
(eq .machine "google_macstudio")
(eq .machine "google_linux"))}}
source ~/.zshrc_google
{{- else if eq .machine "personal_macbook" }}
source ~/.zshrc_personal
{{- end}}