Modify tmux config/setup, zsh, some nvim & skhd key mappings, etc

This commit is contained in:
2025-09-05 12:39:47 -05:00
committed by david
parent 759958b126
commit 891b605dbe
19 changed files with 107 additions and 38 deletions

View File

@@ -5,11 +5,13 @@ vim.keymap.set("n", "<leader>n", vim.cmd.Ex)
vim.keymap.set("v", "J", ":m '>+1<CR>gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv")
-- vertically center cursor with half-page jumps iterating search results
-- vertically center cursor with half-page jumps
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")
-- open folds when iterating search results
vim.keymap.set("n", "n", "nzv")
vim.keymap.set("n", "N", "Nzv")
-- maintain cursor position after paragraph formatting
vim.keymap.set("n", "=ap", "ma=ap'a")
@@ -21,6 +23,7 @@ vim.keymap.set("x", "<leader>P", [["_dP]]) -- replace selected text, keep main r
-- shortcuts for using + register (system clipboard)
vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]])
vim.keymap.set("n", "<leader>Y", [["+Y]])
vim.keymap.set("n", "<leader>D", [["+D]])
vim.keymap.set("n", "<leader>p", [["+p]])
-- search-and-replace shortcuts

View File

@@ -21,12 +21,14 @@ alt + shift - 7 : yabai -m window --space 7 --focus
alt + shift - 8 : yabai -m window --space 8 --focus
alt + shift - 9 : yabai -m window --space 9 --focus
# all windows in a space to fullscreen in a single stack
# all windows in a space to stack mode (each fullscreen)
alt + shift - s : yabai -m space --layout stack
# all windows in a space back to the grid (managed)
# all windows in a space to grid mode
alt + shift - g : yabai -m space --layout bsp
# all windows in a space to float mode
alt + shift - f : yabai -m space --layout float
# toggle float on/off for the focused window
alt + shift - f : yabai -m window --toggle float
alt + shift - F : yabai -m window --toggle float
# balance window sizes
alt + shift - 0 : yabai -m space --balance # TODO: figure out better key option

View File

@@ -0,0 +1,13 @@
local omitted_dirs=(
$HOME
$DIR_HOME_BOX
$DIR_DEV
$DIR_GIT_PROJECTS
)
[[ ! ${omitted_dirs[(re)$(pwd)]} ]] &&
tmux new-window -d -n cmd &&
tmux rename-window $EDITOR &&
$EDITOR .
clear

View File

@@ -0,0 +1,11 @@
## example template
tmux new-window -d -n cmd
tmux send-keys -t :cmd "echo 'in cmd'" c-M
tmux new-window -d -n another
tmux send-keys -t :another "echo 'in another'" c-M
tmux rename-window $EDITOR
$EDITOR .
clear

View File

@@ -0,0 +1,7 @@
tmux new-window -d -n ncspot
tmux new-window -d -n fitness
tmux send-keys -t :fitness "cd $DIR_HOME_BOX/life/fitness/audio" c-M
tmux rename-window ncmpcpp
ncmpcpp

View File

@@ -0,0 +1,8 @@
tmux rename-window drawing
tmux new-window -n thinking
tmux send-keys -t :thinking "$EDITOR $(date "+%Y%m%d")-scratch" c-M
tmux send-keys -t :drawing "cd $DIR_SCRATCH_DRAWINGS" c-M
tmux send-keys -t :drawing "gimp" c-M

View File

@@ -8,7 +8,7 @@ set -g status-style 'bg=#111111 fg=#22cc00'
set -g base-index 0
# unbind keys
unbind-key f; unbind-key C-f; unbind-key C-s
unbind-key f; unbind-key C-f; unbind-key s; unbind-key C-s
unbind-key c; unbind-key n; unbind-key p
unbind-key C-o; unbind-key C-n; unbind-key C-p; unbind-key C-l; unbind-key C-h
@@ -35,7 +35,8 @@ bind-key n new-window
# find and switching for sessions, include using tmux-session-init
bind-key C-f run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init"
bind-key C-s run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init find-existing"
# bind-key C-s run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init find-existing"
bind-key C-s choose-session
bind-key C-h run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init hub"
bind-key -r C-l switch-client -l
bind-key -r C-o last-window

View File

@@ -0,0 +1 @@
# source "$XDG_CONFIG_HOME/shell/profile" # TODO: where to put this?

View File

@@ -4,8 +4,11 @@ export EDITOR='nvim'
# env vars used for my organization structure
export DIR_HOME_BOX="$HOME/dbox"
export DIR_MUSIC="$DIR_HOME_BOX/media/music"
export DIR_DEV="$HOME/dev"
export DIR_GIT_PROJECTS="$DIR_DEV/git"
export DIR_SCRATCH_NOTES="$DIR_HOME_BOX/life/scratchpad/notes"
export DIR_SCRATCH_DRAWINGS="$DIR_HOME_BOX/life/scratchpad/drawings"
# util dirs; do not change without checking impact on xdg base dirs
export DIR_LOCAL="$HOME/.local"

View File

@@ -11,6 +11,7 @@ alias gfo='git fetch origin'
alias git-push-to-temp='git branch -D temp; git checkout -b temp; git push origin temp -uf; git checkout -'
alias gpdev='git-push-to-temp'
alias gpo='git pull origin'
git config --global user.email "$EMAIL_PERSONAL_DEV"
# code/test/linter run and build commands
alias bel='bundle exec standardrb'