How can you use Python in Vim?

前端 未结 12 1755
清酒与你
清酒与你 2020-12-07 06:43

I waste a lot of time between Vim and Python. I find it too slow to manually copy-paste from Python to Vim and vice versa. A good broken example is:

%

12条回答
  •  时光取名叫无心
    2020-12-07 07:41

    I think you't just missing the -c flag. For example:

    :.!python -c "print 'hello'"
    

    You should not that the script that you provide acts as a filter on the line selection. That is, your script can read from stdin to operate directly on the lines given (., %, ...). Anything more than the simplest tasks, however, and you'd be better off putting the python commands into a script file of its own.

提交回复
热议问题