Skip to content

Commit

Permalink
More Ghostty configs and a bit dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Dec 29, 2024
1 parent f87dea8 commit c3b3947
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 10 deletions.
1 change: 1 addition & 0 deletions dotfiles/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source $HOME/.envrc
49 changes: 49 additions & 0 deletions dotfiles/.envrc
Original file line number Diff line number Diff line change
@@ -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"
68 changes: 68 additions & 0 deletions dotfiles/.zshrc
Original file line number Diff line number Diff line change
@@ -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
32 changes: 22 additions & 10 deletions ghostty.conf
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
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

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



Expand Down
8 changes: 8 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c3b3947

Please sign in to comment.