This simple plugin add several functions to give the user various methods to execute Python code that is being edited.
- cdFileDir(): This function changes the current directory to the location of the file in the current buffer. All of the subsequent functions call this function before opening or executing code.
- PyRun(): This function asynchronously excecutes the code in the current buffer with the python compiler/interpreter.
- IdleRun(): This function asyncronously executes the code in the current buffer with IDLE (Integrated Development and Learning Environment).
- ThonnyOpen(): This function asyncronously opens the code in the current buffer in Thonny (a Python IDE for beginners).
- GUIRun(): This function asynchronously executes the code in the current buffer with the non-console python compiler/interpreter (pythonw). This is intended for use with GUI programming.
- Alt-P opens the Serpentes menu
- Once the Serpentes menu is open:
- 'd' runs cdFileDir().
- 'p' runs PyRun().
- 'i' runs IdleRun().
- 't' runs ThonnyRun().
- 'g' runs GUIRun().
Clone into your ~/.vim/pack (%USERPROFILE%\vimfiles\pack on windows) directory (create the pack directoty if it doesn't already exist).
Serpentes.vim only supports Vim 8 and later (for asynchronous execution).
Serpentes.vim currently only supports Windows as it makes use of a Windows only feature. I hope to find a way to accomplish the same thing in a cross-platform manner in the future.