From 61d0dbb5d7a4f6fa5e9eb311fb68171bfd166085 Mon Sep 17 00:00:00 2001 From: David Ibia Date: Sun, 28 Apr 2024 20:45:40 +0100 Subject: [PATCH] feat(.zshrc): add configuration for oh-my-zsh theme to use 'agnoster' for a more visually appealing shell prompt feat(.zshrc): add plugins for git, asdf, zsh-syntax-highlighting, and colorize to enhance shell functionality feat(.zshrc): add configurations for tmux autostart and colorize style for a better user experience feat(.zshrc): add aliases for nmap, ls, la, ll, lt, l., and cat to simplify common commands feat(.zshrc): set up bat as the default pager for viewing files with a specific theme feat(.zshrc): add aliases for vim to neovim and set the bat theme to 'Visual Studio Dark+' feat(.zshrc): add configuration for pnpm to set the home directory and alias 'pn' for 'pnpm' feat(.zshrc): initialize cargo environment for Rust development feat(.zshrc): initialize conda environment for Python package management feat(.zshrc): add configurations for curl setup, Android SDK, and bun completions feat(.zshrc): add configurations for TMUX setup with aliases for listing, attaching, and creating sessions feat(.zshrc): setup Github SSH agent and identity for secure repository access feat(.zshrc): setup Starship prompt for a customizable and informative shell prompt feat(.zshrc): setup Zoxide for fast directory navigation in the shell feat(.zshrc): setup FZF for fuzzy search and selection in the shell feat(.zshrc): add configurations for GEM_HOME and PATH for Ruby gem management feat(.zshrc): add configurations for Perl5 library and environment variables --- .zshrc | 226 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 .zshrc diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..822e769 --- /dev/null +++ b/.zshrc @@ -0,0 +1,226 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Enable 256 colors +# export TERM="xterm-256color" + +# Path to your oh-my-zsh installation. +export ZSH="/Users/davidibia/.oh-my-zsh" + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +# ZSH_THEME="robbyrussell" +# ZSH_THEME="powerlevel9k/powerlevel9k" +ZSH_THEME="agnoster" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +# DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to automatically update without prompting. +DISABLE_UPDATE_PROMPT="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS=true + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in ~/.oh-my-zsh/plugins/* +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git asdf zsh-syntax-highlighting colorize ) + +ZSH_COLORIZE_STYLE="colorful" +ZSH_TMUX_AUTOSTART="true" + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +if [[ -n $SSH_CONNECTION ]]; then + export EDITOR='vim' +else + export EDITOR='nvim' +fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# 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`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" +export PATH="/usr/local/opt/ncurses/bin:$PATH" + +# Go Setup +export PATH="/usr/local/go/bin:$PATH" + +# Flutter Setup + +export PATH="$HOME/flutter/bin:$PATH" + +# Act Setup + +export PATH="$HOME/bin:$PATH" + +###-tns-completion-start-### +if [ -f /Users/davidibia/.tnsrc ]; then + source /Users/davidibia/.tnsrc +fi +###-tns-completion-end-### + +# aliases for extra commands + +alias nmap='grc nmap' + +alias ls='exa -a --color=always --group-directories-first --icons' #my preferred listing +alias la='exa -a --color=always --group-directories-first --icons' # all files and dirs +alias ll='exa -l --color=always --group-directories-first --icons' # long format +alias lt='exa -aT --color=always --group-directories-first --icons' # tree +alias l.='exa -a --icons | egrep "^\."' + +alias cat='bat' +# Lets set the bat theme +export BAT_THEME="Visual Studio Dark+" + +# alias vim to neovim +alias vim='nvim' + + +[[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh + +# pnpm +export PNPM_HOME="/Users/davidibia/Library/pnpm" +export PATH="$PNPM_HOME:$PATH" +alias pn=pnpm +# pnpm end + +# Initiate cargo +. "$HOME/.cargo/env" + + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/Users/davidibia/miniconda3/bin/conda' 'shell.zsh' 'hook' 2>/dev/null)" +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/Users/davidibia/miniconda3/etc/profile.d/conda.sh" ]; then + . "/Users/davidibia/miniconda3/etc/profile.d/conda.sh" + else + export PATH="/Users/davidibia/miniconda3/bin:$PATH" + fi +fi +unset __conda_setup +# <<< conda initialize <<< + +# Curl Setup +export LDFLAGS="-L/opt/homebrew/opt/curl/lib" +export CPPFLAGS="-I/opt/homebrew/opt/curl/include" + +export ANDROID_HOME=$HOME/Library/Android/sdk +export PATH=$PATH:$ANDROID_HOME/platform-tools + +# bun completions +[ -s "/Users/davidibia/.bun/_bun" ] && source "/Users/davidibia/.bun/_bun" + +# bun +export BUN_INSTALL="$HOME/.bun" +export PATH="$BUN_INSTALL/bin:$PATH" + +if [ -d "$HOME/.local/bin" ] ; then + PATH="$HOME/.local/bin:$PATH" +fi + +# TMUX Setup Start + +alias tml="tmux ls" + +function tma() { + tmux attach -t $1 | title "Workspace" +} + +function tmn() { + tmux new -s $1 -c $PWD | title "Workspace" +} + +# TMUX Setup End + +# Setup Github SSH +eval "$(ssh-agent -s)" >/dev/null 2>&1 + +ssh-add --apple-use-keychain ~/.ssh/github >/dev/null 2>&1 || echo "Unable to setup Github SSH Identity" + + +# Setup Starship +eval "$(starship init zsh)" + +# Setup Zoxide +eval "$(zoxide init --cmd zd zsh)" + + +# Setup FZF +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + +export GEM_HOME=$HOME/.gem +export PATH=$GEM_HOME/bin:$PATH +export PATH=$HOME/flutter/bin:$PATH + + +PATH="/U/Users/davidibia/sers/davidibia/perl5/bin${PATH:+:${PATH}}"; export PATH; +PERL5LIB="/Users/davidibia/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; +PERL_LOCAL_LIB_ROOT="/Users/davidibia/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; +PERL_MB_OPT="--install_base \"/Users/davidibia/perl5\""; export PERL_MB_OPT; +PERL_MM_OPT="INSTALL_BASE=/Users/davidibia/perl5"; export PERL_MM_OPT;