Compare commits
3 Commits
main
...
44effcd1ef
| Author | SHA1 | Date | |
|---|---|---|---|
| 44effcd1ef | |||
| b502dd8f40 | |||
| f343fdc077 |
@@ -282,6 +282,5 @@
|
||||
"editor.inlayHints.fontFamily": "Sriracha",
|
||||
"github.copilot.nextEditSuggestions.enabled": true,
|
||||
"gitlens.ai.model": "vscode",
|
||||
"gitlens.ai.vscode.model": "copilot:gpt-4.1",
|
||||
"workbench.startupEditor": "none"
|
||||
"gitlens.ai.vscode.model": "copilot:gpt-4.1"
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
complete -c dev-switch -f -a '(git worktree list --porcelain 2>/dev/null | string match "worktree *" | string replace "worktree " "" | while read -l p; basename $p; end)'
|
||||
@@ -1,52 +0,0 @@
|
||||
function __dev_repo_name
|
||||
# Use the main worktree (first entry) for consistent naming across worktrees
|
||||
set -l lines (git worktree list --porcelain | string replace -rf "^worktree " "")
|
||||
basename $lines[1]
|
||||
end
|
||||
|
||||
function __dev_create_session -a session dir
|
||||
if test -z "$dir"
|
||||
set dir (pwd)
|
||||
end
|
||||
if not tmux has-session -t "$session" 2>/dev/null
|
||||
# Unset any devbox environment variables so they can be re-sourced
|
||||
# in the new directory.
|
||||
set -l shell env
|
||||
for var in (set --names --export | string match 'DEVBOX_*')
|
||||
set -a shell -u $var
|
||||
end
|
||||
|
||||
set -a shell (command -s fish) --login
|
||||
|
||||
tmux new-session -d -s "$session" -c "$dir" -n dev $shell
|
||||
|
||||
# Ensure that new panes in this session also start with the clean environment.
|
||||
tmux set-option -t "$session" default-command (string join ' ' -- $shell)
|
||||
|
||||
set -l left (tmux display-message -t "$session:dev" -p '#{pane_id}')
|
||||
tmux split-window -h -t "$left" -c "$dir" $shell
|
||||
set -l right (tmux display-message -t "$session:dev" -p '#{pane_id}')
|
||||
tmux split-window -v -t "$right" -c "$dir" $shell
|
||||
set -l bottom_right (tmux display-message -t "$session:dev" -p '#{pane_id}')
|
||||
tmux send-keys -t "$left" 'vim' Enter
|
||||
tmux send-keys -t "$right" 'claude' Enter
|
||||
|
||||
tmux select-pane -t "$bottom_right"
|
||||
end
|
||||
end
|
||||
|
||||
function __dev_attach_session -a session
|
||||
if test -z "$TMUX"
|
||||
tmux attach-session -t "$session"
|
||||
else
|
||||
set -l current_session (tmux display-message -p '#S')
|
||||
if test "$current_session" != "$session"
|
||||
tmux switch-client -t "$session"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function __dev_wt_session_name -a repo branch
|
||||
set -l name "$repo-"(string replace -a '/' '-' -- $branch | string replace -a '\\' '-')
|
||||
string replace -a '.' '-' -- $name
|
||||
end
|
||||
@@ -7,7 +7,6 @@
|
||||
#
|
||||
|
||||
set AUTOENV_AUTH_FILE ~/.autoenv_authorized
|
||||
set AUTOENV_TRUSTED_FILE ~/.autoenv_trusted
|
||||
if [ -z "$AUTOENV_ENV_FILENAME" ]
|
||||
set AUTOENV_ENV_FILENAME ".env"
|
||||
end
|
||||
@@ -78,27 +77,6 @@ function autoenv_hashline
|
||||
echo "$envfile:$hash"
|
||||
end
|
||||
|
||||
function autoenv_content_hash
|
||||
set envfile $argv[1]
|
||||
shasum "$envfile" | cut -d' ' -f 1
|
||||
end
|
||||
|
||||
function autoenv_check_trusted
|
||||
set envfile $argv[1]
|
||||
set hash (autoenv_content_hash "$envfile")
|
||||
touch $AUTOENV_TRUSTED_FILE
|
||||
grep -Fxq "$hash" $AUTOENV_TRUSTED_FILE
|
||||
end
|
||||
|
||||
function autoenv_trust_env
|
||||
set envfile $argv[1]
|
||||
set hash (autoenv_content_hash "$envfile")
|
||||
touch $AUTOENV_TRUSTED_FILE
|
||||
if not grep -Fxq "$hash" $AUTOENV_TRUSTED_FILE
|
||||
echo "$hash" >>$AUTOENV_TRUSTED_FILE
|
||||
end
|
||||
end
|
||||
|
||||
function autoenv_check_authz
|
||||
# typeset envfile hash
|
||||
set envfile $argv[1]
|
||||
@@ -109,7 +87,7 @@ end
|
||||
|
||||
function autoenv_check_authz_and_run
|
||||
set envfile $argv[1]
|
||||
if autoenv_check_authz "$envfile"; or autoenv_check_trusted "$envfile"
|
||||
if autoenv_check_authz "$envfile"
|
||||
autoenv_source "$envfile"
|
||||
return 0
|
||||
end
|
||||
@@ -122,16 +100,11 @@ function autoenv_check_authz_and_run
|
||||
autoenv_indent "$envfile"
|
||||
autoenv_env " --- (end contents) -----------------------------------------"
|
||||
autoenv_env
|
||||
autoenv_printf "Are you sure you want to allow this? (y/t/N) \n"
|
||||
autoenv_env " y - approve for this path only"
|
||||
autoenv_env " t - trust these contents everywhere"
|
||||
autoenv_printf "Are you sure you want to allow this? (y/N) \n"
|
||||
read answer
|
||||
if [ "$answer" = y -o "$answer" = Y ]
|
||||
if [ $answer = y -o $answer = Y ]
|
||||
autoenv_authorize_env "$envfile"
|
||||
autoenv_source "$envfile"
|
||||
else if [ "$answer" = t -o "$answer" = T ]
|
||||
autoenv_trust_env "$envfile"
|
||||
autoenv_source "$envfile"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -158,7 +131,3 @@ function autoenv_source
|
||||
#set -e AUTOENV_CUR_FILE
|
||||
#set -e AUTOENV_CUR_DIR
|
||||
end
|
||||
|
||||
# Run once on shell startup so .env files are sourced in the initial
|
||||
# working directory (PWD is already set, so --on-variable PWD won't fire).
|
||||
autoenv_init
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
function dev-wt -d "Switch to a tmux dev session for a worktree, creating it if needed" -a name
|
||||
set -l repo (__dev_repo_name 2>/dev/null)
|
||||
if test -z "$repo"
|
||||
echo "Not in a git repository"
|
||||
return 1
|
||||
end
|
||||
|
||||
# Default to current branch when no argument given
|
||||
if test -z "$name"
|
||||
set name (git branch --show-current 2>/dev/null)
|
||||
if test -z "$name"
|
||||
echo "Usage: dev-wt [worktree-name]"
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
set -l wt_path ""
|
||||
set -l wt_branch ""
|
||||
|
||||
# Search for worktree by directory basename or branch name
|
||||
set -l current_path ""
|
||||
set -l current_branch ""
|
||||
for line in (git worktree list --porcelain)
|
||||
if string match -q "worktree *" -- $line
|
||||
set current_path (string replace "worktree " "" -- $line)
|
||||
set current_branch ""
|
||||
else if string match -q "branch *" -- $line
|
||||
set current_branch (string replace "branch refs/heads/" "" -- $line)
|
||||
if test (basename "$current_path") = "$name"; or test "$current_branch" = "$name"
|
||||
set wt_path $current_path
|
||||
set wt_branch $current_branch
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# If worktree not found, create it
|
||||
if test -z "$wt_path"
|
||||
set -l main_wt_path (git worktree list --porcelain | head -1 | string replace "worktree " "")
|
||||
set -l parent_dir (dirname "$main_wt_path")
|
||||
set wt_path "$parent_dir/$repo-$name"
|
||||
set wt_branch "$name"
|
||||
|
||||
if test -d "$wt_path"
|
||||
echo "Error: directory already exists: $wt_path"
|
||||
return 1
|
||||
end
|
||||
|
||||
# Create branch from main if it doesn't exist
|
||||
if not git rev-parse --verify "$wt_branch" >/dev/null 2>&1
|
||||
echo "Creating branch '$wt_branch' from main..."
|
||||
git branch "$wt_branch" main
|
||||
end
|
||||
|
||||
echo "Creating worktree at $wt_path..."
|
||||
git worktree add "$wt_path" "$wt_branch"
|
||||
|
||||
# Run repo-specific setup hook if present
|
||||
set -l setup_hook "$main_wt_path/.worktree-setup.sh"
|
||||
if test -x "$setup_hook"
|
||||
echo "Running worktree setup hook..."
|
||||
bash "$setup_hook" "$wt_path" "$main_wt_path" "$wt_branch"
|
||||
end
|
||||
end
|
||||
|
||||
if test -z "$wt_branch"
|
||||
echo "Worktree '$name' has no branch (detached HEAD)"
|
||||
return 1
|
||||
end
|
||||
|
||||
set -l session (__dev_wt_session_name $repo $wt_branch)
|
||||
__dev_create_session $session $wt_path
|
||||
__dev_attach_session $session
|
||||
end
|
||||
@@ -1,5 +0,0 @@
|
||||
function dev -d "Create and attach to a tmux dev session for the current directory"
|
||||
set -l session (basename (pwd) | string replace -a '.' '-')
|
||||
__dev_create_session $session
|
||||
__dev_attach_session $session
|
||||
end
|
||||
@@ -1,45 +0,0 @@
|
||||
function __create_session
|
||||
set session "process-compose"
|
||||
set dir "/home/tgrosinger/obsidian"
|
||||
|
||||
if not tmux has-session -t "$session" 2>/dev/null
|
||||
# Unset any devbox environment variables so they can be re-sourced
|
||||
# in the new directory.
|
||||
set -l shell env
|
||||
for var in (set --names --export | string match 'DEVBOX_*')
|
||||
set -a shell -u $var
|
||||
end
|
||||
|
||||
set -a shell (command -s fish) --login
|
||||
|
||||
tmux new-session -d -s "$session" -c "$dir" -n dev $shell
|
||||
|
||||
# Ensure that new panes in this session also start with the clean environment.
|
||||
tmux set-option -t "$session" default-command (string join ' ' -- $shell)
|
||||
|
||||
set -l left (tmux display-message -t "$session:dev" -p '#{pane_id}')
|
||||
tmux split-window -h -t "$left" -c "$dir" $shell
|
||||
set -l right (tmux display-message -t "$session:dev" -p '#{pane_id}')
|
||||
tmux send-keys -t "$left" 'devbox services attach' Enter
|
||||
|
||||
tmux select-pane -t "$right"
|
||||
end
|
||||
end
|
||||
|
||||
function __attach_session
|
||||
set session "process-compose"
|
||||
|
||||
if test -z "$TMUX"
|
||||
tmux attach-session -t "$session"
|
||||
else
|
||||
set -l current_session (tmux display-message -p '#S')
|
||||
if test "$current_session" != "$session"
|
||||
tmux switch-client -t "$session"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function pc -d "Create and attach to a tmux session for process compose in Obsidian"
|
||||
__create_session
|
||||
__attach_session
|
||||
end
|
||||
@@ -10,6 +10,3 @@ vim.g.lazyvim_prettier_needs_config = true
|
||||
|
||||
-- Use eslint for formatting.
|
||||
vim.g.lazyvim_eslint_auto_format = true
|
||||
|
||||
-- Only run prettier in directories where there is a config file.
|
||||
vim.g.lazyvim_prettier_needs_config = false
|
||||
|
||||
48
home/.config/nvim/lua/plugins/focus.lua
Normal file
48
home/.config/nvim/lua/plugins/focus.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
-- Resize window to prioritize the focused on.
|
||||
-- https://github.com/nvim-focus/focus.nvim
|
||||
return {
|
||||
"nvim-focus/focus.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
enable = true,
|
||||
ui = {
|
||||
-- Display line numbers in the focused window only.
|
||||
hybridnumber = true,
|
||||
|
||||
-- Display signcolumn in the focused window only.
|
||||
signcolumn = true,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("focus").setup({})
|
||||
|
||||
local ignore_buftypes = { "dbui", "nofile" }
|
||||
local ignore_filetypes =
|
||||
{ "dbui", "dapui_breakpoints", "dapui_stacks", "dapui_scopes", "dap_repl", "dapui_console" }
|
||||
local augroup = vim.api.nvim_create_augroup("FocusDisable", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("WinEnter", {
|
||||
group = augroup,
|
||||
callback = function(_)
|
||||
if vim.tbl_contains(ignore_buftypes, vim.bo.buftype) then
|
||||
vim.w.focus_disable = true
|
||||
else
|
||||
vim.w.focus_disable = false
|
||||
end
|
||||
end,
|
||||
desc = "Disable focus autoresize for BufType",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup,
|
||||
callback = function(_)
|
||||
if vim.tbl_contains(ignore_filetypes, vim.bo.filetype) then
|
||||
vim.b.focus_disable = true
|
||||
else
|
||||
vim.b.focus_disable = false
|
||||
end
|
||||
end,
|
||||
desc = "Disable focus autoresize for FileType",
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
return {
|
||||
-- Ensure eslint LSP is installed
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = { "eslint-lsp" },
|
||||
},
|
||||
@@ -33,40 +33,16 @@ return {
|
||||
},
|
||||
},
|
||||
|
||||
-- Format with eslint on save, or prettier if project has prettier config
|
||||
-- Format with eslint on save
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
opts = function()
|
||||
local function has_prettier_config(bufnr)
|
||||
local root = vim.fs.root(bufnr, {
|
||||
".prettierrc",
|
||||
".prettierrc.json",
|
||||
".prettierrc.js",
|
||||
".prettierrc.cjs",
|
||||
".prettierrc.yaml",
|
||||
".prettierrc.yml",
|
||||
"prettier.config.js",
|
||||
"prettier.config.cjs",
|
||||
})
|
||||
return root ~= nil
|
||||
end
|
||||
|
||||
local function js_formatters(bufnr)
|
||||
if has_prettier_config(bufnr) then
|
||||
return { "prettier" }
|
||||
end
|
||||
return { "eslint_d" }
|
||||
end
|
||||
|
||||
return {
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
javascript = js_formatters,
|
||||
javascriptreact = js_formatters,
|
||||
typescript = js_formatters,
|
||||
typescriptreact = js_formatters,
|
||||
svelte = js_formatters,
|
||||
javascript = { "eslint_d" },
|
||||
javascriptreact = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
typescriptreact = { "eslint_d" },
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -236,13 +236,6 @@ bindsym $mod+r mode "resize"
|
||||
# Capture rectangle
|
||||
bindsym $mod+Shift+s exec grim -c -g "$(slurp)" - | satty --early-exit --output-filename "/home/tgrosinger/Pictures/$(date +'%Y-%m-%dT%H:%M:%S_grim.png')" --copy-command "wl-copy" -f - && swaymsg 'mode "default"'
|
||||
|
||||
#
|
||||
# Program-specific rules
|
||||
#
|
||||
|
||||
# Possible fix for using web clipper.
|
||||
for_window [class="obsidian"] focus_on_window_activation focus
|
||||
|
||||
#
|
||||
# Theme
|
||||
#
|
||||
|
||||
@@ -8,7 +8,6 @@ echo "Installing homebrew"
|
||||
# Instead, install with npm -g.
|
||||
|
||||
brew install \
|
||||
anomalyco/tap/opencode \
|
||||
atuin \
|
||||
bat \
|
||||
btop \
|
||||
@@ -21,7 +20,6 @@ brew install \
|
||||
gh \
|
||||
git \
|
||||
git-delta \
|
||||
hmans/beans/beans \
|
||||
jq \
|
||||
lazygit \
|
||||
neovim \
|
||||
@@ -84,7 +82,6 @@ flatpak install flathub org.gimp.GIMP
|
||||
flatpak install flathub org.gimp.GIMP.Plugin.GMic
|
||||
flatpak install flathub org.musicbrainz.Picard
|
||||
flatpak install flathub fr.handbrake.ghb
|
||||
flatpak install flathub com.github.jeromerobert.pdfarranger
|
||||
|
||||
# Install devbox
|
||||
# https://www.jetify.com/docs/devbox/installing-devbox
|
||||
|
||||
Reference in New Issue
Block a user