diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc new file mode 100644 index 0000000..309734c --- /dev/null +++ b/dotfiles/.bashrc @@ -0,0 +1 @@ +source $HOME/.envrc diff --git a/dotfiles/.envrc b/dotfiles/.envrc new file mode 100644 index 0000000..0b1924c --- /dev/null +++ b/dotfiles/.envrc @@ -0,0 +1,49 @@ +export PATH + +eval "$(brew shellenv)" + +pathmunge() { + if ! echo "$PATH" | grep -Eq "(^|:)$1($|:)"; then + if [ "$2" = "after" ]; then + PATH="$PATH:$1" + else + PATH="$1:$PATH" + fi + fi +} + +export AYA_PREFIX=/Users/utensil/.aya +pathmunge "$AYA_PREFIX/bin" + +# export PYENV_ROOT="$HOME/.pyenv" +# [[ -d $PYENV_ROOT/bin ]] && pathmunge "PYENV_ROOT/bin:$PATH" +# eval "$(pyenv init -)" + +pathmunge "/opt/homebrew/opt/openjdk/bin" + +export VCPKG_ROOT="$HOME/.vcpkghome" +pathmunge "$VCPKG_ROOT" + +. "$HOME/.cargo/env" + +pathmunge "$HOME/.juliaup/bin" + +# opam configuration +[[ ! -r "$HOME/.opam/opam-init/init.zsh" ]] || source "$HOME/.opam/opam-init/init.zsh" >/dev/null 2>/dev/null + +# bun +export BUN_INSTALL="$HOME/.bun" +pathmunge "$BUN_INSTALL/bin" + +# >>> xmake >>> +test -f "$HOME/.xmake/profile" && source "$HOME/.xmake/profile" +# <<< xmake <<< + +pathmunge "$HOME/.local/bin" + +export PATH + +# export LDFLAGS="-L/opt/homebrew/opt/llvm@18/lib/c++ -L/opt/homebrew/opt/llvm@18/lib -lunwind" +# export PATH="/opt/homebrew/opt/llvm@18/bin:$PATH" +# export LDFLAGS="-L/opt/homebrew/opt/llvm@18/lib" +# export CPPFLAGS="-I/opt/homebrew/opt/llvm@18/include" diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc new file mode 100644 index 0000000..fb7592b --- /dev/null +++ b/dotfiles/.zshrc @@ -0,0 +1,68 @@ +source $HOME/.envrc + +eval "$(starship init zsh)" + +eval "$(zoxide init zsh)" + +# ---- FZF ----- + +# Set up fzf key bindings and fuzzy completion +eval "$(fzf --zsh)" + +# --- setup fzf theme --- +fg="#CBE0F0" +bg="#011628" +bg_highlight="#143652" +purple="#B388FF" +blue="#06BCE4" +cyan="#2CF9ED" + +export FZF_DEFAULT_OPTS="--color=fg:${fg},bg:${bg},hl:${purple},fg+:${fg},bg+:${bg_highlight},hl+:${purple},info:${blue},prompt:${cyan},pointer:${cyan},marker:${cyan},spinner:${cyan},header:${cyan}" + +# -- Use fd instead of fzf -- + +export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git" +export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" +export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git" + +# Use fd (https://github.com/sharkdp/fd) for listing path candidates. +# - The first argument to the function ($1) is the base path to start traversal +# - See the source code (completion.{bash,zsh}) for the details. +_fzf_compgen_path() { + fd --hidden --exclude .git . "$1" +} + +# Use fd to generate the list for directory completion +_fzf_compgen_dir() { + fd --type=d --hidden --exclude .git . "$1" +} + +# source ~/fzf-git.sh/fzf-git.sh + +show_file_or_dir_preview="if [ -d {} ]; then eza --tree --color=always {} | head -200; else bat -n --color=always --line-range :500 {}; fi" + +export FZF_CTRL_T_OPTS="--preview '$show_file_or_dir_preview'" +export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always {} | head -200'" + +# Advanced customization of fzf options via _fzf_comprun function +# - The first argument to the function is the name of the command. +# - You should make sure to pass the rest of the arguments to fzf. +_fzf_comprun() { + local command=$1 + shift + + case "$command" in + cd) fzf --preview 'eza --tree --color=always {} | head -200' "$@" ;; + export|unset) fzf --preview "eval 'echo \${}'" "$@" ;; + ssh) fzf --preview 'dig {}' "$@" ;; + *) fzf --preview "$show_file_or_dir_preview" "$@" ;; + esac +} + +# run `just prep-zsh` first +source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh +source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion diff --git a/ghostty.conf b/ghostty.conf index 293adca..0b2dad4 100644 --- a/ghostty.conf +++ b/ghostty.conf @@ -1,22 +1,24 @@ -font-family = "FiraCode Nerd Font Mono" - +font-family = FiraCode Nerd Font Mono font-size = 18.0 +# font-feature = -liga theme = "Github Dark" - -working-directory = "/Users/utensil/projects/forest" - -background-opacity = 0.8 - +background-opacity = 0.5 +# background-blur-radius = 20 macos-non-native-fullscreen = true mouse-hide-while-typing = true +cursor-style = block +cursor-style-blink = false +shell-integration-features = no-cursor mouse-scroll-multiplier = 0.5 -macos-titlebar-style = transparent -window-padding-x = 4 -window-padding-y = 0 +macos-titlebar-style = hidden +window-decoration = true +# window-padding-x = 10 +# window-padding-y = 10 +window-padding-balance = true window-width = 1280 window-height = 800 @@ -24,6 +26,16 @@ window-height = 800 copy-on-select = true window-save-state = always +confirm-close-surface = false + +auto-update = check + +working-directory = "/Users/utensil/projects/forest" + +keybind = super+r=reload_config +keybind = super+i=inspector:toggle + +# alt + arrow keys to behave like w or b in vim diff --git a/justfile b/justfile index 7a788fb..14fb75c 100644 --- a/justfile +++ b/justfile @@ -613,3 +613,11 @@ fzf: view URL="http://localhost:1314/": awrit {{URL}} +prep-zsh: + brew install zsh-autosuggestions zsh-syntax-highlighting + +prep-rc: + # copy with confirmation + cp -i dotfiles/.envrc ~/.envrc + cp -i dotfiles/.bashrc ~/.bashrc + cp -i dotfiles/.zshrc ~/.zshrc