Skip to content

Prevent interference with other signs #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
f73acd9
Add and use options for definining the breakpoint sign
mvanderkamp Dec 29, 2019
a05ac23
Add documentation to README about new sign options
mvanderkamp Dec 29, 2019
a650048
Define a user-accessible command for updating breakpoints
mvanderkamp Dec 29, 2019
78a8ac3
Use a sign group to avoid interfering with other plugins
mvanderkamp Dec 29, 2019
55e5c17
Use a different sign group for each file
mvanderkamp Dec 29, 2019
0a51282
Update README with sign priority option
mvanderkamp Dec 29, 2019
cdf4f19
Update README with update command
mvanderkamp Dec 29, 2019
9e52bc1
Improve support for lazy loading
mvanderkamp Dec 30, 2019
4a0805a
Preserve conditions when toggling breakpoints
mvanderkamp Dec 30, 2019
f9ef362
Don't re-evaluate the filename
mvanderkamp Dec 30, 2019
5a5a431
Add a command to clear all breakpoints
mvanderkamp Jan 1, 2020
6042a7b
Support editing breakpoint conditions
mvanderkamp Jan 1, 2020
b27057d
BREAKING CHANGE! Rename commands, add 'PudbListBreakpoints' command
mvanderkamp Mar 2, 2020
d761589
Update README with edit and clear commands
mvanderkamp Jan 1, 2020
a40f35f
BREAKING CHANGE: Remove '[Bb]reakpoint' from the commands and options
mvanderkamp Mar 8, 2020
a388d1e
Add "which breakpoint file" problem to list of known issues
mvanderkamp Mar 8, 2020
512ba39
Add ability to load breakpoints into the quickfix list
mvanderkamp Mar 21, 2020
499985b
Use get() and vim.vars for option lookup
mvanderkamp Mar 22, 2020
79a0b25
Add help documentation, complete with tags, for use by vim's help system
mvanderkamp Mar 22, 2020
eac9811
Add location and generalized list variants of PudbQfList
mvanderkamp Mar 28, 2020
73cbfb2
Fix breakpoints loaded into QF list on an empty line
mvanderkamp Mar 30, 2020
aff5bbd
Fix inaccurate sign group default in README
mvanderkamp Mar 30, 2020
5345274
Fix signs not getting removed
mvanderkamp Mar 30, 2020
e4cf96c
Complete rename to "vim-pudb-and-jam"
mvanderkamp Jul 12, 2020
06e79e9
And vim-pudb-and-jam tag to help docs
mvanderkamp Jul 12, 2020
15c8b5c
Update README.rst
mvanderkamp Jul 13, 2020
d6be492
Update python's linecache when a python file is written
mvanderkamp Feb 7, 2021
76f25a2
Update helptags
mvanderkamp Feb 7, 2021
53874e7
Move all python code into rtp pythonx module
mvanderkamp Apr 13, 2021
c97af55
Fix incorrect text in quickfix/location lists
mvanderkamp Apr 24, 2021
6c79900
Add __pychache__ to .gitignore
mvanderkamp Apr 24, 2021
38e03d7
Rename list() -> list_breakpoints()
mvanderkamp Apr 25, 2021
4dcf061
Import checkcache directly
mvanderkamp Apr 25, 2021
c182da7
Extract a breakpoints generator
mvanderkamp Apr 25, 2021
8e8eb08
Extract a breakpoint_dict function
mvanderkamp Apr 25, 2021
5ae71bd
Extract a "current position" function
mvanderkamp Apr 25, 2021
99759c1
Extract a function for iterating breakpoints as strings
mvanderkamp Apr 25, 2021
50fc61e
Show the condition in the quickfix list
mvanderkamp Apr 25, 2021
0194ee7
Update docs
mvanderkamp Apr 25, 2021
82ca1a6
Update README to align with docs
mvanderkamp Apr 25, 2021
adb49c3
Fix typo in README
mvanderkamp Apr 25, 2021
35b7763
Use consistent naming style in python module
mvanderkamp Apr 28, 2021
3a0a680
Make better use of the vim module
mvanderkamp Apr 28, 2021
b99be99
Call setqflist to avoid conflicts with 'errorformat'
mvanderkamp Sep 23, 2021
d4671cd
Rename edit_breakpoint() -> edit_condition()
mvanderkamp Sep 23, 2021
6b475cb
Add support for moving breakpoints
mvanderkamp Sep 23, 2021
4dc70d0
Add support for editing the breakpoint file directly
mvanderkamp Sep 23, 2021
43fa1ec
Fix numbering in help ToC
mvanderkamp Sep 23, 2021
f600314
Document PudbMove
mvanderkamp Sep 23, 2021
766bb16
Document PudbEditFile
mvanderkamp Sep 23, 2021
e993f5e
Use str.format
mvanderkamp Dec 31, 2021
8aacebd
Clear old autocmds before redefining
mvanderkamp Jan 9, 2022
f929ec0
Handle missing pudb installation more gracefully
mvanderkamp Mar 21, 2022
027dfb2
Ignore the doc/tags file
Jun 28, 2022
11faaa0
Fail more gracefully if pudb not available
Jun 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tags
*.sw[op]
__pycache__
doc/tags
116 changes: 101 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,31 +1,117 @@
vim-pudb
========
vim-pudb-and-jam
================

