an Entity in Data Space: 134.155.108.49:8890
See [help if_pyth.txt]. Below is a more elaborate example. Put the following code in your vimrc: python << EOL import vim # Do not say 'from vim import *' because that # will delete builtin function eval. def EvaluateCurrentLine(*args): cur_str = vim.current.line action, symb = None, None for i in args: if i in ["r","p"]: action = i else: symb = i try: start = cur_str.rindex(symb)+len(symb) except: start = 0 result = eval(cur_str[start:],globals()) if action == "r": vim.current.line = cur_str[:start]+str(result) else: print result EOL command -narg=* PyEv python EvaluateCurrentLine()
Identifier (URI) | Rank |
---|---|
dbkwik:resource/oWxtbTqQBQpmIdUgHW_wYA== | 5.88129e-14 |