Open michaelblyons opened 4 years ago
What exactly do you expect to be highlighted how? The !
is scoped as history already (on my local patchset).
!! # Good
echo !! # Okay as-is. We could mark `!!` like above, though.
!cmd # Pretty good
echo !cmd # Okay as-is. We could mark `!cmd` like above, though.
!?part of cmd
#^ punctuation.definition.history
# ^^^^^^^^^^^ variable.function? string?
# This is actually a string that will run a function, not the function itself,
# but "feels" like a function in terms of use.
# I usually do `!?cher` to re-run the last `git cherry-pick`, since
# `!git` will run a more recent Git command.
echo !?foo
# ^^^^^ This starts getting weird
echo "!?foo"
# ^^^^^^ And more weird. The closing `"` is part of the history command
!?part ?with end trigger
#^ punctuation.definition.history
# ^^^^^ variable.function? string?
# ^ punctuation.definition.history
echo "!?foo?"
# ^^^^^^ The second `?` fixes the inclusion of `"` in the history command
^ehco^echo
# This one is weird. In a way, the whole thing is a function, but the `^` are
# also punctuation, and the internal text are strings.
# At least this type only appears to be valid as the first character.
^ehco^echo -e^
# This is like a combination of the two above.
History commands are typically disabled in Bash scripts, but text highlighted by the syntax can be non-script. E.g. some Markdown showing sample terminal input.
...then open one of them