|
Server IP : 161.35.85.9 / Your IP : 216.73.217.138 Web Server : nginx/1.30.4 System : Linux cheapdeb-ams3 7.1.13+deb14-amd64 #1 SMP PREEMPT_DYNAMIC Debian 7.1.13-1 (2026-09-03) x86_64 User : root ( 0) PHP Version : 8.2.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/share/fish/functions/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
# localization: tier1
function __fish_edit_command_if_at_cursor --description 'If cursor is at the command token, edit the command source file'
set -l tokens (commandline -xpc)
set -l command
if not set -q tokens[1]
set command (commandline -xp)[1]
else if test (count $tokens) = 1 && test -z "$(commandline -t)"
set command $tokens[1]
end
set -q command[1]
or return 1
set -l command_path (command -v -- $command)
or return 1
test -r $command_path
or return 1
string match -q 'text/*' (file --brief --mime-type -L -- $command_path)
or return 1
set -l editor (__fish_anyeditor)
or return 0 # We already printed a warning, so tell the caller to finish.
$editor $command_path
return 0
end