A simple plugin allowing you to manage pudb breakpoints directly from vim.
Forked from `vim-pudb`_ and given some jammy features such as setting and
editing breakpoint conditions, customization options, improved persistence
of breakpoints, and the ability to list active breakpoints either as a
printed message or in a quickfix list.

simple plugin allowing you to manage pudb breakpoint directly into vim.
.. _vim-pudb: https://github.com/KangOl/vim-pudb

This plugin need vim to be compiled with +python

Installation
============

The recommended way of installing is to use `vim-pathogen`_
Similar to any other vim plugin, use your preferred method. If you're new, check
out
`vim-pathogen <https://github.com/tpope/vim-pathogen#readme>`_ or
`vim-plug <https://github.com/junegunn/vim-plug>`_ or
`:help packages <https://vimhelp.org/repeat.txt.html#packages>`_


Requirements
------------

This plugin needs vim to be compiled with ``+python`` or ``+python3`` as well as
``+signs`` and is intended for vim 8.2 or later, though I'm not sure exactly
which patch is the earliest that is supported.

How to use
==========
To add/remove a breakpoint, you just need to call the command ``:TogglePudbBreakPoint``
You will also need to have `pudb`_ installed, obviously.

.. _pudb: https://pypi.org/project/pudb/


Commands
========

For easy access, you can bind it to the F8 key.
``:PudbToggle``
Add / remove a breakpoint at the current line.

``:PudbEdit``
Edit the condition of a breakpoint on the current line. Creates a
breakpoint if one doesn't already exist.

``nnoremap <F8> :TogglePudbBreakPoint<CR>``
``:PudbClearAll``
Remove all breakpoints from every file.

``inoremap <F8> <ESC>:TogglePudbBreakPoint<CR>a``
``:PudbList``
Show a list of the full file paths, line numbers, and conditions of all
breakpoints.

.. _vim-pathogen: https://github.com/tpope/vim-pathogen#readme
``:PudbLocList``
Load all breakpoints into the location list. Does not jump to the first
entry.

``:PudbQfList``
Load all breakpoints into the quickfix list. Does not jump to the first
entry.

``:PudbPopulateList <arg>``
Supply a list of all breakpoints, in quickfix format, to the Ex command
given by <arg>. This is a generic form of PudbLocList and PudbQfList,
allowing you to customise the operation for any precise need you may have.

``:PudbUpdate``
Sometimes the breakpoint signs can get out of date. The above commands will
all trigger an update, but this command lets you trigger an update without
doing anything else.

NOTE: There should no longer be any need to call this command. Breakpoint
signs are updated whenever you save the buffer.


