How can I set a variable that only the current command line sees?
So that
:let s:one = 1 | echo s:one
prints 1
but running two commands
:let s:one = 1
:echo s:one
errors E121: Undefined variable: s:one
.
In the end I would like to remap to a command line that uses a temporary variable, without overriding or polluting any potential other user variables.
Illegal variable name: s:one
when I try the first solution. The variable should only be as persistent as the call. I'm just defining a mapping like this in my vimrcxnoremap <silent> il :<C-u>let s:one ...
gensym
?? Typically you use a unique prefix based on the plugin name or your initials or something.