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

Re: Link to part of the same file

Expand Messages
  • 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 1 of 8 , Oct 2, 2011
      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 2 of 8 , Oct 2, 2011
        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 3 of 8 , Oct 3, 2011
          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 4 of 8 , Oct 3, 2011
            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 5 of 8 , Oct 4, 2011
              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 6 of 8 , Oct 12, 2011
                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.