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

adding text to a selection

Expand Messages
  • Rajarshi Guha
    Hi, I was wondering if would be possible to do the following: In a text file if I select a section of text with my mouse (or any other means of selecting
    Message 1 of 6 , Apr 2 3:09 PM
    • 0 Attachment
      Hi,
      I was wondering if would be possible to do the following:

      In a text file if I select a section of text with my mouse (or any other
      means of selecting sections), I would like to be able to insert a text
      string ( say something like a tag \textbf{ ) at the beginning and
      another at the end ( such as } ) of the selected region.

      Thanks,

      -------------------------------------------------------------------
      Rajarshi Guha <rxg218@...> <http://jijo.cjb.net>
      GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
      -------------------------------------------------------------------
      Breadth-first search is the bulldozer of science.
      -- Randy Goebel
    • Antoine J. Mechelynck
      ... Write a function using the marks (see :help `
      Message 2 of 6 , Apr 2 4:12 PM
      • 0 Attachment
        Rajarshi Guha <rxg218@...> wrote:
        > Hi,
        > I was wondering if would be possible to do the following:
        >
        > In a text file if I select a section of text with my mouse (or any
        > other means of selecting sections), I would like to be able to insert
        > a text string ( say something like a tag \textbf{ ) at the beginning
        > and another at the end ( such as } ) of the selected region.
        >
        > Thanks,
        >
        > -------------------------------------------------------------------
        > Rajarshi Guha <rxg218@...> <http://jijo.cjb.net>
        > GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
        > -------------------------------------------------------------------
        > Breadth-first search is the bulldozer of science.
        > -- Randy Goebel

        Write a function using the < and > marks (see ":help `<") and assign it to a
        key using ":vnoremap". It may be necessary to clear the visual area in order
        to set the marks (I'm not sure: try it).

        If the area you want to frame consists always of full lines, you may also
        write a function with the "range" argument, to set the framing text after
        line no. a:lastline, then before lino no. a:firstline. Calling such a
        function in visual-mode will by default set the range to the start and end
        of the visual area. Or you may call it in Normal mode with any valid range.

        HTH,
        Tony.
      • Alan G Isaac
        ... Do you mean something like this? vmap ;bf xc mathbf{} xP fwiw, Alan Isaac
        Message 3 of 6 , Apr 2 5:01 PM
        • 0 Attachment
          On Fri, 02 Apr 2004, Rajarshi Guha apparently wrote:
          > In a text file if I select a section of text with my mouse (or any other
          > means of selecting sections), I would like to be able to insert a text
          > string ( say something like a tag \textbf{ ) at the beginning and
          > another at the end ( such as } ) of the selected region.


          Do you mean something like this?
          vmap ;bf "xc\mathbf{}<esc>"xP

          fwiw,
          Alan Isaac
        • Rajarshi Guha
          ... thank you very much! That works perfectly ... Rajarshi Guha GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634
          Message 4 of 6 , Apr 2 5:29 PM
          • 0 Attachment
            On Fri, 2004-04-02 at 20:01, Alan G Isaac wrote:
            > On Fri, 02 Apr 2004, Rajarshi Guha apparently wrote:
            > > In a text file if I select a section of text with my mouse (or any other
            > > means of selecting sections), I would like to be able to insert a text
            > > string ( say something like a tag \textbf{ ) at the beginning and
            > > another at the end ( such as } ) of the selected region.
            >
            >
            > Do you mean something like this?
            > vmap ;bf "xc\mathbf{}<esc>"xP

            thank you very much! That works perfectly

            -------------------------------------------------------------------
            Rajarshi Guha <rxg218@...> <http://jijo.cjb.net>
            GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
            -------------------------------------------------------------------
            I'm related to people I don't relate to."
            -Calvin
          • Luc Hermitte
            Hello, ... [I missed your first post, so I answer here] You can also check - http://vim-latex.sf.net for a complete environment for editing (La)TeX documents.
            Message 5 of 6 , Apr 2 5:50 PM
            • 0 Attachment
              Hello,

              * On Fri, Apr 02, 2004 at 08:29:55PM -0500, Rajarshi Guha <rxg218@...> wrote:
              > In a text file if I select a section of text with my mouse (or any
              > other means of selecting sections), I would like to be able to
              > insert a text string ( say something like a tag \textbf{ ) at the
              > beginning and another at the end ( such as } ) of the selected
              > region.

              [I missed your first post, so I answer here]
              You can also check
              - http://vim-latex.sf.net for a complete environment for editing (La)TeX
              documents.
              - and http://hermitte.free.fr/vim/tex.php , for an alternative way to
              do this very simply [1]. However, I do not plan to maintain it at the
              moment.

              HTH,

              [1] Actually, the underlying mecanics are really complex, but adding new
              (correct) mappings and menus for the 3 modes (insert, normal and visual)
              is extremely simple and easy to maintain.

              --
              Luc Hermitte
              http://hermitte.free.fr/vim/
            • Rajarshi Guha
              ... Thanks for pointing out this link - its an amazing package!! I was wondering if anybody had the Vim package file the LaTeX ctable package (if not I ll try
              Message 6 of 6 , Apr 2 10:26 PM
              • 0 Attachment
                On Fri, 2004-04-02 at 20:50, Luc Hermitte wrote:
                > Hello,
                >
                > * On Fri, Apr 02, 2004 at 08:29:55PM -0500, Rajarshi Guha <rxg218@...> wrote:
                > > In a text file if I select a section of text with my mouse (or any
                > > other means of selecting sections), I would like to be able to
                > > insert a text string ( say something like a tag \textbf{ ) at the
                > > beginning and another at the end ( such as } ) of the selected
                > > region.
                >
                > [I missed your first post, so I answer here]
                > You can also check
                > - http://vim-latex.sf.net for a complete environment for editing (La)TeX
                > documents.

                Thanks for pointing out this link - its an amazing package!!

                I was wondering if anybody had the Vim package file the LaTeX ctable
                package (if not I'll try and put one together)

                Thanks,

                -------------------------------------------------------------------
                Rajarshi Guha <rxg218@...> <http://jijo.cjb.net>
                GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
                -------------------------------------------------------------------
                AIBOHPHOBIA - the fear of palindromes.
              Your message has been successfully submitted and would be delivered to recipients shortly.