12 April 2022

How to debug or test python scripts using inspect module and print and input?

At the top of your script, 
from inspect import currentframe, getframeinfo
At the spot where you want to print the value of a variable,
print(f'Line #{getframeinfo(currentframe()).lineno}:\nDescription:\n{varName}\nEnd of Description\n')
input()

05 April 2022

Is there an easier way to reselect the previous selection?

https://www.reddit.com/r/vim/comments/6v4i4u/is_there_an_easier_way_to_reselect_the_previous/

In normal mode, you can use gv to re-select the previous visual selection.

If you just want to re-issue an additional ex command over the same range, you can use * on the command line, as long as "*" isn't in your 'cpoptions' setting.

:'<,'>s/foo/bar/g
:*s/baz/bat/g
:help cpo-star
:help :*
:help v_: