Files

129 lines
4.5 KiB
Bash
Raw Permalink Normal View History

2026-03-26 12:07:53 +05:30
# === Environment ===
2024-12-02 19:57:09 +05:30
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_STATE_HOME="$HOME/.local/state"
export XDG_CACHE_HOME="$HOME/.cache"
2024-06-07 18:19:14 +05:30
2026-03-26 12:07:53 +05:30
export PATH="$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH"
export PATH="$PATH:/usr/local/go/bin:$HOME/go/bin"
export PATH="$PATH:$HOME/tinygo/bin"
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
2024-06-07 18:19:14 +05:30
2026-03-26 12:07:53 +05:30
export EDITOR='hx'
export OC_EDITOR="hx"
export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
2024-06-07 18:19:14 +05:30
export MANPATH="/usr/local/man:$MANPATH"
# fzf: use fd for file/dir finding, bat for previews, theme-matched colors
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_DEFAULT_OPTS=" \
--height=40% --layout=reverse --border=rounded --cycle --scroll-off=4 \
2026-05-10 15:18:38 +05:30
--color=bg:#000000,fg:#c1c9d2,bg+:#393939,fg+:#ffffff,hl:#3a97d4,hl+:#3a97d4 \
--color=info:#1ea672,prompt:#1ea672,pointer:#ed5f74,marker:#c96ed0 \
--color=spinner:#d97917,header:#3a97d4,border:#393939 \
--bind='ctrl-d:half-page-down,ctrl-u:half-page-up'"
export FZF_CTRL_T_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_OPTS="--preview 'bat --style=numbers --color=always --line-range :200 {}' --preview-window=right:50%:wrap"
export FZF_ALT_C_COMMAND='fd --type d --hidden --follow --exclude .git'
export FZF_ALT_C_OPTS="--preview 'ls --color=always {}'"
2024-06-07 18:19:14 +05:30
2026-03-26 12:07:53 +05:30
# Claude Code
export CLAUDE_CODE_USE_VERTEX=1
export CLOUD_ML_REGION=us-east5
export ANTHROPIC_VERTEX_PROJECT_ID=$GCP_PRODUCT_ID
# === Zinit ===
ZINIT_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/zinit/zinit.git"
if [ ! -d "$ZINIT_HOME" ]; then
mkdir -p "$(dirname "$ZINIT_HOME")"
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
fi
source "${ZINIT_HOME}/zinit.zsh"
# OMZ core libs
zinit snippet OMZL::async_prompt.zsh
zinit snippet OMZL::git.zsh
zinit snippet OMZL::prompt_info_functions.zsh
zinit snippet OMZL::theme-and-appearance.zsh
zinit snippet OMZL::key-bindings.zsh
zinit snippet OMZL::clipboard.zsh
zinit snippet OMZT::robbyrussell
# Plugins
zinit light zsh-users/zsh-autosuggestions
zinit light zsh-users/zsh-syntax-highlighting
zinit light Aloxaf/fzf-tab
# OMZ plugin snippets for completions and aliases
zinit snippet OMZP::git
zinit snippet OMZP::kubectl
zinit snippet OMZP::golang
# Docker completions (plugin has a subdirectory, needs ice)
zinit ice as"completion"
zinit snippet OMZP::docker/completions/_docker
# Wakatime (separate repo, not a standard OMZ plugin)
zinit light sobolevn/wakatime-zsh-plugin
# === Completions ===
autoload -Uz compinit && compinit
zinit cdreplay -q
2024-06-07 18:19:14 +05:30
2026-03-26 12:07:53 +05:30
CASE_SENSITIVE="true"
2024-06-07 18:19:14 +05:30
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
zstyle ':fzf-tab:complete:(hx|cat|bat|less|head|tail):*' fzf-preview \
'bat --style=numbers --color=always --line-range :100 $realpath 2>/dev/null || ls --color $realpath'
zstyle ':fzf-tab:complete:ls:*' fzf-preview 'ls --color $realpath'
zstyle ':fzf-tab:*' switch-group '<' '>'
2024-06-07 18:19:14 +05:30
2026-03-26 12:07:53 +05:30
# === Tool Initialization ===
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
2024-12-02 19:57:09 +05:30
2026-03-26 12:07:53 +05:30
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
2024-12-02 19:57:09 +05:30
2026-03-26 12:07:53 +05:30
# Atuin env (adds ~/.atuin/bin to PATH)
[ -f "$HOME/.atuin/bin/env" ] && . "$HOME/.atuin/bin/env"
2024-06-07 18:19:14 +05:30
eval "$(fzf --zsh)"
2024-06-07 18:19:14 +05:30
eval "$(zoxide init zsh)"
2026-03-26 12:07:53 +05:30
unalias zi 2>/dev/null; alias zi='__zoxide_zi'
2024-06-07 18:19:14 +05:30
eval "$(atuin init zsh)"
2026-03-26 12:07:53 +05:30
# Atuin as autosuggestion strategy (must be after atuin init)
export ZSH_AUTOSUGGEST_STRATEGY=(atuin history completion)
2024-06-07 18:19:14 +05:30
2026-03-26 12:07:53 +05:30
# Accept autosuggestion word-by-word with Ctrl+Right
bindkey '^[[1;5C' forward-word
2024-12-02 19:57:09 +05:30
2026-03-26 12:07:53 +05:30
# === Functions ===
znew() { zellij action new-tab --layout "$1" --name "$2" --cwd "$3"; }
zwork() {
local layout_dir="${XDG_CONFIG_HOME:-$HOME/.config}/zellij/layouts"
local project
project=$(fd --type d --max-depth 2 . 2>/dev/null \
| fzf --prompt="Folder > " --preview='ls --color=always {}')
[ -z "$project" ] && return 0
local layout
layout=$(fd --type f --extension kdl . "$layout_dir" 2>/dev/null \
| sed 's|.*/||; s/\.kdl$//' \
| fzf --prompt="Layout > ")
[ -z "$layout" ] && return 0
local tab_name
echo -n "Tab name [${project%/}]: "; read tab_name
zellij action new-tab --layout "$layout" --name "${tab_name:-${project%/}}" --cwd "$PWD/$project"
2026-03-26 12:07:53 +05:30
}
2024-12-02 19:57:09 +05:30
2026-03-26 12:07:53 +05:30
# === Aliases ===
alias work-git='git config user.email "avinal@redhat.com"'