diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-11 10:52:47 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-11 10:52:47 +0300 |
| commit | 76a79294f613bc57f9b53d20693cc76517db0425 (patch) | |
| tree | fb106bf31be006d5d0f7dca5ffd3f1dffed333b9 | |
| parent | 1c4a1265cbe92f9d0fc09ebe6fcba4f7121ea666 (diff) | |
Update
| -rw-r--r-- | dotfiles/fish/conf.d/editor.fish | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/dotfiles/fish/conf.d/editor.fish b/dotfiles/fish/conf.d/editor.fish index 8ce61db..bda4644 100644 --- a/dotfiles/fish/conf.d/editor.fish +++ b/dotfiles/fish/conf.d/editor.fish @@ -15,6 +15,19 @@ function editor::helix::open_with_lock rm $lock end +function editor::helix::open_with_lock::force + set -l file $argv[1] + set -l lock "$file.lock" + if test -f "$lock" + echo "File lock $lock exists! Force deleting it and terminating all $EDITOR instances?" + rm -f $lock + pkill -f $EDITOR + end + touch $lock + hx $file $argv[2..-1] + rm $lock +end + function editor::helix::edit::remote set -l local_path $argv[1] set -l remote_uri $argv[2] @@ -25,5 +38,7 @@ end abbr -a lhx 'editor::helix::open_with_lock' abbr -a hxl 'editor::helix::open_with_lock' +abbr -a hxlf 'editor::helix::open_with_lock::force' +abbr -a lhxf 'editor::helix::open_with_lock::force' abbr -a rhx 'editor::helix::edit::remote' abbr -a x hx |
