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

common map introducer key

Expand Messages
  • Dr. Charles E. Campbell
    ... I ve always been fond of using the key, since I use the , and ; keys, too. However, I m given to understand that many people have to mightily
    Message 1 of 9 , Aug 29, 2000
    View Source
    • 0 Attachment
      Thus saith Ralf Arens:
      > So, is this the moment to discuss "scripting guidelines" for Vim?
      >
      > E.g. one inconvenience with scripts from other people is always the
      > mapping to certain key sequences. I almost always use different
      > mappings than others (I use commands like "," and ";" and I have some
      > spare keys like "���" on my keyboard which I use for mappings).

      I've always been fond of using the "\" key, since I use the "," and ";" keys,
      too. However, I'm given to understand that many people have to mightily
      labor to get a backslash on their keyboards (must make working with dos and
      windoz a lot of fun!).

      Unless I missed one, I think the "\" is in fact the *only* ascii punctuation
      key that isn't in use.

      One way to satisfy the "," and the "\" camps is to let there be a special
      key; assume we pick some alt-key combination.

      An option would exist to map that key to whatever the user wishes. The
      special alt-key, when used in the {lhs} or {rhs} of a map, would then be
      effectively replaced by whatever the user specified.

      Presuming a bit...

      :set mapkey=\\
      alt-key: may I presume to suggest alt-m (for alternate map key). Please feel
      free to suggest otherwise, especially if it conflicts with some
      keyboard!

      Regards,
      C Campbell

      --
      Charles E Campbell, Jr, PhD _ __ __
      Goddard Space Flight Center / /_/\_\_/ /
      cec@... /_/ \/_//_/
      PGP public key: http://www.erols.com/astronaut/pgp.html/
    • Matthew Winn
      ... _ is defined, but isn t much use as a bare command. I use that for some mappings; , and ; I keep for their proper uses. -- Matthew Winn
      Message 2 of 9 , Aug 30, 2000
      View Source
      • 0 Attachment
        On Tue, Aug 29, 2000 at 03:53:17PM -0400, Dr. Charles E. Campbell wrote:
        > I've always been fond of using the "\" key, since I use the "," and ";" keys,
        > too. However, I'm given to understand that many people have to mightily
        > labor to get a backslash on their keyboards (must make working with dos and
        > windoz a lot of fun!).
        >
        > Unless I missed one, I think the "\" is in fact the *only* ascii punctuation
        > key that isn't in use.

        "_" is defined, but isn't much use as a bare command. I use that for
        some mappings; "," and ";" I keep for their proper uses.

        --
        Matthew Winn (matthew@...)
      • Alexey Marinichev
        ... I ve been using `- , that s one less key to press (no shift). It s more useful command than `_ , but I never used it anyway. Maybe because I have my
        Message 3 of 9 , Aug 30, 2000
        View Source
        • 0 Attachment
          On Wed, Aug 30, 2000 at 08:59:04AM +0100, Matthew Winn wrote:
          > On Tue, Aug 29, 2000 at 03:53:17PM -0400, Dr. Charles E. Campbell wrote:
          > > I've always been fond of using the "\" key, since I use the "," and ";" keys,
          > > too. However, I'm given to understand that many people have to mightily
          > > labor to get a backslash on their keyboards (must make working with dos and
          > > windoz a lot of fun!).
          > >
          > > Unless I missed one, I think the "\" is in fact the *only* ascii punctuation
          > > key that isn't in use.
          >
          > "_" is defined, but isn't much use as a bare command. I use that for
          > some mappings; "," and ";" I keep for their proper uses.

          I've been using `-', that's one less key to press (no shift). It's more
          useful command than `_', but I never used it anyway. Maybe because I
          have my mappings on it?..

          --Lyosha
        • Dr. Charles E. Campbell
          Hello! In looking at the two responses my original email on this got, it looks like I somehow misstated my point (which wasn t what key is good as a mapping
          Message 4 of 9 , Aug 30, 2000
          View Source
          • 0 Attachment
            Hello!

            In looking at the two responses my original email on this got, it looks
            like I somehow misstated my point (which wasn't what key is good as
            a mapping introducer).

            Rather, its how to better standardize mappings and make them generally
            useful.

            Here's the idea: assign a meta-key to be a stand-in for a map introducer
            character. Construct a user-settable option that the user can set to
            a key of his/her choice. Effectively this would act as a

            :s/meta-key/user-mapping-character-option/g

            on all maps. Thus, one could construct the map using the reserved
            meta-key (alt-m was the one I suggested), thereby allowing users
            to choose what they'd like to have for a mapping introducer. By
            making it a "g" substitution, maps could execute other maps without
            having to assume a map introducer character.

            Regards,
            C Campbell

            ---------------------------------------------------------------------
            On Tue, Aug 29, 2000 at 03:53:17PM -0400, Dr. Charles E. Campbell wrote:
            > Unless I missed one, I think the "\" is in fact the *only* ascii punctuation
            > key that isn't in use.

            On Wed, Aug 30, 2000 at 08:59:04AM +0100, Matthew Winn wrote:
            > "_" is defined, but isn't much use as a bare command. I use that for
            > some mappings; "," and ";" I keep for their proper uses.

            Thus saith Alexey Marinichev:
            > I've been using `-', that's one less key to press (no shift). It's more
            > useful command than `_', but I never used it anyway. Maybe because I
            > have my mappings on it?..

            --
            Charles E Campbell, Jr, PhD _ __ __
            Goddard Space Flight Center / /_/\_\_/ /
            cec@... /_/ \/_//_/
            PGP public key: http://www.erols.com/astronaut/pgp.html/
          • Ron Aaron
            ... I rather like this idea. I like , as my personal map lead-in , YMMV. Ron
            Message 5 of 9 , Aug 30, 2000
            View Source
            • 0 Attachment
              Dr. Charles E. Campbell <cec@...> writes:
              >Hello!

              >Here's the idea: assign a meta-key to be a stand-in for a map introducer
              >character. Construct a user-settable option that the user can set to
              >a key of his/her choice. Effectively this would act as a
              >
              >:s/meta-key/user-mapping-character-option/g
              >

              I rather like this idea. I like ',' as my 'personal map lead-in', YMMV.

              Ron
            • Bram Moolenaar
              ... Did you miss my remark about the localmapchar variable, which is used in the Vim 6.0 settings files, or is this not what you want? -- CART DRIVER: Bring
              Message 6 of 9 , Aug 30, 2000
              View Source
              • 0 Attachment
                Charles Campbell wrote:

                > In looking at the two responses my original email on this got, it looks
                > like I somehow misstated my point (which wasn't what key is good as
                > a mapping introducer).
                >
                > Rather, its how to better standardize mappings and make them generally
                > useful.
                >
                > Here's the idea: assign a meta-key to be a stand-in for a map introducer
                > character. Construct a user-settable option that the user can set to
                > a key of his/her choice. Effectively this would act as a
                >
                > :s/meta-key/user-mapping-character-option/g
                >
                > on all maps. Thus, one could construct the map using the reserved
                > meta-key (alt-m was the one I suggested), thereby allowing users
                > to choose what they'd like to have for a mapping introducer. By
                > making it a "g" substitution, maps could execute other maps without
                > having to assume a map introducer character.

                Did you miss my remark about the "localmapchar" variable, which is used in the
                Vim 6.0 settings files, or is this not what you want?

                --
                CART DRIVER: Bring out your dead!
                We follow the cart through a wretched, impoverished plague-ridden village.
                A few starved mongrels run about in the mud scavenging. In the open
                doorway of one house perhaps we jug glimpse a pair of legs dangling from
                the ceiling. In another doorway an OLD WOMAN is beating a cat against a
                wall rather like one does with a mat. The cart passes round a dead donkey
                or cow in the mud. And a MAN tied to a cart is being hammered to death by
                four NUNS with huge mallets.
                "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
                \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
              • Dr. Charles E. Campbell
                ... Admittedly I haven t used it directly, but I did read the docs on it. (by the way, there needs to be a *localmapchar* for help tags somewhere) It provides
                Message 7 of 9 , Aug 30, 2000
                View Source
                • 0 Attachment
                  Thus saith Bram Moolenaar:
                  > Did you miss my remark about the "localmapchar" variable, which is used in the
                  > Vim 6.0 settings files, or is this not what you want?

                  Admittedly I haven't used it directly, but I did read the docs on it.
                  (by the way, there needs to be a *localmapchar* for help tags somewhere)
                  It provides a user-selected user interface, but if I understand it
                  correctly, I don't think that the localmapchar-using maps can call
                  upon related maps.

                  As an example, <ttalign.vim> defines a number of maps for alignment
                  purposes; it defines \WS and \WE as "wrapper start" and "wrapper end"
                  maps which are used to begin and end most of my alignment maps.

                  The maps themselves need to access \WS and \WE. With the idea I mentioned,
                  maps using \WS and \WE would be appropriately modified to find them.

                  Regards,
                  Chip Campbell

                  --
                  Charles E Campbell, Jr, PhD _ __ __
                  Goddard Space Flight Center / /_/\_\_/ /
                  cec@... /_/ \/_//_/
                  PGP public key: http://www.erols.com/astronaut/pgp.html/
                • Bram Moolenaar
                  ... Yeah, I ll add a tag for it. ... You can use localmapchar for mappings which are internal to the script. They do take away some possibilities from the
                  Message 8 of 9 , Aug 31, 2000
                  View Source
                  • 0 Attachment
                    Charles Campbell wrote:

                    > Thus saith Bram Moolenaar:
                    > > Did you miss my remark about the "localmapchar" variable, which is used in
                    > > the Vim 6.0 settings files, or is this not what you want?
                    >
                    > Admittedly I haven't used it directly, but I did read the docs on it.
                    > (by the way, there needs to be a *localmapchar* for help tags somewhere)

                    Yeah, I'll add a tag for it.

                    > It provides a user-selected user interface, but if I understand it
                    > correctly, I don't think that the localmapchar-using maps can call
                    > upon related maps.

                    You can use "localmapchar" for mappings which are internal to the script.
                    They do take away some possibilities from the available characters after
                    "localmapchar". If you use a character that's hard to type this wouldn't be
                    too bad. You could use a key like <M-W>.

                    > As an example, <ttalign.vim> defines a number of maps for alignment
                    > purposes; it defines \WS and \WE as "wrapper start" and "wrapper end"
                    > maps which are used to begin and end most of my alignment maps.
                    >
                    > The maps themselves need to access \WS and \WE. With the idea I mentioned,
                    > maps using \WS and \WE would be appropriately modified to find them.

                    I don't see the advantage. With "localmapchar" you can do this:

                    exe "map " . localmapchar . "A " . localmapchar . "<M-W>S<align>"
                    exe "map " . localmapchar . "<M-W>S whatever"

                    Assuming "localmapchar" is a backslash, this defines the user mapping \A,
                    which does \<M-W>S and <align>. The second one is an "internal" mapping for
                    \<M-W>S.

                    One might argue that defining maps this way is clumsy. Perhaps we can
                    introduce a special key for this. <LocalMapChar> is too long, we could use
                    <Map>.

                    The the above examples would look like:

                    map <Map>A <Map><M-W>S<align>
                    map <Map><M-W>S whatever

                    I'm using <M-W> here to avoid taking away ASCII characters from the mappings
                    the user can use.

                    There is one catch: I have used "localmapchar" also to decide if a settings
                    file should add its mappings or not. Thus if you don't give "localmapchar" a
                    value, you don't get the mappings. For plugins that is not what you want,
                    there should be a default for "localmapchar" then.

                    Perhaps the best is to set a default for "localmapchar" and use something else
                    to tell if settings files should add mappings or not.

                    --
                    DENNIS: Oh, very nice. King, eh! I expect you've got a palace and fine
                    clothes and courtiers and plenty of food. And how d'you get that? By
                    exploiting the workers! By hanging on to outdated imperialist dogma
                    which perpetuates the social and economic differences in our society!
                    "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                    /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
                    \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
                  • Dr. Charles E. Campbell
                    ... That sounds like what I d like! Regards, Chip Campbell -- Charles E Campbell, Jr, PhD _ __ __ Goddard Space Flight Center /
                    Message 9 of 9 , Aug 31, 2000
                    View Source
                    • 0 Attachment
                      Thus saith Bram Moolenaar:
                      > One might argue that defining maps this way is clumsy. Perhaps we can
                      > introduce a special key for this. <LocalMapChar> is too long, we could use
                      > <Map>.

                      That sounds like what I'd like!

                      Regards,
                      Chip Campbell

                      --
                      Charles E Campbell, Jr, PhD _ __ __
                      Goddard Space Flight Center / /_/\_\_/ /
                      cec@... /_/ \/_//_/
                      PGP public key: http://www.erols.com/astronaut/pgp.html/
                    Your message has been successfully submitted and would be delivered to recipients shortly.