Loading ...
Sorry, an error occurred while loading the content.

Reading in and displaying mark list

Expand Messages
  • Nathan Huesken
    Hi, I would like to read in a list of breakpoints (coming from ipython) and display marks on the corresponding lines. The format of the file is:
    Message 1 of 2 , Dec 1, 2009
    View Source
    • 0 Attachment
      Hi,

      I would like to read in a list of breakpoints (coming from ipython) and
      display marks on the corresponding lines.
      The format of the file is:

      filename:linenum
      ...

      What would be the best way to do this in gvim?

      Thanks!
      Nathan
      --
      ______________________________________
      / "Who can fathom the feminine mind?" \
      \ -Calvin "I like `em anyway" -Hobbes /
      --------------------------------------
      \ ,__,
      \ (oo)____
      (__) )\
      ||--|| *

      --
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Tom Link
      ... Do you want to set marks or display signs? If it s signs you re after, you could use e.g. the quickfixsigns[1] plugin: function! ReadList() let lines =
      Message 2 of 2 , Dec 1, 2009
      View Source
      • 0 Attachment
        > I would like to read in a list of breakpoints (coming from ipython) and
        > display marks on the corresponding lines.

        Do you want to set marks or display signs? If it's signs you're after,
        you could use e.g. the quickfixsigns[1] plugin:

        function! ReadList()
        let lines = readfile("breakpoints.txt")
        call map(lines, '{"bufnr": bufnr(matchstr(v:val, "^.\\{-}\\ze:\\d\\
        +$")), "lnum": matchstr(v:val, ":\\zs\\d\\+$"), "text": ""}')
        return lines
        endf
        sign define QFS_BP text=_ texthl=Special
        call add(g:quickfixsigns_lists, {'sign': 'QFS_BP', 'get': 'ReadList
        ()', 'event': ['BufEnter']})

        This could go e.g. into ~/vimfiles/after/plugin/quickfixsigns.vim

        Regards,
        Tom

        [1] http://www.vim.org/scripts/script.php?script_id=2584

        --
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.