Mappings
========

Know problems
There are no mappings set up by default, so you don't have to worry about
conflicts with other plugins. Here's what I use:

::

nnoremap <leader>bc :<C-U>PudbClearAll<CR>
nnoremap <leader>be :<C-U>PudbEdit<CR>
nnoremap <leader>bl :<C-U>PudbList<CR>
nnoremap <leader>bq :<C-U>PudbQfList<CR>
nnoremap <leader>bp :<C-U>PudbToggle<CR>
nnoremap <leader>bu :<C-U>PudbUpdate<CR>


Configuration
=============
Currently, the list of breakpoints is not reloaded automatically.

There is also room for speed optimisations.
The text of the sign can be defined with ``g:pudb_sign`` (default ``'B>'``):

``let g:pudb_sign = 'B>'``

The highlight group of the sign in the sign column can be defined with
``g:pudb_highlight`` (default ``'error'``):

``let g:pudb_highlight = 'error'``

The priority of the breakpoint signs can be defined with ``g:pudb_priority``
(default ``100``):

``let g:pudb_priority = 100``

This plugin uses sign groups. You can change the name of the sign group using
``g:pudb_sign_group`` (default ``pudb_sign_group``):

``let g:pudb_sign_group = 'pudb_sign_group'``


Known problems
==============

- There may be room for speed optimisations.
- There is currently no way to specify which breakpoint file to use.
186 changes: 186 additions & 0 deletions doc/vim-pudb-and-jam.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
*vim-pudb-and-jam.txt* Manage pudb breakpoints directly from vim

Author: Michael van der Kamp
License: Same terms as vim itself (see |license|)

Forked from vim-pudb: https://github.com/KangOl/vim-pudb


==============================================================================
CONTENTS *vim-pudb-contents* *vim-pudb*
*vim-pudb-and-jam*

1. Introduction ........................... |vim-pudb-introduction|
2. Installation ........................... |vim-pudb-installation|
3. Requirements ........................... |vim-pudb-requirements|
4. Commands ............................... |vim-pudb-commands|
4.1 PudbToggle ........................ |vim-pudb-:PudbToggle|
4.2 PudbEdit .......................... |vim-pudb-:PudbEdit|
4.2 PudbMove .......................... |vim-pudb-:PudbMove|
4.3 PudbClearAll ...................... |vim-pudb-:PudbClearAll|
4.4 PudbList .......................... |vim-pudb-:PudbList|
4.5 PudbLocList ....................... |vim-pudb-:PudbLocList|
4.6 PudbQfList ........................ |vim-pudb-:PudbQfList|
4.7 PudbPopulateList .................. |vim-pudb-:PudbPopulateList|
4.8 PudbUpdate ........................ |vim-pudb-:PudbUpdate|
4.8 PudbEditFile ...................... |vim-pudb-:PudbEditFile|
5. Configuration .......................... |vim-pudb-configuration|
5.1 vim-pudb-sign ..................... |vim-pudb-sign|
5.2 vim-pudb-sign-group ............... |vim-pudb-sign-group|
5.3 vim-pudb-highlight ................ |vim-pudb-highlight|
5.4 vim-pudb-priority ................. |vim-pudb-priority|
6. Known problems ......................... |vim-pudb-known-problems|


==============================================================================
INTRODUCTION *vim-pudb-introduction*

This plugin allows you to:

* Toggle pudb breakpoints
* Edit and view pudb breakpoints
* List pudb breakpoints
* Load pudb breakpoints into the quickfix list

There are no mappings set up by default, so you don't have to worry about
conflicts with other plugins. Here are some recommended mappings though,
to add to your `.vimrc` file:
>
nnoremap <leader>bc :<C-U>PudbClearAll<CR>
nnoremap <leader>be :<C-U>PudbEdit<CR>
nnoremap <leader>bm :<C-U>PudbMove<CR>
nnoremap <leader>bl :<C-U>PudbList<CR>
nnoremap <leader>bq :<C-U>PudbQfList<CR>
nnoremap <leader>bp :<C-U>PudbToggle<CR>
nnoremap <leader>bu :<C-U>PudbUpdate<CR>
<

