From 89bc50163ea53ccdca445e63ed44f6c2c55763ab Mon Sep 17 00:00:00 2001 From: Andrew Haynes Date: Tue, 10 Mar 2026 12:09:51 -0400 Subject: [PATCH] updates --- .config/nvim/init.lua | 18 +++++++++++------- .config/tmux/tmux.conf | 29 ++++++++++++++++++++-------- .local/bin/tmux-sessionizer | 38 +++++++++++++++++++++++++++++++++++-- .zshrc | 1 + 4 files changed, 69 insertions(+), 17 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 3aff1ed..ea4cadf 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -20,7 +20,7 @@ require("lazy").setup({ { "ibhagwan/fzf-lua", dependencies = { "nvim-tree/nvim-web-devicons" } }, { "saghen/blink.cmp", version = "v1.*", opts = {} }, { - dir = "/home/andrew/personal/Projects/Lua/polydev/", + dir = "/Users/andrew/personal/Projects/Lua/polydev/", opts = { terminal = { mode = "split", @@ -92,12 +92,14 @@ vim.g.netrw_winsize = 25 vim.opt.wrapscan = true -- begin search from top of the file when nothng is found vim.opt.cursorline = true -- enable cursorline vim.opt.cursorlineopt = { "screenline", "number" } -- cursorline look -vim.opt.shortmess = -'aF' -- abbreviates messages and prevents file name being echoed when opened -vim.opt.ignorecase = true -- ignore cases when searching -vim.opt.smartcase = true -- However if we use a capital in search string we then consider case-sensitivity, ignorecase is disabled -vim.opt.smartindent = true -- smarter indentation -vim.opt.smarttab = true -- make tab behaviour smarter +vim.opt.foldmethod = "indent" +vim.opt.foldcolumn = "1" +vim.opt.foldenable = false +vim.opt.shortmess = 'aF' -- abbreviates messages and prevents file name being echoed when opened +vim.opt.ignorecase = true -- ignore cases when searching +vim.opt.smartcase = true -- However if we use a capital in search string we then consider case-sensitivity, ignorecase is disabled +vim.opt.smartindent = true -- smarter indentation +vim.opt.smarttab = true -- make tab behaviour smarter vim.opt.laststatus = 3 vim.cmd.colorscheme("tokyonight-moon") vim.lsp.enable({ "lua_ls", "clangd" }) @@ -126,3 +128,5 @@ vim.keymap.set("n", "gr", vim.lsp.buf.references) vim.keymap.set("n", "gR", vim.lsp.buf.rename) vim.keymap.set("n", "gc", vim.lsp.buf.code_action) vim.keymap.set("n", "uu", ":UndotreeToggle") +vim.keymap.set("n", "[", "H", { silent = true, noremap = true, }) +vim.keymap.set("n", "]", "K", { silent = true, noremap = true, }) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 305ded7..3fbaf61 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -1,17 +1,28 @@ -unbind C-x -set -g prefix M-, -bind M-, send-prefix +# unbind C-x +unbind M-, +set -g prefix C-Space +bind C-Space send-prefix set -g focus-events on # set -g default-terminal "screen-256color" -set -ga terminal-features ',xterm-ghostty:RGB' -set-option -g default-shell $SHELL +# set -ga terminal-features ',xterm-ghostty:RGB' +# macOS specific (Ghostty) +if-shell '[[ $(uname) == "Darwin" ]]' { + set -ga terminal-features ',xterm-ghostty:RGB' + set -as terminal-overrides ',xterm-ghostty:Tc' +} -set -g status-style 'fg=#ff757f bg=default' +# Linux specific (Foot) +if-shell '[[ $(uname) == "Linux" ]]' { + set -ga terminal-features ',foot:RGB' + set -as terminal-overrides ',foot:Tc' +} +set-option -g default-shell $SHELL +set -g status-style 'fg=#c3e88d bg=#1b1d2b' set -g status-left-length 100 set -g status-right-length 20 -set -g status-left "#[fg=#828bb8, bold] #S #[fg=#828bb8,nobold]- " -set -g status-right "#[fg=#ff757f] %m-%d-%Y #[fg=#828bb8] %H:%M" +set -g status-left "#[fg=#ffc777, bold] [#S] #[fg=#ffc777,nobold]~ " +set -g status-right "#[fg=#c3e88d] %m-%d-%Y #[fg=#ffc777] %H:%M " set -g base-index 1 set -g pane-base-index 1 @@ -21,6 +32,8 @@ set -g set-clipboard on set -s escape-time 0 set -g status-position top +bind-key h previous-window +bind-key l next-window bind -r f run-shell "tmux neww ~/.local/bin/tmux-windowizer" bind -r v run-shell "tmux neww ~/.local/bin/tmux-sessionizer" bind-key z resize-pane -Z diff --git a/.local/bin/tmux-sessionizer b/.local/bin/tmux-sessionizer index 11a4da5..5c65a45 100755 --- a/.local/bin/tmux-sessionizer +++ b/.local/bin/tmux-sessionizer @@ -1,8 +1,41 @@ #!/usr/bin/env bash -selected="${1:-$(find ~ ~/personal ~/personal/Projects ~/.config -mindepth 1 -maxdepth 2 -type d 2>/dev/null | sort -u | fzf)}" -[[ -z $selected ]] && exit 0 +# 1. Get active tmux sessions +sessions=$(tmux list-sessions -F "#S" 2>/dev/null) + +# 2. Get directories (Optimized find) +# Adjust -maxdepth to 3 or 4 if you want deeper subfolders +# dirs=$(fd . ~ ~/personal ~/personal/Projects ~/.config --min-depth 1 --max-depth 3 --type d) +dirs=$(find ~ ~/personal ~/personal/Projects ~/.config \ + -mindepth 1 -maxdepth 2 \ + \( -name ".git" -o -name "node_modules" -o -name ".cache" -o -name "Library" \) -prune \ + -o -type d -print 2>/dev/null) + +# 3. Combine them and pipe to fzf +# We use printf to ensure they appear as a clean list + +selected=$(printf "$sessions\n$dirs" | fzf \ + --layout=reverse \ + --border=rounded \ + --margin=1 \ + --padding=1 \ + --height=100% \ + --prompt="󱇗 " \ + --color="bg+:#292e42,bg:#1b1d2b,spinner:#bb9af7,hl:#7aa2f7" \ + --color="fg:#c0caf5,header:#7dcfff,info:#bb9af7,pointer:#7dcfff" \ + --color="marker:#9ece6a,fg+:#c0caf5,prompt:#bb9af7,hl+:#7aa2f7" \ + --preview '[[ -d {} ]] && ls -p --color=always {} | head -10 || tmux list-windows -t {} 2>/dev/null' \ + --preview-window="top:35%:border-bottom") +# selected=$(printf "$sessions\n$dirs" | fzf \ +# --height=100% --layout=reverse --border \ +# --prompt="󱇗 Switch to: " --pointer="󰁔" \ +# --color="bg+:#292e42,bg:#1b1d2b,spinner:#bb9af7,hl:#7aa2f7" \ +# --color="fg:#c0caf5,header:#7dcfff,info:#bb9af7,pointer:#7dcfff" \ +# --color="marker:#9ece6a,fg+:#c0caf5,prompt:#bb9af7,hl+:#7aa2f7" \ +# --preview '[[ -d {} ]] && ls -p --color=always {} || tmux list-windows -t {} 2>/dev/null' \ +# --preview-window=right:60%) +# session_name=$(basename "$selected" | tr . _) if ! tmux has-session -t "$session_name" 2>/dev/null; then @@ -14,3 +47,4 @@ if [[ -z $TMUX ]]; then else tmux switch-client -t "$session_name" fi + diff --git a/.zshrc b/.zshrc index 1fdac09..71a36ac 100644 --- a/.zshrc +++ b/.zshrc @@ -30,6 +30,7 @@ autoload -Uz _zinit export PATH="$HOME/.local/bin:$PATH" alias ls="ls -a --color" +alias vim="nvim" # alias grep="rg" # if [[ $(uname) != "Darwin" ]]; then