I'm working on a small python script, which needs frequent execution in order to debug and further develop.
Can I split the vim screen and execute my script on one part with a keystroke?
|
I'm working on a small python script, which needs frequent execution in order to debug and further develop. Can I split the vim screen and execute my script on one part with a keystroke? |
||||
|
|
|
Add this line to your .vimrc:
And then you can just type ":R" while in Vim to run the script (vim-run-current-file) |
|||
|
|
|
Vim does not, and will never support an embedded shell like emacs or kate (if you mean that), see this stackoverflow question. David Spillet is right, you can run your vim inside gnu screen:
But that will only give you something remotely resembling a windowmanager in a terminal - VERY useful when used over ssh or on a box with no X, but locally you can just as well open another xterm and switch between them.* Anyway, if you can live with the fact that you won't see the file you're editing while looking at the output it produces, Jack M's tip is good, but could be shorter:
For the same purpose, I have this in my
This runs any file that has a shebang ( *(screen has some other very neat features like copy-and paste from the output, monitoring hidden windows for activity/no-activity, being able to use the session from different terminals at the same time, being able to log out leaving all programs running - it is a powerful tool). |
|||
|
|
It might not be split-screen, but this works rather well for me:
This maps |
|||
|
|
|
The least verbose way (which requires your script to be executable) is probably:
|
|||
|
|
|
There is a similar StackOverflow question. |
|||
|
|
Is what I used with please (F5 runs the current script). For turning vim into a powerful python IDE i recommend this tutorial: |
||||
|
|
|
I don't know about vim directly, but you can split the screen in this way generally with the You can split the display into more then two too, and change the size of the splits with ctrl-a,:resize . I use screen this way often, and while it isn't the single-key solution you ask for it can be very convenient. |
|||||||||
|