==============================================================================
INSTALLATION *vim-pudb-installation*

Similar to any other vim plugin, use your preferred method. If you're new,
check out:

packages: |packages|
vim-pathogen: https://github.com/tpope/vim-pathogen#readme
vim-plug: https://github.com/junegunn/vim-plug


==============================================================================
REQUIREMENTS *vim-pudb-requirements*

This plugin needs vim to be compiled with `+python` or `+python3` as well as
`+signs` and is intended for vim 8.2 or later.

You will also need to have `pudb` installed: https://pypi.org/project/pudb/


==============================================================================
COMMANDS *vim-pudb-commands*

------------------------------------------------------------------------------
*vim-pudb-:PudbToggle*
:PudbToggle
Add / remove a breakpoint at the current line.

------------------------------------------------------------------------------
*vim-pudb-:PudbEdit*
:PudbEdit
Edit the condition of a breakpoint on the current line. Creates a
breakpoint if one doesn't already exist.

------------------------------------------------------------------------------
*vim-pudb-:PudbMove*
:PudbMove
Move the location of a breakpoint on the current line.

------------------------------------------------------------------------------
*vim-pudb-:PudbClearAll*
:PudbClearAll
Remove all breakpoints from every file.

------------------------------------------------------------------------------
*vim-pudb-:PudbList*
:PudbList
Show a list of the full file paths, line numbers, and conditions of all
breakpoints.

------------------------------------------------------------------------------
*vim-pudb-:PudbLocList*
:PudbLocList
Load all breakpoints into the location list. Does not jump to the first
entry.

------------------------------------------------------------------------------
*vim-pudb-:PudbQfList*
:PudbQfList
Load all breakpoints into the quickfix list. Does not jump to the first
entry.

------------------------------------------------------------------------------
*vim-pudb-:PudbPopulateList*
:PudbPopulateList <arg>
Supply a list of all breakpoints, in quickfix format, to the Ex command
given by <arg>. This is a generic form of PudbLocList and PudbQfList,
allowing you to customise the operation for any precise need you may have.

------------------------------------------------------------------------------
*vim-pudb-:PudbUpdate*
:PudbUpdate
Sometimes the breakpoint signs can get out of date. The above commands
will all trigger an update, but this command lets you trigger an update
without doing anything else.

NOTE: There should no longer be any need to call this command. Breakpoint
signs are updated whenever you save the buffer.

------------------------------------------------------------------------------
*vim-pudb-:PudbEditFile*
:PudbEditFile
Open the breakpoint file for editing in the current window. Breakpoint
signs will not be maintained when saving direct changes to the file.


==============================================================================
CONFIGURATION *vim-pudb-configuration*

------------------------------------------------------------------------------
*vim-pudb-sign*
The text of the sign can be defined with `g:pudb_sign`:

`let g:pudb_sign = 'B>'`

Default: `'B>'`

------------------------------------------------------------------------------
*vim-pudb-sign-group*
This plugin uses sign groups. You can change the name of the sign group using
`g:pudb_sign_group`:

`let g:pudb_sign_group = 'pudb_sign_group'`

Default: `'pudb_sign_group'`

------------------------------------------------------------------------------
*vim-pudb-highlight*
The highlight group of the sign in the sign column can be defined with
`g:pudb_highlight`:

`let g:pudb_highlight = 'error'`

Default: `'error'`

------------------------------------------------------------------------------
*vim-pudb-priority*
The priority of the breakpoint signs can be defined with `g:pudb_priority`:

`let g:pudb_priority = 100`

Default: `100`


==============================================================================
KNOWN PROBLEMS *vim-pudb-known-problems*

- There may be room for speed optimisations.
- There is currently no way to specify which breakpoint file to use.
Loading