mirror of
https://github.com/Xevion/dotfiles.git
synced 2026-01-31 02:24:11 -06:00
refactor: replace fzf.fish modify script with Fish function wrapper
Replace Bun-based modify_ script with cleaner Fish function override that intercepts fzf_configure_bindings at load time to disable CTRL+R binding. Also fix Fisher update script to run_onchange for proper chezmoi behavior.
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
# Override fzf.fish default bindings before it loads
|
||||||
|
# This file loads before fzf.fish (alphabetically) to prevent CTRL+R binding
|
||||||
|
# We want Atuin to handle CTRL+R instead of fzf
|
||||||
|
|
||||||
|
# Store the original fzf_configure_bindings function
|
||||||
|
functions -c fzf_configure_bindings _fzf_configure_bindings_original 2>/dev/null
|
||||||
|
|
||||||
|
# Override with our version that disables history binding
|
||||||
|
function fzf_configure_bindings --wraps=_fzf_configure_bindings_original
|
||||||
|
# If called without arguments (from fzf.fish), add --history= to disable CTRL+R
|
||||||
|
if test (count $argv) -eq 0
|
||||||
|
_fzf_configure_bindings_original --history=
|
||||||
|
else
|
||||||
|
# Otherwise pass through arguments as-is
|
||||||
|
_fzf_configure_bindings_original $argv
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/usr/bin/env bun
|
|
||||||
|
|
||||||
// Modify fzf.fish to disable default CTRL+R binding (allow Atuin to handle it)
|
|
||||||
// This is a chezmoi modify_ script that processes fzf.fish on every apply
|
|
||||||
|
|
||||||
const content = await Bun.stdin.text();
|
|
||||||
const lines = content.split('\n');
|
|
||||||
|
|
||||||
// Find and comment out the standalone fzf_configure_bindings call
|
|
||||||
const targetLineRegex = /^(\s*)fzf_configure_bindings\s*$/;
|
|
||||||
|
|
||||||
const modifiedLines = lines.map(line => {
|
|
||||||
if (targetLineRegex.test(line) && !line.trim().startsWith('#')) {
|
|
||||||
const indent = line.match(/^(\s*)/)?.[1] || '';
|
|
||||||
return `${indent}# fzf_configure_bindings # Disabled - configured in config.fish instead`;
|
|
||||||
}
|
|
||||||
return line;
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(modifiedLines.join('\n'));
|
|
||||||
Reference in New Issue
Block a user