I want Vim to remember a defined Python variable when I run it again. Is there a way?
Example:
[n] : line n on vim.
[1] a = 2
[2] b = a + 1
[3] print(b)
If I write:
:1,2w !python
and then:
:3w !python
I'd like to get the answer:
3
Instead, I'm getting:
Traceback (most recent call last):
File "< stdin >", line 1, in < module >
NameError: name 'b' is not defined
shell returned 1
:!command, which launches a fresh instance of the executable each time.