-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
102 lines (84 loc) · 3.21 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
# First Run Checks
if [[ ! -d ~/.oh-my-zsh ]]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended
git clone --depth=1 'https://github.com/romkatv/powerlevel10k.git' "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"
git clone 'https://github.com/zsh-users/zsh-autosuggestions' "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions"
git clone 'https://github.com/zsh-users/zsh-syntax-highlighting.git' "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting"
git clone 'https://github.com/joshskidmore/zsh-fzf-history-search' "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-fzf-history-search"
git clone 'https://github.com/TamCore/autoupdate-oh-my-zsh-plugins' "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/autoupdate"
fi
# Automatically update oh-my-zsh
zstyle ':omz:update' mode auto
# Console initialisation code to be run before p10k prompt
plugins=(
ssh-agent
)
# 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
# Save History only upto 1000 items
HISTSIZE=5000
SAVEHIST=5000
# Fix vim colours within tmux
export TERM='xterm-256color'
# Set name of the theme to load
ZSH_THEME='powerlevel10k/powerlevel10k'
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Plugins
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Add wisely, as too many plugins slow down shell startup.
plugins=(
sudo
copypath
copyfile
debian
git
autoupdate
vi-mode
zsh-fzf-history-search
zsh-autosuggestions
zsh-syntax-highlighting
)
# Disable bracketed-magic-paste to fix slow paste
DISABLE_MAGIC_FUNCTIONS=true
source $ZSH/oh-my-zsh.sh
# Set language environment
export LC_ALL=en_IN.UTF-8
export LANG=en_IN.UTF-8
# Aliases
alias zc="vi ~/.zshrc"
alias zl="vi ~/.zshrc-Linux"
alias zm="vi ~/.zshrc-Darwin"
alias zs="source ~/.zshrc"
alias vc="vi ~/.vimrc"
alias vp="vi ~/.vim/plugins.vim"
alias tx="vi ~/.tmux.conf"
alias cl='clear'
alias untar='tar -zxvf'
alias p10k_upgrade="git -C ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k pull"
alias f='fuck'
alias lg='lazygit'
# thefuck config
eval $(thefuck --alias)
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# fzf config
[[ -f ~/.fzf.zsh ]] && source ~/.fzf.zsh
# eza
if [[ -x "$(command -v eza)" ]]; then
alias ls='eza'
alias la='eza --long --all --group'
alias lsz='eza -l --total-size -s=size -r --no-user --no-permissions'
alias lsr='eza -l --total-size -s=time -r --no-user --no-permissions'
alias lsn='eza -l --total-size -s=name --no-user --no-permissions'
fi
# autoload zsh functions
fpath+=~/GitHub/dotfiles/zshfunctions
autoload -Uz ~/GitHub/dotfiles/zshfunctions/**/*
# Load .zshrc specific to OS
source ${ZDOTDIR:-${HOME}}/.zshrc-`uname`