This is a plungin aimed to facilitate inserting and removing breakpoints in python script. It enables user to add/remove set_trace() to the code swiftly, and therefore be ready for pbd – The Python Debugger. Python3 support compilation in Vim is required.
Use your plugin manager of choice.
- Pathogen
git clone https://github.com/sillybun/setbreakpoints_python ~/.vim/bundle/setbreakpoints_python
- Vundle
- Add
Bundle 'https://github.com/sillybun/setbreakpoints_python'
to .vimrc - Run
:BundleInstall
- Add
- NeoBundle
- Add
NeoBundle 'https://github.com/sillybun/setbreakpoints_python'
to .vimrc - Run
:NeoBundleInstall
- Add
- vim-plug
- Add
Plug 'https://github.com/sillybun/setbreakpoints_python'
to .vimrc - Run
:PlugInstall
- Add
Add this into your .vimrc:
autocmd FileType python nnoremap <F12> :call ToggleBreakPoint()<Cr>
When you want to insert or remove a breakpoint at a certain sentence, just click F12.
- If
E319: Sorry, the command is not available in this version: python3 import sys
raised:
Please check if your vim support +python3, by :version
(within vim) or vim --version | grep python3
(Terminal). If +python3 is supported, please refer to (2), otherwise see Building Vim from source.
- +python3 is shown in version, but
:echo has('python3')
gives 0:
This means vim cannot configure python3 library successifully, you may manually compile vim with --with-python3-config-dir=$PYTHON3PATH
where $PYTHON3PATH
is the path of your python3.
For conda users, pre-compiled macvim is recommended since it may turns complicated with the dylib.