chore(starship, nvim, tmux): removing starship, navigation between tmux and nvim, updated environment configs and scripts

This commit is contained in:
DarthMooMancer committed 2026-11-05 14:15:22 -05:00
1 parent c9b2a67939
commit 89d37946cf
19 files changed
+354 -405

No files matched your search

-3
View File
@@ -1,3 +0,0 @@
[submodule "tmux/.config/tmux/plugins/tpm"]
path = tmux/.config/tmux/plugins/tpm
url = https://github.com/tmux-plugins/tpm
+21 -23
View File
@@ -1,36 +1,34 @@
# Tools
cask "ghostty" cask "ghostty"
cask "font-jetbrains-mono-nerd-font"
cask "google-chrome" cask "google-chrome"
cask "tailscale-app" cask "tailscale-app"
cask "colemak-dh"
brew "mole"
brew "ripgrep"
brew "neovim" brew "neovim"
brew "tree-sitter" # dep to neovim brew "mole"
brew "tree-sitter-cli" # dep to neovim
brew "eza"
brew "starship"
brew "tmux" brew "tmux"
brew "fzf"
brew "zoxide"
brew "opencode"
# Utilities
brew "ripgrep"
brew "eza"
brew "bat" brew "bat"
brew "fd"
brew "git"
brew "stow"
brew "jq"
# brew "jpeg-turbo" # Used in libimg processor / C
# brew "pkgconfig" # Used in libimg processor / C
# Ricing
cask "font-jetbrains-mono-nerd-font"
# Languages & Runtimes
brew "python" brew "python"
brew "cmake" brew "cmake"
brew "fd" brew "node"
brew "fzf"
brew "git"
brew "zoxide"
brew "stow"
brew "jpeg-turbo"
brew "pkgconfig"
brew "npm"
brew "go" brew "go"
brew "wget"
brew "jq"
brew "ruby"
brew "opencode"
brew "uv" brew "uv"
brew "lua" brew "lua"
brew "luarocks"
brew "openjdk"
brew "bun" brew "bun"
brew "kanata"
+2 -1
View File
@@ -1,4 +1,5 @@
theme = "/Users/andrew/.config/ghostty/themes/kanso-zen" # theme = "/Users/andrew/.config/ghostty/themes/kanso-zen"
theme = kanso-zen
# theme = dark:Rose Pine,light:Rose Pine Dawn # theme = dark:Rose Pine,light:Rose Pine Dawn
font-family = "JetBrainsMono Nerd Font Medium" font-family = "JetBrainsMono Nerd Font Medium"
font-thicken = true font-thicken = true
+6 -15
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env bask
sudo -v sudo -v
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
#/usr/bin/env bash
if ! command -v brew &> /dev/null; then if ! command -v brew &> /dev/null; then
echo "Installing Homebrew..." echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@@ -17,29 +18,19 @@ fi
# echo "Installing Cargo" # echo "Installing Cargo"
# curl https://sh.rustup.rs -sSf | sh # curl https://sh.rustup.rs -sSf | sh
# fi # fi
if ! command -v zinit &> /dev/null; then
echo "Installing zinit"
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
fi
DOTFILES_DIR="$HOME/dotfiles" DOTFILES_DIR="$HOME/dotfiles"
if [ ! -d "$DOTFILES_DIR" ]; then if [ ! -d "$DOTFILES_DIR" ]; then
echo "Cloning dotfiles..." echo "Cloning dotfiles..."
git clone https://git@moo:dmm/dotfiles.git git clone https://git.moomancer.xyz/DarthMooMancer/dotfiles.git
fi fi
cd "$DOTFILES_DIR" cd "$DOTFILES_DIR"
brew bundle --file=.Brewfile brew bundle --file=brew/.Brewfile
stow . stow -v -t "$HOME"
cd ~/ cd ~/
TPM_DIR="$HOME/.config/tmux/plugins/tpm/" #
if [ ! -d "$TPM_DIR" ]; then
echo "Cloning tpm..."
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
fi
# Enable Touch ID for sudo # Enable Touch ID for sudo
if ! grep -q "pam_tid.so" /etc/pam.d/sudo; then if ! grep -q "pam_tid.so" /etc/pam.d/sudo; then
echo "Enabling Touch ID for sudo..." echo "Enabling Touch ID for sudo..."
@@ -20,6 +20,11 @@ map('n', '<C-j>', '<C-w>j', { silent = true })
map('n', '<C-k>', '<C-w>k', { silent = true }) map('n', '<C-k>', '<C-w>k', { silent = true })
map('n', '<C-l>', '<C-w>l', { silent = true }) map('n', '<C-l>', '<C-w>l', { silent = true })
map('n', '<C-h>', ':NvimTmuxNavigateLeft<CR>', { silent = true })
map('n', '<C-j>', ':NvimTmuxNavigateDown<CR>', { silent = true })
map('n', '<C-k>', ':NvimTmuxNavigateUp<CR>', { silent = true })
map('n', '<C-l>', ':NvimTmuxNavigateRight<CR>', { silent = true })
map('n', '<leader>E', ':Ex<CR>') map('n', '<leader>E', ':Ex<CR>')
map('n', '<leader>lp', '<cmd>LivePreview pick<cr>') map('n', '<leader>lp', '<cmd>LivePreview pick<cr>')
@@ -33,9 +38,7 @@ map('n', '<leader>uu', function()
}) })
end, { desc = 'native undotree', silent = true }) end, { desc = 'native undotree', silent = true })
map('n', '<leader>ff', function() map('n', '<leader>ff', vim.lsp.buf.format)
require('conform').format({ async = true, lsp_format = 'never' })
end)
map('n', '<leader>fs', vim.lsp.buf.document_symbol) map('n', '<leader>fs', vim.lsp.buf.document_symbol)
map('n', '<leader>gd', vim.lsp.buf.definition) map('n', '<leader>gd', vim.lsp.buf.definition)
@@ -43,61 +46,40 @@ map('n', '<leader>gr', vim.lsp.buf.references)
map('n', '<leader>gR', vim.lsp.buf.rename) map('n', '<leader>gR', vim.lsp.buf.rename)
map('n', '<leader>gc', vim.lsp.buf.code_action) map('n', '<leader>gc', vim.lsp.buf.code_action)
map('n', '<leader>xx', function() local function qf_is_open()
local qf_open = false return vim.fn.getqflist({ winid = 0 }).winid ~= 0
for _, win in ipairs(vim.fn.getwininfo()) do end
if win.quickfix == 1 then
qf_open = true
break
end
end
if qf_open then
vim.cmd('cclose')
else
vim.diagnostic.setqflist()
if #vim.fn.getqflist() == 0 then
vim.notify('No diagnostics found', vim.log.levels.WARN)
else
vim.cmd('copen')
end
end
end, { desc = 'Toggle Diagnostics Quickfix' })
local qf_group = vim.api.nvim_create_augroup('QuickFixDiagnostics', { clear = true }) local function diagnostic_items()
return vim.diagnostic.toqflist(vim.diagnostic.get())
end
map('n', '<leader>xx', function()
if qf_is_open() then
vim.cmd('cclose')
return
end
local items = diagnostic_items()
if #items == 0 then
vim.notify('No diagnostics found', vim.log.levels.WARN)
return
end
vim.fn.setqflist(items)
vim.cmd('copen')
end, { desc = 'Toggle diagnostics quickfix' })
local qf_group = vim.api.nvim_create_augroup('DiagnosticsQuickfix', { clear = true })
vim.api.nvim_create_autocmd('DiagnosticChanged', { vim.api.nvim_create_autocmd('DiagnosticChanged', {
group = qf_group, group = qf_group,
callback = function() callback = function()
vim.schedule(function() if not qf_is_open() then
local qf_open = false return
for _, win in ipairs(vim.fn.getwininfo()) do end
if win.quickfix == 1 then local items = diagnostic_items()
qf_open = true vim.fn.setqflist(items, 'r')
break if #items == 0 then
end vim.cmd('cclose')
end end
if qf_open then
local diagnostics = vim.diagnostic.get()
local qf_items = vim.diagnostic.toqflist(diagnostics)
vim.fn.setqflist(qf_items, 'r')
if #qf_items == 0 then
vim.cmd('cclose')
vim.notify('No diagnostics found', vim.log.levels.WARN)
end
end
end)
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = qf_group,
pattern = 'qf',
callback = function()
vim.schedule(function()
if vim.fn.getqflist({ size = 0 }).size == 0 then
vim.cmd('cclose')
end
end)
end, end,
}) })
+1 -46
View File
@@ -86,52 +86,6 @@ vim.lsp.config('rust_analyzer', {
}, },
}, },
}) })
-- vim.lsp.config('gopls', {})
vim.lsp.config('gopls', {
cmd = { 'gopls' },
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
settings = {
gopls = {
-- Verbose/Enhanced Completion Settings
usePlaceholders = true, -- Enables snippet placeholders (e.g. $1, $2) for function params
completeUnimported = true, -- Auto-suggests and imports packages that aren't yet in your imports block
completeFunctionCalls = false, -- Automatically appends parentheses to function completions
experimentalPostfixCompletions = true, -- Enables postfix completions like slice.sort!
-- Nice LSP & Diagnostics Settings
analyses = {
unusedparams = true, -- Highlights unused parameters
unusedvariable = true, -- Highlights unused variables
unusedwrite = true, -- Highlights field writes that are never read
shadow = true, -- Catches shadowed variables
fillreturns = true, -- Suggests return values to fill stub functions
nonewdecl = true, -- Catches redeclaration errors early
},
staticcheck = true, -- Enables staticcheck advanced analyzers for better linting
semanticTokens = true, -- Enables fine-grained semantic syntax highlighting if your theme supports it
codelenses = {
gc_details = true, -- Shows escape analysis details as code lenses
generate = true, -- Adds a code lens to run `go generate`
test = true, -- Adds a code lens to run tests inline
tidy = true, -- Adds a code lens to run `go mod tidy`
upgrade_dependency = true, -- Adds a code lens to upgrade dependencies
vendor = true, -- Adds a code lens to run `go mod vendor`
},
hints = {
assignVariableTypes = true, -- Inlay hints for variable types
compositeLiteralFields = true, -- Inlay hints for struct literal fields
compositeLiteralTypes = true, -- Inlay hints for struct literal types
constantValues = true, -- Inlay hints for constants
functionTypeParameters = true, -- Inlay hints for generic type parameters
parameterNames = true, -- Inlay hints for function parameter names (e.g. foo(ctx, /* paramName: */ val))
rangeVariableTypes = true, -- Inlay hints for range loops
},
},
},
})
-- Enable the server so it attaches to your Go files automatically
vim.lsp.enable('gopls')
vim.lsp.enable({ vim.lsp.enable({
'lua_ls', 'lua_ls',
@@ -139,6 +93,7 @@ vim.lsp.enable({
'pylsp', 'pylsp',
'rust_analyzer', 'rust_analyzer',
'gopls', 'gopls',
--- Web --- Web
'vtsls', 'vtsls',
'superhtml', 'superhtml',
@@ -17,6 +17,7 @@ vim.opt.smoothscroll = true
vim.opt.updatetime = 50 vim.opt.updatetime = 50
vim.opt.smartindent = true vim.opt.smartindent = true
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
local shifts = { local shifts = {
lua = 4, lua = 4,
@@ -42,6 +43,5 @@ vim.api.nvim_create_autocmd('FileType', {
vim.diagnostic.config({ vim.diagnostic.config({
virtual_text = true, virtual_text = true,
-- virtual_lines = true,
severity_sort = true, severity_sort = true,
}) })
@@ -8,21 +8,15 @@ vim.pack.add({
{ src = 'https://github.com/stevearc/conform.nvim' }, { src = 'https://github.com/stevearc/conform.nvim' },
{ src = 'https://git.moomancer.xyz/DarthMooMancer/mason-conform.nvim.git' }, { src = 'https://git.moomancer.xyz/DarthMooMancer/mason-conform.nvim.git' },
{ src = 'https://github.com/brianhuster/live-preview.nvim' }, { src = 'https://github.com/brianhuster/live-preview.nvim' },
-- { src = 'https://git.moomancer.xyz/DarthMooMancer/vern-nvim' }, { src = 'https://github.com/alexghergh/nvim-tmux-navigation' },
-- { src = 'https://github.com/vague-theme/vague.nvim' },
-- { src = 'https://github.com/rose-pine/neovim', name = 'rose-pine' },
}) })
-- require('rose-pine').setup({
-- disable_background = true,
-- styles = {
-- italic = false,
-- },
-- })
vim.opt.rtp:append('/Users/andrew/personal/Projects/Lua/vern-nvim') vim.opt.rtp:append('/Users/andrew/personal/Projects/Lua/vern-nvim')
vim.cmd('packadd nvim.undotree') vim.cmd('packadd nvim.undotree')
require('nvim-tmux-navigation').setup({
disable_when_zoomed = true, -- defaults to false
})
require('DarthMooMancer.plugins.blink-cmp') require('DarthMooMancer.plugins.blink-cmp')
require('DarthMooMancer.plugins.mini-nvim') require('DarthMooMancer.plugins.mini-nvim')
require('DarthMooMancer.plugins.vern') require('DarthMooMancer.plugins.vern')
@@ -6,6 +6,7 @@ require('mason-lspconfig').setup({
'pylsp', 'pylsp',
'cssls', 'cssls',
'superhtml', 'superhtml',
'gopls',
}, },
automatic_enable = false, automatic_enable = false,
}) })
@@ -9,7 +9,6 @@ local parsers = {
'typescript', 'typescript',
'tsx', 'tsx',
'css', 'css',
'html',
'python', 'python',
'yaml', 'yaml',
} }
+4 -16
View File
@@ -30,29 +30,17 @@
"src": "https://github.com/nvim-mini/mini.nvim.git", "src": "https://github.com/nvim-mini/mini.nvim.git",
"version": ">=0.0.0" "version": ">=0.0.0"
}, },
"neovim": {
"rev": "ff483051a47e27d84bdef47703538df1ed9f4a47",
"src": "https://github.com/rose-pine/neovim"
},
"nvim-lspconfig": { "nvim-lspconfig": {
"rev": "adfbb74472f6c231b651b650a89f414c2680fb31", "rev": "adfbb74472f6c231b651b650a89f414c2680fb31",
"src": "https://github.com/neovim/nvim-lspconfig" "src": "https://github.com/neovim/nvim-lspconfig"
}, },
"nvim-tmux-navigation": {
"rev": "4898c98702954439233fdaf764c39636681e2861",
"src": "https://github.com/alexghergh/nvim-tmux-navigation"
},
"nvim-treesitter": { "nvim-treesitter": {
"rev": "0195cd62fa89950f34c0e0d648ea7897ab85d4d3", "rev": "0195cd62fa89950f34c0e0d648ea7897ab85d4d3",
"src": "https://github.com/nvim-treesitter/nvim-treesitter" "src": "https://github.com/nvim-treesitter/nvim-treesitter"
},
"rose-pine": {
"rev": "ff483051a47e27d84bdef47703538df1ed9f4a47",
"src": "https://github.com/rose-pine/neovim"
},
"vague.nvim": {
"rev": "73f8aaa866bf3d14dd0b0ab9e48c11794c1cb7ab",
"src": "https://github.com/vague-theme/vague.nvim"
},
"vern-nvim": {
"rev": "adbd2bc0e929431cbd2b713df67866019fabfccb",
"src": "https://git.moomancer.xyz/DarthMooMancer/vern-nvim"
} }
} }
} }
-1
View File
@@ -4,7 +4,6 @@ Host *
IdentityFile ~/.ssh/id_ed25519 IdentityFile ~/.ssh/id_ed25519
Host moo Host moo
# HostName 192.168.5.16
HostName 100.78.144.113 HostName 100.78.144.113
User git User git
IdentityFile ~/.ssh/id_ed25519 # Path to your private key IdentityFile ~/.ssh/id_ed25519 # Path to your private key
-9
View File
@@ -1,9 +0,0 @@
format = """$directory$character"""
[directory]
style = "blue"
[character]
success_symbol = "[❯](purple)"
error_symbol = "[❯](red)"
vimcmd_symbol = "[❮](green)"
Submodule tmux/.config/tmux/plugins/vim-tmux-navigator deleted from e41c431a0c.
+10 -23
View File
@@ -1,46 +1,33 @@
set -g prefix C-Space set -g prefix C-Space
bind C-Space send-prefix bind C-Space send-prefix
set -g default-shell $SHELL
set -s escape-time 0 set -s escape-time 0
set -g focus-events on set -g focus-events on
set -s theme terminal set -s theme terminal
set -g set-clipboard on set -g set-clipboard on
set -g detach-on-destroy off set -g detach-on-destroy off
set -g status off
set -g default-terminal "tmux-256color" set -g default-terminal "tmux-256color"
set -ga terminal-features ',xterm-ghostty:RGB' set -as terminal-overrides ',xterm*:Tc,ghostty:RGB'
set -g base-index 1 set -g base-index 1
set -g pane-base-index 1 set -g pane-base-index 1
set -g renumber-windows on set -g renumber-windows on
set -g status off
set -g status-position top
set -g status-justify centre
set -g status-style bg=default
set -g status-left-length 40
set -g status-left "#{?client_prefix,#[fg=colour234]#[bg=colour6]#[bold] #S #[bg=default]#[nobold],#[fg=color242]#[bg=default]#S }"
set -g status-right ""
set -g window-status-separator " "
set -g window-status-format "#[fg=color242]#I:#W"
set -g window-status-current-format "#[fg=colour3 bold]#I:#W"
set -g message-style 'fg=colour3 bg=default bold' set -g message-style 'fg=colour3 bg=default bold'
bind -r v display-popup -E -w 80% -h 80% "~/.local/bin/tmux-sessionizer"
bind-key h previous-window
bind-key l next-window
bind-key z resize-pane -Z
bind-key b set-option -g status
bind -r v run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
bind -n C-S-h resize-pane -L 5 bind -n C-S-h resize-pane -L 5
bind -n C-S-j resize-pane -D 5 bind -n C-S-j resize-pane -D 5
bind -n C-S-k resize-pane -U 5 bind -n C-S-k resize-pane -U 5
bind -n C-S-l resize-pane -R 5 bind -n C-S-l resize-pane -R 5
set -g @plugin 'tmux-plugins/tpm' is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +([^ ]+/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
# set -g @plugin 'christoomey/vim-tmux-navigator'
run '$HOME/.config/tmux/plugins/tpm/tpm' bind -n C-h if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind -n C-j if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind -n C-k if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind -n C-l if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
bind I source-file ~/.config/tmux/tmux.conf \; display-message "tmux.conf reloaded!"
+56 -176
View File
@@ -1,188 +1,68 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -uo pipefail
# Ensure Homebrew and standard paths are accessible inside fzf's preview subshell
export PATH="/opt/homebrew/bin:/usr/local/bin:$HOME/.local/bin:$PATH" export PATH="/opt/homebrew/bin:/usr/local/bin:$HOME/.local/bin:$PATH"
# Tabs definition list_sessions() {
TABS=("All" "Projects" "Dotfiles" "Blank Session") tmux list-sessions -F '#{session_name}' 2>/dev/null | sed 's/^/@/'
TOTAL=${#TABS[@]} }
ACTIVE_TAB=0
# Terminal Palette Colors for the Tab Header (Ghostty palette 12 and 8) list_dirs() {
CLR_ACTIVE=$(printf '\033[1;38;5;12m') fd --type d --min-depth 1 --max-depth 2 . \
CLR_INACTIVE=$(printf '\033[38;5;8m') "$HOME/personal/Projects" "$HOME/personal/Projects_Testing" 2>/dev/null
CLR_RESET=$(printf '\033[0m') fd --type d --max-depth 1 . "$HOME/dotfiles" 2>/dev/null
fd --type d --hidden --no-ignore --max-depth 3 \
--full-path '.*/\.config/[^/]+$' "$HOME/dotfiles" 2>/dev/null
fd --type d --max-depth 1 . "$HOME/.config" 2>/dev/null
printf '%s\n' "$HOME"
}
# Dynamic Previewer (Restored exact working structure from your original script) preview='
preview_cmd=' p={}
if [ "{}" = "[Create Blank Session in ~]" ]; then case "$p" in
echo "Will spawn an empty session in ~/" @*) tmux list-windows -t "${p#@}" 2>/dev/null ;;
elif [ -d {} ]; then *) eza --tree --group-directories-first --level=2 --icons --color=always --git-ignore \
if command -v eza >/dev/null 2>&1; then -I "node_modules|build|dist|target|.cache" "$p" 2>/dev/null \
eza --tree --level=2 --icons --color=always --git-ignore -I "node_modules|build|dist|target|.cache" {} || ls -la "$p" ;;
elif command -v tree >/dev/null 2>&1; then esac
tree -C -L 2 --gitignore -I "node_modules|build|dist|target|.cache" {} '
else
ls -la --color=always {} out=$(
fi { list_sessions; list_dirs; } |
awk '!seen[$0]++' |
fzf --ansi --reverse --height=100% --border=rounded \
--prompt=' ' \
--header='enter: open ctrl-b: new blank session esc: cancel' \
--preview="$preview" --preview-window='right:55%:border-left' \
--color='hl:#7fb4ca,hl+:#7fb4ca,prompt:#7fb4ca,border:#2d3139,header:#5C6066' \
--expect=ctrl-b
)
[[ -z $out ]] && exit 0
key=$(sed -n '1p' <<<"$out")
selected=$(sed -n '2p' <<<"$out")
if [[ $key == ctrl-b || -z $selected ]]; then
idx=1
while tmux has-session -t "=blank-$idx" 2>/dev/null; do ((idx++)); done
session_name="blank-$idx"
tmux new-session -d -s "$session_name" -c "$HOME"
elif [[ $selected == @* ]]; then
session_name=${selected#@}
else else
tmux list-windows -t {} 2>/dev/null || echo "Session or path: {}" if [[ $selected == "$HOME" ]]; then
fi' session_name=home
else
get_projects() {
if command -v fd &>/dev/null; then
[ -d "$HOME/Projects" ] && fd --type d --max-depth 2 . "$HOME/Projects" 2>/dev/null | sed 's:/*$::'
[ -d "$HOME/personal/Projects" ] && fd --type d --min-depth 2 --max-depth 2 . "$HOME/personal/Projects" 2>/dev/null | sed 's:/*$::'
[ -d "$HOME/personal/Projects_Testing" ] && fd --type d --min-depth 2 --max-depth 2 . "$HOME/personal/Projects_Testing" 2>/dev/null | sed 's:/*$::'
else
if [ -d "$HOME/Projects" ]; then
find "$HOME/Projects" -mindepth 1 -maxdepth 2 \
\( -name ".git" -o -name "node_modules" -o -name "build" -o -name ".cache" \) -prune \
-o -type d -print 2>/dev/null | sed 's:/*$::'
fi
if [ -d "$HOME/personal/Projects" ]; then
find "$HOME/personal/Projects" -mindepth 2 -maxdepth 2 \
\( -name ".git" -o -name "node_modules" -o -name "build" -o -name ".cache" \) -prune \
-o -type d -print 2>/dev/null | sed 's:/*$::'
fi
if [ -d "$HOME/personal/Projects_Testing" ]; then
find "$HOME/personal/Projects_Testing" -mindepth 2 -maxdepth 2 \
\( -name ".git" -o -name "node_modules" -o -name "build" -o -name ".cache" \) -prune \
-o -type d -print 2>/dev/null | sed 's:/*$::'
fi
fi
}
get_dotfiles() {
if command -v fd &>/dev/null; then
# 1. Standard ~/.config/<app>
[ -d "$HOME/.config" ] && fd --type d --max-depth 1 . "$HOME/.config" 2>/dev/null | sed 's:/*$::'
# 2. ~/dotfiles direct packages (e.g. ~/dotfiles/nvim, ~/dotfiles/tmux)
# and stow structures (e.g. ~/dotfiles/nvim/.config/nvim or ~/dotfiles/.config/*)
if [ -d "$HOME/dotfiles" ]; then
# Top-level dotfile modules (depth 1)
fd --type d --max-depth 1 . "$HOME/dotfiles" 2>/dev/null | sed 's:/*$::'
# Unhide and drill down specifically into any .config folders inside dotfiles
fd --type d --hidden --no-ignore --max-depth 4 \
--full-path '.*/\.config/[^/]+$' "$HOME/dotfiles" 2>/dev/null | sed 's:/*$::'
fi
else
# Fallback using find
if [ -d "$HOME/.config" ]; then
find "$HOME/.config" -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sed 's:/*$::'
fi
if [ -d "$HOME/dotfiles" ]; then
# Dotfiles packages + nested .config targets up to 4 levels deep
find "$HOME/dotfiles" -mindepth 1 -maxdepth 4 \
\( -name ".git" -o -name "node_modules" -o -name ".cache" \) -prune \
-o -type d -print 2>/dev/null | grep -E '(dotfiles/[^/]+$|/\.config/[^/]+$)' | sed 's:/*$::'
fi
fi | sort -u
}
get_items_for_tab() {
local tab_idx=$1
case "$tab_idx" in
1) # Projects only
get_projects
;;
2) # Dotfiles only
get_dotfiles
;;
3) # Blank Session
echo "[Create Blank Session in ~]"
;;
*) # All: tmux sessions + projects + dotfiles + top-level home dirs
tmux list-sessions -F "#S" 2>/dev/null
get_projects
get_dotfiles
find "$HOME" -maxdepth 1 -mindepth 1 -type d ! -name "Library" 2>/dev/null | sed 's:/*$::'
;;
esac
}
render_header() {
local active=$1
local out=""
for i in "${!TABS[@]}"; do
local name="${TABS[$i]}"
if [ "$i" -eq "$active" ]; then
out+="${CLR_ACTIVE}[▶ ${name}]${CLR_RESET} "
else
out+="${CLR_INACTIVE} ${name} ${CLR_RESET} "
fi
done
printf "%s\n" "$out"
}
# ---------------------------------------------------------
# Tab Navigation Loop
# ---------------------------------------------------------
selected=""
while true; do
fzf_output=$( { render_header "$ACTIVE_TAB"; get_items_for_tab "$ACTIVE_TAB" | grep -v '^$'; } | fzf \
--ansi \
--header-lines=1 \
--expect=tab,btab \
--layout=reverse \
--border=rounded \
--margin=15 \
--padding=0 \
--height=100% \
--prompt="󱇗 " \
--color="bg:#090E13,bg+:#22262D,fg:#c5c9c7,fg+:#ffffff" \
--color="hl:#7fb4ca,hl+:#7fb4ca,prompt:#7fb4ca,pointer:#22262D" \
--color="info:#5C6066,spinner:#5C6066,header:#5C6066,border:#2d3139" \
--color="label:#7fb4ca" \
--preview="$preview_cmd" \
--preview-window="right:55%:border-left")
fzf_status=$?
# Cancelled via Escape or Ctrl-C
[[ $fzf_status -ne 0 && $fzf_status -ne 1 ]] && exit 0
key=$(echo "$fzf_output" | head -n 1)
selection=$(echo "$fzf_output" | tail -n +2)
if [ "$key" = "tab" ]; then
ACTIVE_TAB=$(( (ACTIVE_TAB + 1) % TOTAL ))
elif [ "$key" = "btab" ]; then
ACTIVE_TAB=$(( (ACTIVE_TAB - 1 + TOTAL) % TOTAL ))
else
selected="$selection"
break
fi
done
[[ -z "$selected" ]] && exit 0
# Strip trailing slash if present
selected="${selected%/}"
# ---------------------------------------------------------
# Handle Session Creation / Switching
# ---------------------------------------------------------
if [[ "$selected" == "[Create Blank Session in ~]" ]]; then
idx=1
while tmux has-session -t "=blank-$idx" 2>/dev/null; do
((idx++))
done
session_name="blank-$idx"
tmux new-session -d -s "$session_name" -c "$HOME"
elif [[ -d "$selected" ]]; then
session_name=$(basename "$selected" | tr '.: ' '_') session_name=$(basename "$selected" | tr '.: ' '_')
if ! tmux has-session -t "=$session_name" 2>/dev/null; then fi
tmux new-session -d -s "$session_name" -c "$selected" if ! tmux has-session -t "=$session_name" 2>/dev/null; then
fi tmux new-session -d -s "$session_name" -c "$selected"
else fi
session_name="$selected"
fi fi
if [[ -z "$TMUX" ]]; then if [[ -z ${TMUX:-} ]]; then
exec tmux attach-session -t "$session_name" exec tmux attach-session -t "$session_name"
else else
tmux switch-client -t "$session_name" tmux switch-client -t "$session_name"
fi fi
+188
View File
@@ -0,0 +1,188 @@
#!/usr/bin/env bash
# Ensure Homebrew and standard paths are accessible inside fzf's preview subshell
export PATH="/opt/homebrew/bin:/usr/local/bin:$HOME/.local/bin:$PATH"
# Tabs definition
TABS=("All" "Projects" "Dotfiles" "Blank Session")
TOTAL=${#TABS[@]}
ACTIVE_TAB=0
# Terminal Palette Colors for the Tab Header (Ghostty palette 12 and 8)
CLR_ACTIVE=$(printf '\033[1;38;5;12m')
CLR_INACTIVE=$(printf '\033[38;5;8m')
CLR_RESET=$(printf '\033[0m')
# Dynamic Previewer (Restored exact working structure from your original script)
preview_cmd='
if [ "{}" = "[Create Blank Session in ~]" ]; then
echo "Will spawn an empty session in ~/"
elif [ -d {} ]; then
if command -v eza >/dev/null 2>&1; then
eza --tree --level=2 --icons --color=always --git-ignore -I "node_modules|build|dist|target|.cache" {}
elif command -v tree >/dev/null 2>&1; then
tree -C -L 2 --gitignore -I "node_modules|build|dist|target|.cache" {}
else
ls -la --color=always {}
fi
else
tmux list-windows -t {} 2>/dev/null || echo "Session or path: {}"
fi'
get_projects() {
if command -v fd &>/dev/null; then
[ -d "$HOME/Projects" ] && fd --type d --max-depth 2 . "$HOME/Projects" 2>/dev/null | sed 's:/*$::'
[ -d "$HOME/personal/Projects" ] && fd --type d --min-depth 2 --max-depth 2 . "$HOME/personal/Projects" 2>/dev/null | sed 's:/*$::'
[ -d "$HOME/personal/Projects_Testing" ] && fd --type d --min-depth 2 --max-depth 2 . "$HOME/personal/Projects_Testing" 2>/dev/null | sed 's:/*$::'
else
if [ -d "$HOME/Projects" ]; then
find "$HOME/Projects" -mindepth 1 -maxdepth 2 \
\( -name ".git" -o -name "node_modules" -o -name "build" -o -name ".cache" \) -prune \
-o -type d -print 2>/dev/null | sed 's:/*$::'
fi
if [ -d "$HOME/personal/Projects" ]; then
find "$HOME/personal/Projects" -mindepth 2 -maxdepth 2 \
\( -name ".git" -o -name "node_modules" -o -name "build" -o -name ".cache" \) -prune \
-o -type d -print 2>/dev/null | sed 's:/*$::'
fi
if [ -d "$HOME/personal/Projects_Testing" ]; then
find "$HOME/personal/Projects_Testing" -mindepth 2 -maxdepth 2 \
\( -name ".git" -o -name "node_modules" -o -name "build" -o -name ".cache" \) -prune \
-o -type d -print 2>/dev/null | sed 's:/*$::'
fi
fi
}
get_dotfiles() {
if command -v fd &>/dev/null; then
# 1. Standard ~/.config/<app>
[ -d "$HOME/.config" ] && fd --type d --max-depth 1 . "$HOME/.config" 2>/dev/null | sed 's:/*$::'
# 2. ~/dotfiles direct packages (e.g. ~/dotfiles/nvim, ~/dotfiles/tmux)
# and stow structures (e.g. ~/dotfiles/nvim/.config/nvim or ~/dotfiles/.config/*)
if [ -d "$HOME/dotfiles" ]; then
# Top-level dotfile modules (depth 1)
fd --type d --max-depth 1 . "$HOME/dotfiles" 2>/dev/null | sed 's:/*$::'
# Unhide and drill down specifically into any .config folders inside dotfiles
fd --type d --hidden --no-ignore --max-depth 4 \
--full-path '.*/\.config/[^/]+$' "$HOME/dotfiles" 2>/dev/null | sed 's:/*$::'
fi
else
# Fallback using find
if [ -d "$HOME/.config" ]; then
find "$HOME/.config" -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sed 's:/*$::'
fi
if [ -d "$HOME/dotfiles" ]; then
# Dotfiles packages + nested .config targets up to 4 levels deep
find "$HOME/dotfiles" -mindepth 1 -maxdepth 4 \
\( -name ".git" -o -name "node_modules" -o -name ".cache" \) -prune \
-o -type d -print 2>/dev/null | grep -E '(dotfiles/[^/]+$|/\.config/[^/]+$)' | sed 's:/*$::'
fi
fi | sort -u
}
get_items_for_tab() {
local tab_idx=$1
case "$tab_idx" in
1) # Projects only
get_projects
;;
2) # Dotfiles only
get_dotfiles
;;
3) # Blank Session
echo "[Create Blank Session in ~]"
;;
*) # All: tmux sessions + projects + dotfiles + top-level home dirs
tmux list-sessions -F "#S" 2>/dev/null
get_projects
get_dotfiles
find "$HOME" -maxdepth 1 -mindepth 1 -type d ! -name "Library" 2>/dev/null | sed 's:/*$::'
;;
esac
}
render_header() {
local active=$1
local out=""
for i in "${!TABS[@]}"; do
local name="${TABS[$i]}"
if [ "$i" -eq "$active" ]; then
out+="${CLR_ACTIVE}[▶ ${name}]${CLR_RESET} "
else
out+="${CLR_INACTIVE} ${name} ${CLR_RESET} "
fi
done
printf "%s\n" "$out"
}
# ---------------------------------------------------------
# Tab Navigation Loop
# ---------------------------------------------------------
selected=""
while true; do
fzf_output=$( { render_header "$ACTIVE_TAB"; get_items_for_tab "$ACTIVE_TAB" | grep -v '^$'; } | fzf \
--ansi \
--header-lines=1 \
--expect=tab,btab \
--layout=reverse \
--border=rounded \
--margin=15 \
--padding=0 \
--height=100% \
--prompt="󱇗 " \
--color="bg:#090E13,bg+:#22262D,fg:#c5c9c7,fg+:#ffffff" \
--color="hl:#7fb4ca,hl+:#7fb4ca,prompt:#7fb4ca,pointer:#22262D" \
--color="info:#5C6066,spinner:#5C6066,header:#5C6066,border:#2d3139" \
--color="label:#7fb4ca" \
--preview="$preview_cmd" \
--preview-window="right:55%:border-left")
fzf_status=$?
# Cancelled via Escape or Ctrl-C
[[ $fzf_status -ne 0 && $fzf_status -ne 1 ]] && exit 0
key=$(echo "$fzf_output" | head -n 1)
selection=$(echo "$fzf_output" | tail -n +2)
if [ "$key" = "tab" ]; then
ACTIVE_TAB=$(( (ACTIVE_TAB + 1) % TOTAL ))
elif [ "$key" = "btab" ]; then
ACTIVE_TAB=$(( (ACTIVE_TAB - 1 + TOTAL) % TOTAL ))
else
selected="$selection"
break
fi
done
[[ -z "$selected" ]] && exit 0
# Strip trailing slash if present
selected="${selected%/}"
# ---------------------------------------------------------
# Handle Session Creation / Switching
# ---------------------------------------------------------
if [[ "$selected" == "[Create Blank Session in ~]" ]]; then
idx=1
while tmux has-session -t "=blank-$idx" 2>/dev/null; do
((idx++))
done
session_name="blank-$idx"
tmux new-session -d -s "$session_name" -c "$HOME"
elif [[ -d "$selected" ]]; then
session_name=$(basename "$selected" | tr '.: ' '_')
if ! tmux has-session -t "=$session_name" 2>/dev/null; then
tmux new-session -d -s "$session_name" -c "$selected"
fi
else
session_name="$selected"
fi
if [[ -z "$TMUX" ]]; then
exec tmux attach-session -t "$session_name"
else
tmux switch-client -t "$session_name"
fi
+23 -23
View File
@@ -1,46 +1,46 @@
HISTFILE=~/.zsh_history HISTFILE=~/.zsh_history
HISTSIZE=100 HISTSIZE=50000
SAVEHIST=200 SAVEHIST=50000
setopt INC_APPEND_HISTORY SHARE_HISTORY HIST_IGNORE_ALL_DUPS HIST_REDUCE_BLANKS
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" ZPLUGINS=$HOME/.local/share/zsh/plugins
[[ -d $ZPLUGINS/zsh-autosuggestions ]] ||
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions $ZPLUGINS/zsh-autosuggestions
source $ZPLUGINS/zsh-autosuggestions/zsh-autosuggestions.zsh
zinit light zsh-users/zsh-autosuggestions [[ -d $ZPLUGINS/fast-syntax-highlighting ]] ||
zinit light zdharma-continuum/fast-syntax-highlighting git clone --depth=1 https://github.com/zdharma-continuum/fast-syntax-highlighting $ZPLUGINS/fast-syntax-highlighting
zinit light junegunn/fzf source $ZPLUGINS/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
eval "$(starship init zsh)" [[ -d $ZPLUGINS/pure ]] ||
git clone --depth=1 https://github.com/sindresorhus/pure.git $ZPLUGINS/pure
fpath+=($ZPLUGINS/pure)
autoload -U promptinit; promptinit
prompt pure
source <(fzf --zsh)
eval "$(zoxide init --cmd cd zsh)" eval "$(zoxide init --cmd cd zsh)"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
export PATH="$HOME/.local/bin:$PATH"
alias cat="bat"
alias v="nvim" alias v="nvim"
alias ls="eza -a" alias ls="eza --group-directories-first -a"
# alias brew-update="brew update && brew upgrade && brew bundle --force-cleanup --zap --file=~/.Brewfile"
alias brew-update="brew update && brew upgrade && brew bundle --global --zap cleanup --force" alias brew-update="brew update && brew upgrade && brew bundle --global --zap cleanup --force"
alias cmake-update="sudo rm -rd build && cmake -S . -B build && cmake --build build" alias cmake-update="rm -rf build && cmake -S . -B build && cmake --build build"
alias oasis="ssh oasis" alias oasis="ssh oasis"
export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -l man'" export MANPAGER="sh -c 'col -bx | bat -p -l main'"
export HOMEBREW_NO_AUTO_UPDATE=1 export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_ENV_HINTS=1 export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_DISPLAY_INSTALL_TIMES=0 export HOMEBREW_DISPLAY_INSTALL_TIMES=0
export HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS=1 export HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS=1
export HOMEBREW_NO_EMOJI=1 export HOMEBREW_NO_EMOJI=1
# bun completions [ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun"
[ -s "/Users/andrew/.bun/_bun" ] && source "/Users/andrew/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH" export PATH="$BUN_INSTALL/bin:$PATH"
export PATH="/opt/homebrew/opt/ruby/bin:$PATH" export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/go/bin:$PATH" export PATH="$HOME/go/bin:$PATH"
export PATH="$HOME/go/bin/my-bin:$PATH" export PATH="$HOME/go/bin/my-bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/ruby/lib" export LDFLAGS="-L/opt/homebrew/opt/ruby/lib"
export CPPFLAGS="-I/opt/homebrew/opt/ruby/include" export CPPFLAGS="-I/opt/homebrew/opt/ruby/include"
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
export LUA_PATH="./lua/?.lua;./lua/?/init.lua;;"