Skip to content

Instantly share code, notes, and snippets.

@roziscoding
Last active February 9, 2022 18:46
Show Gist options
  • Save roziscoding/5503f548bcc939ce6a959ebfa2b986c7 to your computer and use it in GitHub Desktop.
Save roziscoding/5503f548bcc939ce6a959ebfa2b986c7 to your computer and use it in GitHub Desktop.
# Adds `brew` to PATH
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
# 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
# Fixing completions
setopt automenu nolistambiguous
zstyle ':completion:*' menu select
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt autocd beep extendedglob nomatch notify
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/roz/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
bindkey "^[[3~" delete-char
### Added by Zinit's installer
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f"
command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
command git clone git@github.com:zdharma-continuum/zinit.git "$HOME/.zinit/bin" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi
source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zdharma-continuum/zinit-annex-readurl \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust \
srijanshetty/node.plugin.zsh \
agkozak/zsh-z
### End of Zinit's installer chunk
### User added
# Loads powerlevel10k
zinit ice depth=1; zinit light romkatv/powerlevel10k
# Adds github shortcuts to PATH
export PATH=$PATH:/home/roz/.bin/git-goodies
## Adds .bin folder to PATH
export PATH=$PATH:/home/roz/.bin
# Sets default editor to vim
export EDITOR=vim
export DENO_INSTALL="/home/roz/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
# Loads plugins
zinit wait lucid for \
atinit'ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay' \
zdharma-continuum/fast-syntax-highlighting \
blockf \
zsh-users/zsh-completions \
atload'!_zsh_autosuggest_start' \
zsh-users/zsh-autosuggestions \
hlissner/zsh-autopair \
zpm-zsh/colorize \
Tarrasch/zsh-command-not-found \
zpm-zsh/ls \
atload'unalias gst; alias gst="git status"' davidde/git \
atload'alias python=python3' amstrad/oh-my-matrix \
reegnz/jq-zsh-plugin \
atload'bindkey "^[[A" history-substring-search-up; bindkey "^[[B" history-substring-search-down;' zsh-users/zsh-history-substring-search \
Tarrasch/zsh-colors
# Aliases
function cz () {
code $(z -e $1)
}
function cfz () {
code $(fzf)
}
function mkd () {
mkdir -p $1 && cd $1
}
function ghc () {
OWNER=$(basename $(pwd))
gh repo clone $OWNER/$1
}
alias rd="rm -rf"
alias mongo="docker exec -it mongodb mongo"
alias pbcopy="xclip -i -sel clip"
alias pbpaste="xclip -o -sel clip"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
function gi() { curl -sLw n https://www.toptal.com/developers/gitignore/api/$@ ;}
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
. /opt/asdf-vm/asdf.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment