feat(keybindings): add Ctrl+Alt+U to replace first command token

This commit is contained in:
2026-04-26 01:45:56 -04:00
parent 4c1e7a7eb9
commit c26db619ac
2 changed files with 17 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
if not status is-interactive
exit
end
# Ctrl+Alt+U — strip the first command token and place cursor at start to retype it
for mode in default insert
bind --mode $mode ctrl-alt-u _replace_command_token
end
+6
View File
@@ -0,0 +1,6 @@
function _replace_command_token --description 'Remove first token from commandline and place cursor at start'
set -l cmd (commandline)
set -l rest (string replace -r '^\S+\s*' '' -- $cmd)
commandline -- $rest
commandline -C 0
end