Closed flenzen closed 3 years ago
The reason is that you haven't install ipdb
install it via:
python -m pip install ipdb
Then use Variant 2
I have ipdb installed. Since my default ipython runs python3, I have ipdb installed using ˋpython3 -m pip install ipdbˋ. Still, variant 2 is not working. Do you have a clue where my fault could lie instead?
Can you check whether: python -m ipdb
works or not?
Update the plugin and check if it works.
With python2 (which is my default python), it works. Do you know how can I configure vim-repl to work with ipdb3?
I have update the plugin, you can configure it via:
let g:repl_program = {
\ 'python': 'ipython',
\ 'python-debug': 'python3 -m ipdb',
\ 'default': 'zsh',
\ 'r': 'R',
\ 'lua': 'lua',
\ 'vim': 'vim -e',
\ 'snippets': 'ipython',
\ }
In your case you can change your configuration to:
noremap <C-r> :REPLToggle<cr>
let g:repl_program = {
\ 'python': 'ipython',
\ 'python-debug': 'ipdb3',
\ 'default': 'zsh',
\ }
let g:repl_exit_commands = {
\ 'ipython': 'quit()',
\ 'python3': 'quit()'
\ }
let g:repl_python_auto_send_unfinish_line = 1
let g:repl_cursor_down = 1
let g:repl_python_automerge = 1
let g:repl_python_auto_import = 1
let g:repl_ipython_version = '7.19'
autocmd Filetype python nnoremap <F12> <Esc>:REPLDebugStopAtCurrentLine<Cr>
autocmd Filetype python nnoremap <F10> <Esc>:REPLPDBN<Cr>
autocmd Filetype python nnoremap <F11> <Esc>:REPLPDBS<Cr>
That helped, thank you very much for your quick help!
Describe the bug The readme page does not sufficiently explain how to get debugging using ipdb running. With how I understand the readme, I cannot get ipdb debugging to work.
Samples The samples are taken using the following python code:
Variant 1. The cursor is placed in line 2. I open the ipython terminal using
:REPLToggle
. I see the ipython-prompt. With the python code active, I issue:REPLDebugStopAtCurrentLine
. ipython receives the commandtbreak 2
, which fails:obviously, this code is intended for ipdb, which is installed.
Variant 2 I do the same, but without the ipython terminal open. When I issue
REPLDebugStopAtCurrentLine
, I get(more lines appearing; it should translate as something like
"ZYTREPL1 [executing]" [changed] --No lines in buffer--
.Desktop (please complete the following information): vim: 8.2 python: 3.9.0 ipython: 7.19.0 ipdb3: 0.13.7
:REPLDebugInfo
noremap :REPLToggle
let g:repl_program = {
\ 'python': 'ipython',
\ 'default': 'zsh',
\ }
let g:repl_exit_commands = {
\ 'ipython': 'quit()',
\ 'python3': 'quit()'
\ }
let g:repl_python_auto_send_unfinish_line = 1
let g:repl_cursor_down = 1
let g:repl_python_automerge = 1
let g:repl_python_auto_import = 1
let g:repl_ipython_version = '7.19'
autocmd Filetype python nnoremap :REPLDebugStopAtCurrentLine
autocmd Filetype python nnoremap :REPLPDBN
autocmd Filetype python nnoremap :REPLPDBS