Today I learnt that I can use register = to print vim variables to file. However I got some trouble when trying to print a list to file.# Command mode:let L = [1, 2, 3]:echo L[1, 2, 3]# Normal mode=L<C-M>p123How could I write the value of L into current file in a [1, 2, 3] format then?
How to print a vim list to file in ['l', 'i', 's', 't'] format?
vim
In command mode::put =string(L)string(expr) function convert expr to a String. See :help string() for more details.