Skip to content

Instantly share code, notes, and snippets.

View rlychrisg's full-sized avatar

Chris G rlychrisg

View GitHub Profile
@rlychrisg
rlychrisg / smartbdelete.lua
Last active July 19, 2025 02:23
smart closing of nvim buffers, quits if current buffer is last and asks for confirmation if buffer has unsaved changes
-- this probably isn't the most efficient way of doing this
-- but i'm quite happy with it so i want to share it.
-- function to check whether current buffer is modified
local function modcheck()
local current_buf = vim.api.nvim_get_current_buf()
if vim.api.nvim_buf_get_option(current_buf, 'modified') then
return true
else
@rlychrisg
rlychrisg / tmux_panefocus.sh
Created June 25, 2025 18:37
quickly cycle between last pane across all windows of a session. also add a little flash when changing focus to a new pane.
#!/bin/bash
## about
# this does two things 1) provides a visual indicator when moving between panes
# 2) cleverly cycles between the previous pane on all windows across the session.
# NOTE this script does echo out every single tmux focus switch to a file in /tmp/
# so unless you turn your machine off every night you'll want to find some way of
# dealing with that.