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

RE: Mapping greater than ( ) key

Expand Messages
  • Dave Silvia
    This seems to work: Vive: normal k Results: ... normal Results: I have remapped greater than Vive: HTH: thx, Dave S. *** -----Original Message----- ***
    Message 1 of 8 , Oct 2, 2004
    View Source
    • 0 Attachment
      This seems to work:

      Vive:
      normal >k
      Results:

      Vive:
      :execute "map \> :echo 'I have remapped greater than'<CR>"
      normal >
      Results:

      I have remapped greater than

      Vive:

      HTH:

      thx,
      Dave S.

      *** -----Original Message-----
      *** From: David Nebauer [mailto:davidnebauer@...]
      *** Sent: Saturday, October 02, 2004 10:28 PM
      *** To: vim@...
      *** Subject: Mapping greater than (<gt>) key
      ***
      ***
      *** I'm trying to create the following mappings for use in editing
      *** xml files:
      ***
      *** > --> >
      *** ,> --> >
      ***
      *** What I'm running straight into is the shift-lines function of
      *** the '>' key.
      *** The mapping does not appear to intercept the keystroke before
      *** it performs the
      *** shift-lines action.
      ***
      *** I've tried the following without success:
      *** [Note: 'Standard behaviour' is the usual behaviour of the <gt> key.]
      ***
      *** inoremap > > " Standard behaviour
      *** inoremap <gt> > " Standard behaviour
      *** inoremap \> > " Standard behaviour
      *** inoremap \\> > " Standard behaviour
      ***
      *** As you can see, I'm guessing wildly with the last two attempts.
      *** Is the '>'
      *** key unmappable?
      ***
      *** I'm happy to do without the shift-lines feature while editing
      *** xml. I used the
      *** following mappings for less-than without any trouble:
      ***
      *** inoremap < <
      *** inoremap ,< <lt> || inoremap ,< < " either works
      ***
      *** I've searched the net high and low for information on this
      *** problem without any
      *** success. I'm sure it must have been solved long ago. Any help greatly
      *** appreciated.
      ***
      *** Regards,
      *** David.
    • David Nebauer
      You ve used an interesting technique. Unfortunately, I can get it to work only in normal mode -- if I type :normal at the cmdline the mapped text
      Message 2 of 8 , Oct 2, 2004
      View Source
      • 0 Attachment
        You've used an interesting technique. Unfortunately, I can get it to work
        only in 'normal' mode -- if I type ":normal >" at the cmdline the 'mapped'
        text appears on the command line.

        In 'insert' mode the usual behaviour of '>' occurs. I'm looking for a mapping
        that works in insert mode as I type.

        Thanks for your suggestion.

        Regards,
        David.

        On Sun, 3 Oct 2004 01:46 pm, Dave Silvia wrote:
        > This seems to work:
        >
        > Vive:
        > normal >k
        > Results:
        >
        > Vive:
        > :execute "map \> :echo 'I have remapped greater than'<CR>"
        >
        > normal >
        > Results:
        >
        > I have remapped greater than
        >
        > Vive:
        >
        > HTH:
        >
        > thx,
        > Dave S.
        >
        > *** -----Original Message-----
        > *** From: David Nebauer [mailto:davidnebauer@...]
        > *** Sent: Saturday, October 02, 2004 10:28 PM
        > *** To: vim@...
        > *** Subject: Mapping greater than (<gt>) key
        > ***
        > ***
        > *** I'm trying to create the following mappings for use in editing
        > *** xml files:
        > ***
        > *** > --> >
        > *** ,> --> >
        > ***
        > *** What I'm running straight into is the shift-lines function of
        > *** the '>' key.
        > *** The mapping does not appear to intercept the keystroke before
        > *** it performs the
        > *** shift-lines action.
        > ***
        > *** I've tried the following without success:
        > *** [Note: 'Standard behaviour' is the usual behaviour of the <gt> key.]
        > ***
        > *** inoremap > > " Standard behaviour
        > *** inoremap <gt> > " Standard behaviour
        > *** inoremap \> > " Standard behaviour
        > *** inoremap \\> > " Standard behaviour
        > ***
        > *** As you can see, I'm guessing wildly with the last two attempts.
        > *** Is the '>'
        > *** key unmappable?
        > ***
        > *** I'm happy to do without the shift-lines feature while editing
        > *** xml. I used the
        > *** following mappings for less-than without any trouble:
        > ***
        > *** inoremap < <
        > *** inoremap ,< <lt> || inoremap ,< < " either works
        > ***
        > *** I've searched the net high and low for information on this
        > *** problem without any
        > *** success. I'm sure it must have been solved long ago. Any help greatly
        > *** appreciated.
        > ***
        > *** Regards,
        > *** David.

        --
        Regards,
        David

        -------------------------------------------
        Email: david@...
        Phone: +61 (0) 401 029 885
      • Dave Silvia
        I guess I don t see what you re trying to do. What does the > do? Just place text? If I do ... It successfully maps and outputs > Can you give
        Message 3 of 8 , Oct 2, 2004
        View Source
        • 0 Attachment
          I guess I don't see what you're trying to do. What does the '>' do? Just
          place text? If I do

          :execute "inoremap \> ><CR>"

          It successfully maps '>' and outputs '>'

          Can you give an example that is independent enough for others to work with?
          Something that doesn't work like you'd like it to, what exactly you expected
          to see, and how it can be reproduced independent of your xml.

          I'm kinda old school. I'm used to 'give me the input, the expected output
          and let me see what I can come up with'. :-)

          thx,
          Dave S.

          *** -----Original Message-----
          *** From: David Nebauer [mailto:davidnebauer@...]
          *** Sent: Sunday, October 03, 2004 12:39 AM
          *** To: Dave Silvia
          *** Cc: vim@...
          *** Subject: Re: Mapping greater than (<gt>) key
          ***
          ***
          *** You've used an interesting technique. Unfortunately, I can get
          *** it to work
          *** only in 'normal' mode -- if I type ":normal >" at the cmdline
          *** the 'mapped'
          *** text appears on the command line.
          ***
          *** In 'insert' mode the usual behaviour of '>' occurs. I'm
          *** looking for a mapping
          *** that works in insert mode as I type.
          ***
          *** Thanks for your suggestion.
          ***
          *** Regards,
          *** David.
          ***
          *** On Sun, 3 Oct 2004 01:46 pm, Dave Silvia wrote:
          *** > This seems to work:
          *** >
          *** > Vive:
          *** > normal >k
          *** > Results:
          *** >
          *** > Vive:
          *** > :execute "map \> :echo 'I have remapped greater than'<CR>"
          *** >
          *** > normal >
          *** > Results:
          *** >
          *** > I have remapped greater than
          *** >
          *** > Vive:
          *** >
          *** > HTH:
          *** >
          *** > thx,
          *** > Dave S.
          *** >
          *** > *** -----Original Message-----
          *** > *** From: David Nebauer [mailto:davidnebauer@...]
          *** > *** Sent: Saturday, October 02, 2004 10:28 PM
          *** > *** To: vim@...
          *** > *** Subject: Mapping greater than (<gt>) key
          *** > ***
          *** > ***
          *** > *** I'm trying to create the following mappings for use in editing
          *** > *** xml files:
          *** > ***
          *** > *** > --> >
          *** > *** ,> --> >
          *** > ***
          *** > *** What I'm running straight into is the shift-lines function of
          *** > *** the '>' key.
          *** > *** The mapping does not appear to intercept the keystroke before
          *** > *** it performs the
          *** > *** shift-lines action.
          *** > ***
          *** > *** I've tried the following without success:
          *** > *** [Note: 'Standard behaviour' is the usual behaviour of the
          *** <gt> key.]
          *** > ***
          *** > *** inoremap > > " Standard behaviour
          *** > *** inoremap <gt> > " Standard behaviour
          *** > *** inoremap \> > " Standard behaviour
          *** > *** inoremap \\> > " Standard behaviour
          *** > ***
          *** > *** As you can see, I'm guessing wildly with the last two attempts.
          *** > *** Is the '>'
          *** > *** key unmappable?
          *** > ***
          *** > *** I'm happy to do without the shift-lines feature while editing
          *** > *** xml. I used the
          *** > *** following mappings for less-than without any trouble:
          *** > ***
          *** > *** inoremap < <
          *** > *** inoremap ,< <lt> || inoremap ,< < " either works
          *** > ***
          *** > *** I've searched the net high and low for information on this
          *** > *** problem without any
          *** > *** success. I'm sure it must have been solved long ago.
          *** Any help greatly
          *** > *** appreciated.
          *** > ***
          *** > *** Regards,
          *** > *** David.
          ***
          *** --
          *** Regards,
          *** David
          ***
          *** -------------------------------------------
          *** Email: david@...
          *** Phone: +61 (0) 401 029 885
        • Dave Silvia
          I did the mappings you have below in a .vim file and sourced it. I then executed the mappings in that file in insert mode. I ve attached the file. What am I
          Message 4 of 8 , Oct 2, 2004
          View Source
          • 0 Attachment
            I did the mappings you have below in a .vim file and sourced it. I then
            executed the mappings in that file in insert mode. I've attached the file.
            What am I missing? I'm really curious!;)

            thx,
            Dave S.

            *** -----Original Message-----
            *** From: David Nebauer [mailto:davidnebauer@...]
            *** Sent: Sunday, October 03, 2004 12:39 AM
            *** To: Dave Silvia
            *** Cc: vim@...
            *** Subject: Re: Mapping greater than (<gt>) key
            ***
            ***
            *** You've used an interesting technique. Unfortunately, I can get
            *** it to work
            *** only in 'normal' mode -- if I type ":normal >" at the cmdline
            *** the 'mapped'
            *** text appears on the command line.
            ***
            *** In 'insert' mode the usual behaviour of '>' occurs. I'm
            *** looking for a mapping
            *** that works in insert mode as I type.
            ***
            *** Thanks for your suggestion.
            ***
            *** Regards,
            *** David.
            ***
            *** On Sun, 3 Oct 2004 01:46 pm, Dave Silvia wrote:
            *** > This seems to work:
            *** >
            *** > Vive:
            *** > normal >k
            *** > Results:
            *** >
            *** > Vive:
            *** > :execute "map \> :echo 'I have remapped greater than'<CR>"
            *** >
            *** > normal >
            *** > Results:
            *** >
            *** > I have remapped greater than
            *** >
            *** > Vive:
            *** >
            *** > HTH:
            *** >
            *** > thx,
            *** > Dave S.
            *** >
            *** > *** -----Original Message-----
            *** > *** From: David Nebauer [mailto:davidnebauer@...]
            *** > *** Sent: Saturday, October 02, 2004 10:28 PM
            *** > *** To: vim@...
            *** > *** Subject: Mapping greater than (<gt>) key
            *** > ***
            *** > ***
            *** > *** I'm trying to create the following mappings for use in editing
            *** > *** xml files:
            *** > ***
            *** > *** > --> >
            *** > *** ,> --> >
            *** > ***
            *** > *** What I'm running straight into is the shift-lines function of
            *** > *** the '>' key.
            *** > *** The mapping does not appear to intercept the keystroke before
            *** > *** it performs the
            *** > *** shift-lines action.
            *** > ***
            *** > *** I've tried the following without success:
            *** > *** [Note: 'Standard behaviour' is the usual behaviour of the
            *** <gt> key.]
            *** > ***
            *** > *** inoremap > > " Standard behaviour
            *** > *** inoremap <gt> > " Standard behaviour
            *** > *** inoremap \> > " Standard behaviour
            *** > *** inoremap \\> > " Standard behaviour
            *** > ***
            *** > *** As you can see, I'm guessing wildly with the last two attempts.
            *** > *** Is the '>'
            *** > *** key unmappable?
            *** > ***
            *** > *** I'm happy to do without the shift-lines feature while editing
            *** > *** xml. I used the
            *** > *** following mappings for less-than without any trouble:
            *** > ***
            *** > *** inoremap < <
            *** > *** inoremap ,< <lt> || inoremap ,< < " either works
            *** > ***
            *** > *** I've searched the net high and low for information on this
            *** > *** problem without any
            *** > *** success. I'm sure it must have been solved long ago.
            *** Any help greatly
            *** > *** appreciated.
            *** > ***
            *** > *** Regards,
            *** > *** David.
            ***
            *** --
            *** Regards,
            *** David
            ***
            *** -------------------------------------------
            *** Email: david@...
            *** Phone: +61 (0) 401 029 885
          • Dave Silvia
            That s good to hear!) It proves neither one of us is crazy!;) thx, Dave S. *** -----Original Message----- *** From: David Nebauer
            Message 5 of 8 , Oct 3, 2004
            View Source
            • 0 Attachment
              That's good to hear!) It proves neither one of us is crazy!;)

              thx,
              Dave S.

              *** -----Original Message-----
              *** From: David Nebauer [mailto:davidnebauer@...]
              *** Sent: Sunday, October 03, 2004 2:00 AM
              *** To: Dave Silvia
              *** Cc: vim@...
              *** Subject: Re: Mapping greater than (<gt>) key
              ***
              ***
              *** Dave Silvia wrote:
              ***
              *** >I guess I don't see what you're trying to do. What does the
              *** '>' do? Just
              *** >place text? If I do
              *** >
              *** > :execute "inoremap \> ><CR>"
              *** >
              *** >It successfully maps '>' and outputs '>'
              *** >
              *** >Can you give an example that is independent enough for others
              *** to work with?
              *** >Something that doesn't work like you'd like it to, what
              *** exactly you expected
              *** >to see, and how it can be reproduced independent of your xml.
              *** >
              *** >I'm kinda old school. I'm used to 'give me the input, the
              *** expected output
              *** >and let me see what I can come up with'. :-)
              *** >
              ***
              *** Sorry if my thinking on this has been muddled. The mapping produced
              *** bizarre results in my xml files. However, I just tried the following
              *** mapping
              ***
              *** inoremap > >
              ***
              *** in a non-xml file where it worked perfectly.
              ***
              *** After further investigation I've isolated the problem to Devin Weaver's
              *** xmledit ftplugin ('xml.vim'). This plugin uses the '>' character to
              *** autoinsert closing tags (and several other features). It was this and
              *** not the shift-lines behaviour I was seeing. The mapping does not take
              *** effect in my xml files because of the xml ftplugin. As is usual in
              *** these cases, it seems obvious in retrospect.
              ***
              *** I guess it's the plugin or the mapping, and I have to go with
              *** the plugin
              *** as it is so useful.
              ***
              *** Thanks,
              *** David.
            • Antoine J. Mechelynck
              ... The standard behaviour of the key in Insert mode is not to shift the current line (which is its standard behaviour in Normal mode) but to insert a
              Message 6 of 8 , Oct 3, 2004
              View Source
              • 0 Attachment
                David Nebauer <davidnebauer@...> wrote:
                > I'm trying to create the following mappings for use in editing xml
                > files:
                >
                > > --> >
                > ,> --> >
                >
                > What I'm running straight into is the shift-lines function of the '>'
                > key. The mapping does not appear to intercept the keystroke before it
                > performs the shift-lines action.
                >
                > I've tried the following without success:
                > [Note: 'Standard behaviour' is the usual behaviour of the <gt> key.]
                >
                > inoremap > > " Standard behaviour
                > inoremap <gt> > " Standard behaviour
                > inoremap \> > " Standard behaviour
                > inoremap \\> > " Standard behaviour
                >
                > As you can see, I'm guessing wildly with the last two attempts. Is
                > the '>' key unmappable?
                >
                > I'm happy to do without the shift-lines feature while editing xml. I
                > used the following mappings for less-than without any trouble:
                >
                > inoremap < <
                > inoremap ,< <lt> || inoremap ,< < " either works
                >
                > I've searched the net high and low for information on this problem
                > without any success. I'm sure it must have been solved long ago.
                > Any help greatly appreciated.
                >
                > Regards,
                > David.

                The "standard behaviour" of the > key in Insert mode is not to shift the
                current line (which is its standard behaviour in Normal mode) but to insert
                a ">" character. (Or did I miss something?)

                See also my (and Ingo Lantschner's) script htmlmap.vim <
                http://vim.sourceforge.net/scripts/script.php?script_id=258 > to map all
                sorts of characters to HTML entities. If you want more of the same, you can
                create mappings similar to those Ingo and I defined in your
                ~/.vim/ftplugin/html.vim (for Unix) or ~/vimfiles/ftplugin/html.vim (for
                Windows). And/or in xml.vim (in the same directories) for that matter.

                Best regards,
                Tony.
              • Antoine J. Mechelynck
                ... [...] ... It is of course not perfect. (A bug-free program is always obsolete :-) .) Someday, if I come around to it, I may revise it to obey the
                Message 7 of 8 , Oct 3, 2004
                View Source
                • 0 Attachment
                  Dave Silvia <dsilvia@...> wrote:
                  > *** -----Original Message-----
                  > *** From: Antoine J. Mechelynck
                  [...]
                  > *** See also my (and Ingo Lantschner's) script htmlmap.vim <
                  > *** http://vim.sourceforge.net/scripts/script.php?script_id=258 >
                  > *** to map all
                  > *** sorts of characters to HTML entities. If you want more of the
                  > *** same, you can
                  > *** create mappings similar to those Ingo and I defined in your
                  > *** ~/.vim/ftplugin/html.vim (for Unix) or
                  > *** ~/vimfiles/ftplugin/html.vim (for
                  > *** Windows). And/or in xml.vim (in the same directories) for that
                  > matter.
                  > ***
                  > *** Best regards,
                  > *** Tony.
                  > ***
                  > ***
                  > A very ambitious script!
                  >
                  > thx,
                  > Dave S.
                  >
                  It is of course not perfect. (A bug-free program is always obsolete :-) .)
                  Someday, if I come around to it, I may revise it to obey the "official"
                  digraphs even more closely than it does yet. Or if someone else wants to do
                  it, you're welcome.

                  Best regards,
                  Tony.
                Your message has been successfully submitted and would be delivered to recipients shortly.