XPost: comp.unix.shell
On Wed, 29 Nov 2023 12:13:09 -0000 (UTC), Kenny McCormack wrote:
Note: Normally, I would post this (only) to comp.editors, but (at least on
my server) comp.editors is destroyed by the Google spam and is unusable.
So, if you respond (post) to comp.editors (only), I won't see it. I am reading/posting only via the "shell" group.
In VIM, if you do: :echo 'this is a test' strftime('%c')
you get: this is a test Wed ...
I.e., it concats the strings together, but with a space between.
I don't think it does. You have two expressions there, a string
constant and a string function. :echo shows however many expressions
you have on the command line, separated by a space.
Is there a way to concat without the space?
Use a dot ("period" in the US):
:echo 'this is a test' . strftime('%c')
That is the concatenation operator. If you use my :echo command, it
is now one expression, and therefore no space is inserted as it was
when you had two expressions.
Note: I would normally try to look this up in the VIM help, but it is hard
to search for stuff related to the basic syntax of the language. What
would you search on?
:h expression-syntax
N.B. I'm still running Vim 7.4, so it's conceivable that "." works
differently in Vim 9, but I think it's pretty unlikely. Anyway, it's
easy to check.
--
Stan Brown, Tehachapi, California, USA
https://BrownMath.com/
Shikata ga nai...
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)