Grouping stuff
This commit is contained in:
14
terminal/fish/functions/try_subst.fish
Executable file
14
terminal/fish/functions/try_subst.fish
Executable file
@@ -0,0 +1,14 @@
|
||||
function try_subst
|
||||
# Use s/word/replacement<tab> to replace word with replacement
|
||||
# in last command
|
||||
commandline | read -l saved_commandline
|
||||
|
||||
set -l pattern '^s/..*/.*$'
|
||||
|
||||
if commandline -t | grep -E -q "$pattern"
|
||||
commandline -tr (echo -n "$history[1]" | sed -e (commandline -t)/g)
|
||||
else
|
||||
commandline -f complete
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user