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

Help with an abbrevation/imap

Expand Messages
  • Andrés Suárez
    Hi, I m trying to make this: word}} the }} it s an abbrevation / imap to obtain {{**word**}} and the cursor in the left of the group. In other words, if I put
    Message 1 of 8 , Nov 29, 2007
      Hi,

      I'm trying to make this:
      word}}
      the }} it's an abbrevation / imap to obtain
      {{**word**}}
      and the cursor in the left of the group. In other words, if I put }}:
      **}}<move to the start of the word>{{**<move to the end of the
      group>


      Searching, the best that I found is:
      imap }} **}}<C-Left>{{**<C-Right>
      but <C-Left> and <C-Right> doesn't work like I though ... :-S
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... Ctrl-Right moves to the end of the word (not the WORD). I bet you don t have the asterisk in iskeyword , so Ctrl-Right stops before the asterisk you added
      Message 2 of 8 , Nov 29, 2007
        Andrés Suárez wrote:
        > Hi,
        >
        > I'm trying to make this:
        > word}}
        > the }} it's an abbrevation / imap to obtain
        > {{**word**}}
        > and the cursor in the left of the group. In other words, if I put }}:
        > **}}<move to the start of the word>{{**<move to the end of the
        > group>
        >
        >
        > Searching, the best that I found is:
        > imap }} **}}<C-Left>{{**<C-Right>
        > but <C-Left> and <C-Right> doesn't work like I though ... :-S

        Ctrl-Right moves to the end of the word (not the WORD). I bet you don't have
        the asterisk in 'iskeyword', so Ctrl-Right stops before the asterisk you added
        beforehand. Or else, maybe you have other mappings which interfere.

        Try

        inoremap }} <Esc>bi{{**<Esc>ea**}}

        or even (if you don't mind clobbering the default register)

        inoremap }} <C-O>diw{{**<C-R>"**}}

        Best regards,
        Tony.
        --
        hundred-and-one symptoms of being an internet addict:
        147. You finally give up smoking...because it made the monitor dirty.

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Andrés Suárez
        Hi Tony, I m starting with vim and I don t know nothing about iskeyword and word/WORD; but I can understand the command: inoremap }} bi{{** ea**}}
        Message 3 of 8 , Nov 30, 2007
          Hi Tony,

          I'm starting with vim and I don't know nothing about 'iskeyword' and
          word/WORD; but I can understand the command:

          inoremap }} <Esc>bi{{**<Esc>ea**}}

          and works perfectly. Thank you!!!

          Regards,
          Andrés

          On 29 nov, 22:10, Tony Mechelynck <antoine.mechely...@...>
          wrote:
          > Andrés Suárez wrote:
          > > Hi,
          >
          > > I'm trying to make this:
          > > word}}
          > > the }} it's an abbrevation / imap to obtain
          > > {{**word**}}
          > > and the cursor in the left of the group. In other words, if I put }}:
          > > **}}<move to the start of the word>{{**<move to the end of the
          > > group>
          >
          > > Searching, the best that I found is:
          > > imap }} **}}<C-Left>{{**<C-Right>
          > > but <C-Left> and <C-Right> doesn't work like I though ... :-S
          >
          > Ctrl-Right moves to the end of the word (not the WORD). I bet you don't have
          > the asterisk in 'iskeyword', so Ctrl-Right stops before the asterisk you added
          > beforehand. Or else, maybe you have other mappings which interfere.
          >
          > Try
          >
          > inoremap }} <Esc>bi{{**<Esc>ea**}}
          >
          > or even (if you don't mind clobbering the default register)
          >
          > inoremap }} <C-O>diw{{**<C-R>"**}}
          >
          > Best regards,
          > Tony.
          > --
          > hundred-and-one symptoms of being an internet addict:
          > 147. You finally give up smoking...because it made the monitor dirty.
          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Tony Mechelynck
          ... [...] iskeyword is a settable option, where you define what characters are part of keywords: e.g., when selecting a single word, you may or may not,
          Message 4 of 8 , Nov 30, 2007
            Andrés Suárez wrote:
            > Hi Tony,
            >
            > I'm starting with vim and I don't know nothing about 'iskeyword' and
            > word/WORD; but I can understand the command:
            [...]

            'iskeyword' is a settable option, where you define what characters are part of
            keywords: e.g., when selecting a single word, you may or may not, depending on
            circumstances, want a slash or a dollar sign to be seen as a separator.
            Filetype-plugins usually set that option according to the conventions of this
            particular filetype's syntax.

            A word is made only of 'iskeyword' characters and stops at anything not in
            that option. A WORD stops only at a space, a hard tab, or a line break. For
            instance, if your cursor is on a URL (with no spaces in it, but with spaces,
            tabs and/or line boundaries on either side), yiw (yank inner word) yanks the
            path element under the cursor (up to, but not including, the nearest path
            separator on either side), while yiW (yank inner WORD) yanks the full URL.

            See:
            :help 'iskeyword'
            :help word
            :help WORD



            Best regards,
            Tony.
            --
            hundred-and-one symptoms of being an internet addict:
            149. You find your computer sexier than your girlfriend

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Andrés Suárez
            Wow, thanks for the explanation!. I ve to read more tutorials: the tutorials that I read, don t explain these concepts. Do you know any good tutorial? Regards,
            Message 5 of 8 , Nov 30, 2007
              Wow, thanks for the explanation!.

              I've to read more tutorials: the tutorials that I read, don't explain
              these concepts. Do you know any good tutorial?

              Regards,
              Andrés

              On 30 nov, 19:39, Tony Mechelynck <antoine.mechely...@...>
              wrote:
              > Andrés Suárez wrote:
              > > Hi Tony,
              >
              > > I'm starting with vim and I don't know nothing about 'iskeyword' and
              > > word/WORD; but I can understand the command:
              >
              > [...]
              >
              > 'iskeyword' is a settable option, where you define what characters are part of
              > keywords: e.g., when selecting a single word, you may or may not, depending on
              > circumstances, want a slash or a dollar sign to be seen as a separator.
              > Filetype-plugins usually set that option according to the conventions of this
              > particular filetype's syntax.
              >
              > A word is made only of 'iskeyword' characters and stops at anything not in
              > that option. A WORD stops only at a space, a hard tab, or a line break. For
              > instance, if your cursor is on a URL (with no spaces in it, but with spaces,
              > tabs and/or line boundaries on either side), yiw (yank inner word) yanks the
              > path element under the cursor (up to, but not including, the nearest path
              > separator on either side), while yiW (yank inner WORD) yanks the full URL.
              >
              > See:
              > :help 'iskeyword'
              > :help word
              > :help WORD
              >
              > Best regards,
              > Tony.
              > --
              > hundred-and-one symptoms of being an internet addict:
              > 149. You find your computer sexier than your girlfriend
              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Tony Mechelynck
              ... The best information source about Vim is its own help system. It has the defaults of it qualities, however: in particular, it is so complete that sometimes
              Message 6 of 8 , Nov 30, 2007
                Andrés Suárez wrote:
                > Wow, thanks for the explanation!.
                >
                > I've to read more tutorials: the tutorials that I read, don't explain
                > these concepts. Do you know any good tutorial?
                >
                > Regards,
                > Andrés

                The best information source about Vim is its own help system. It has the
                defaults of it qualities, however: in particular, it is so complete that
                sometimes it takes some work to get your "needle" out of its "haystack".
                Happily, even for that there is help:

                :help (or F1 )
                takes you to the start of the help, including general info on
                how to use Vim and its help.

                :help name
                takes you to the help about "name". For instance,
                :help :help
                shows you the help about the ":help" command.

                :help partname^D
                (where ^D means "hit Ctrl-D") shows all help subjects which
                include "partname" (which may contain wildcards). You may
                select one of them by hitting Tab repeatedly, or by typing its
                name. Or else, hit Esc to go back to Normal mode. For
                instance,
                :help :help^D
                shows you the commands ":help" ":helpfind" ":helpgrep" and
                ":helptags" (plus the abbreviated forms of the latter three).

                :help partname<Tab>
                (where <Tab> means "hit tab") gives you, if the 'wildmenu'
                option is on (which is not the default, use ":set wildmenu" to
                set it) a menu of all help subjects containing the "partname"
                (again, wildcards, if any, are expanded). Hit Enter to go to
                the help about the currently selected item, or Esc to abort.

                :helpgrep pattern
                searches the whole text of all help files for any text
                matching /pattern/ (where /pattern/ is interpreted as for a /
                search etc.) The results are presented as a quickfix list: use
                the commands
                :copen
                :cfirst
                :cnext
                :cprev
                :clast
                :cclose
                etc. to browse those results.

                From any point in the help, use
                gg
                to go to the top of the current helpfile and see its table of
                contents.

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • sc
                ... if i may add to tony s response and state the obvious, stay subscribed to this mailing list, read, and learn -- questions posed here run the gamut from
                Message 7 of 8 , Nov 30, 2007
                  On Friday 30 November 2007 14:25, Andrés Suárez wrote:
                  > Wow, thanks for the explanation!.
                  >
                  > I've to read more tutorials: the tutorials that I read,
                  > don't explain these concepts. Do you know any good
                  > tutorial?

                  if i may add to tony's response and state the obvious, stay
                  subscribed to this mailing list, read, and learn -- questions
                  posed here run the gamut from entry level to developer/sme --
                  there is always more to learn!

                  sc


                  > Regards,
                  > Andrés
                  >
                  > On 30 nov, 19:39, Tony Mechelynck
                  > <antoine.mechely...@...>
                  >
                  > wrote:
                  > > Andrés Suárez wrote:
                  > > > Hi Tony,
                  > > >
                  > > > I'm starting with vim and I don't know nothing about
                  > > > 'iskeyword' and word/WORD; but I can understand the
                  > > > command:
                  > >
                  > > [...]
                  > >
                  > > 'iskeyword' is a settable option, where you define what
                  > > characters are part of keywords: e.g., when selecting a
                  > > single word, you may or may not, depending on
                  > > circumstances, want a slash or a dollar sign to be seen
                  > > as a separator. Filetype-plugins usually set that option
                  > > according to the conventions of this particular
                  > > filetype's syntax.
                  > >
                  > > A word is made only of 'iskeyword' characters and stops
                  > > at anything not in that option. A WORD stops only at a
                  > > space, a hard tab, or a line break. For instance, if your
                  > > cursor is on a URL (with no spaces in it, but with
                  > > spaces, tabs and/or line boundaries on either side), yiw
                  > > (yank inner word) yanks the path element under the cursor
                  > > (up to, but not including, the nearest path separator on
                  > > either side), while yiW (yank inner WORD) yanks the full
                  > > URL.
                  > >
                  > > See:
                  > > :help 'iskeyword'
                  > > :help word
                  > > :help WORD
                  > >
                  > > Best regards,
                  > > Tony.
                  > > --
                  > > hundred-and-one symptoms of being an internet addict:
                  > > 149. You find your computer sexier than your girlfriend
                  >
                  >

                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_use" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Andrés Suárez
                  Ok, thank you very much for the help. :-) Regards, Andrés ... --~--~---------~--~----~------------~-------~--~----~ You received this message from the
                  Message 8 of 8 , Dec 2, 2007
                    Ok, thank you very much for the help. :-)

                    Regards,
                    Andrés

                    On 30 nov, 23:42, sc <tooth...@...> wrote:
                    > On Friday 30 November 2007 14:25, Andrés Suárez wrote:
                    >
                    > > Wow, thanks for the explanation!.
                    >
                    > > I've to read more tutorials: the tutorials that I read,
                    > > don't explain these concepts. Do you know any good
                    > > tutorial?
                    >
                    > if i may add to tony's response and state the obvious, stay
                    > subscribed to this mailing list, read, and learn -- questions
                    > posed here run the gamut from entry level to developer/sme --
                    > there is always more to learn!
                    >
                    > sc
                    >
                    > > Regards,
                    > > Andrés
                    >
                    > > On 30 nov, 19:39, Tony Mechelynck
                    > > <antoine.mechely...@...>
                    >
                    > > wrote:
                    > > > Andrés Suárez wrote:
                    > > > > Hi Tony,
                    >
                    > > > > I'm starting with vim and I don't know nothing about
                    > > > > 'iskeyword' and word/WORD; but I can understand the
                    > > > > command:
                    >
                    > > > [...]
                    >
                    > > > 'iskeyword' is a settable option, where you define what
                    > > > characters are part of keywords: e.g., when selecting a
                    > > > single word, you may or may not, depending on
                    > > > circumstances, want a slash or a dollar sign to be seen
                    > > > as a separator. Filetype-plugins usually set that option
                    > > > according to the conventions of this particular
                    > > > filetype's syntax.
                    >
                    > > > A word is made only of 'iskeyword' characters and stops
                    > > > at anything not in that option. A WORD stops only at a
                    > > > space, a hard tab, or a line break. For instance, if your
                    > > > cursor is on a URL (with no spaces in it, but with
                    > > > spaces, tabs and/or line boundaries on either side), yiw
                    > > > (yank inner word) yanks the path element under the cursor
                    > > > (up to, but not including, the nearest path separator on
                    > > > either side), while yiW (yank inner WORD) yanks the full
                    > > > URL.
                    >
                    > > > See:
                    > > > :help 'iskeyword'
                    > > > :help word
                    > > > :help WORD
                    >
                    > > > Best regards,
                    > > > Tony.
                    > > > --
                    > > > hundred-and-one symptoms of being an internet addict:
                    > > > 149. You find your computer sexier than your girlfriend
                    --~--~---------~--~----~------------~-------~--~----~
                    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.