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

Link to part of the same file

Expand Messages
  • Fernando Basso
    What would be a good way (if possible at all) to have vim link, say, a table of contents to each section? I use vim for taking all kinds of notes and that
    Message 1 of 8 , Sep 30, 2011
      What would be a good way (if possible at all) to have vim link, say, a
      table of contents to each section? I use vim for taking all kinds of
      notes and that would be terrific.

      Thanks in advance.

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Tony Mechelynck
      ... It depends on the filetype (tables of contents are written very differently in Vim helpfiles and in HTML, and they re implicit in Wikimedia source) so you
      Message 2 of 8 , Sep 30, 2011
        On 30/09/11 19:04, Fernando Basso wrote:
        > What would be a good way (if possible at all) to have vim link, say, a
        > table of contents to each section? I use vim for taking all kinds of
        > notes and that would be terrific.
        >
        > Thanks in advance.
        >

        It depends on the filetype (tables of contents are written very
        differently in Vim helpfiles and in HTML, and they're implicit in
        Wikimedia source) so you would have to code an ad-hoc filetype-dependent
        function. Probably set it up in ~/.vim/after/ftplugin/<filetype>.vim
        (replacing <filetype> by the filetype, and, on Windows only, .vim by
        vimfiles), possibly with the bulk of the function code in some autoload
        script.

        See
        :help after-directory
        :help autoload


        Best regards,
        Tony.
        --
        hundred-and-one symptoms of being an internet addict:
        189. You put your e-mail address in the upper left-hand corner of envelopes.

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Fernando Basso
        On Sep 30, 2:17 pm, Tony Mechelynck ... I don t mean to write in vim and then convert it to html. I mean, to have links inside
        Message 3 of 8 , Oct 2 5:43 AM
          On Sep 30, 2:17 pm, Tony Mechelynck <antoine.mechely...@...>
          wrote:

          > It depends on the filetype (tables of contents are written very
          > differently in Vim helpfiles and in HTML, and they're implicit in
          > Wikimedia source) so you would have to code an ad-hoc filetype-dependent
          > function. Probably set it up in ~/.vim/after/ftplugin/<filetype>.vim
          > (replacing <filetype> by the filetype, and, on Windows only, .vim by
          > vimfiles), possibly with the bulk of the function code in some autoload
          > script.

          I don't mean to write in vim and then convert it to html. I mean, to
          have
          links inside vim buffers it self, something like vim help files.

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • lith
          ... A few thoughts: You could also use tags, I guess, and the use taglist or a similar plugin. There are a few plugins around (e.g. my own ttoc) that display
          Message 4 of 8 , Oct 2 1:28 PM
            Am Freitag, 30. September 2011 19:04:24 UTC+2 schrieb Fernando Basso:
            What would be a good way (if possible at all) to have vim link, say, a
            table of contents to each section?

            A few thoughts:

            You could also use tags, I guess, and the use taglist or a similar plugin.

            There are a few plugins around (e.g. my own ttoc) that display an overview of a buffer's structure (e.g. lines that match a certain regexp like headings) and that let users quickly jump from section to section. Similar to the example in :h definition-search, you could also use the following command:

                map <F4> :ilist! /\\section/<Bar>let nr = input('Match: ')<Bar>exe 'ijump! ' . nr .' /\\section/'<CR>

            ]], [[ let you jump between sections -- if the filetype plugin supports it.

            HTH
            Tom

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Marko Mahnič
            ... Maybe Universal Text Linking plugin can help you: http://www.vim.org/scripts/script.php?script_id=293 You have to create the TOC manually, though, but you
            Message 5 of 8 , Oct 3 12:11 AM
              On Sep 30, 7:04 pm, Fernando Basso <fernandobasso...@...> wrote:
              > What would be a good way (if possible at all) to have vim link, say, a
              > table of contents to each section? I use vim for taking all kinds of
              > notes and that would be terrific.

              Maybe Universal Text Linking plugin can help you:

              http://www.vim.org/scripts/script.php?script_id=293

              You have to create the TOC manually, though, but you could automate it
              with some scripting, maybe using the g command.

              Marko

              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Fernando Basso
              ... This plugins seems very good. I m taking a look at it. Thanks -- You received this message from the vim_use maillist. Do not top-post! Type your reply
              Message 6 of 8 , Oct 3 7:37 AM
                On Oct 3, 4:11 am, Marko Mahnič <marko.mah...@...> wrote:

                > Maybe Universal Text Linking plugin can help you:
                >
                > http://www.vim.org/scripts/script.php?script_id=293
                >
                > You have to create the TOC manually, though, but you could automate it
                > with some scripting, maybe using the g command.

                This plugins seems very good. I'm taking a look at it. Thanks

                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              • Fernando Basso
                Well, so far, what I m liking better is using vim s help syntax to have files and tags being linked around. I m been trying to use links inside plain text
                Message 7 of 8 , Oct 4 5:45 AM
                  Well, so far, what I'm liking better is using vim's help syntax
                  to have files and tags being linked around. I'm been trying
                  to use links inside plain text files because I like to jot down
                  summaries and tips I learn. I found that having a combined
                  filetype:

                  set filetype=help.txtfmt

                  is pretty much all I need. Then I save the files in:

                  ~/Summaries/doc/

                  and run :helptags ~/Summaries/doc/ when I update something.

                  This way I can access my 'reminders' from within vim and with
                  the ability to jump around my stuff.

                  To automatize that I'm trying to get the hang of this:
                  http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html

                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php
                • Erik Christiansen
                  ... I ll have to try your method; it looks good. For many years I ve made do with: a) Putting notes in separate files, so that gf provides the link. b) Using
                  Message 8 of 8 , Oct 12 7:12 AM
                    On 04.10.11 05:45, Fernando Basso wrote:
                    > Well, so far, what I'm liking better is using vim's help syntax
                    > to have files and tags being linked around. I'm been trying
                    > to use links inside plain text files because I like to jot down
                    > summaries and tips I learn. I found that having a combined
                    > filetype:

                    I'll have to try your method; it looks good. For many years I've made do
                    with:

                    a) Putting notes in separate files, so that gf provides the link.

                    b) Using folding, so that section headings become the TOC when the
                    file is folded. (My 300 page unix survival notes fold to 3 pages
                    of TOC.)

                    c) I did try some simple strings of unique text, so that * would jump
                    to the intra-file "link", but there are only 2 in 300 pages.

                    d) For "linking" of disparate occurrences of related material, I just
                    use capitalised keywords. (Often out of the way on the RHS.) Then,
                    again, * flits between conceptually related paragraphs, until I
                    bump into the one which I need.

                    I had considered using a couple of lines of awk to generate a tags file,
                    according to some convenient rules, but maybe helptags will suffice.

                    Erik

                    --
                    In a tunnel 86m long, they unearthed what is believed to be the largest
                    deposit of human excrement ever found in the Roman world. Seven hundred
                    and fifty sacks of it to be exact, containing a wealth of information.
                    - http://www.bbc.co.uk/news/world-europe-13781202

                    --
                    You received this message from the "vim_use" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php
                  Your message has been successfully submitted and would be delivered to recipients shortly.