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

Re: Mapping <*-CR>

Expand Messages
  • Ben Fritz
    ... Yes, in theory. I m not exactly sure how to get any of those problematic ones working in the terminal. You can try using whatever you get by actually
    Message 1 of 10 , Aug 16, 2013
    • 0 Attachment
      On Friday, August 16, 2013 11:56:03 AM UTC-5, Gautier DI FOLCO wrote:
      >
      >
      > I have no difference with CTRL-K (it is alway ^M) but with CTRL-V I can see [0^M for <S-CR>, so, theoretically I can map <S-CR>, can't I?


      Yes, in theory. I'm not exactly sure how to get any of those problematic ones working in the terminal.

      You can try using whatever you get by actually typing <C-V><S-CR> as the left side of a mapping. E.g. so you mapping looks like:

      map ^[0^M A

      But that's not very pretty...I think there's a way to actually fix it.

      I mostly use GUI Vim, so most mappings I try just work without much trouble.

      --
      --
      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

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Gautier DI FOLCO
      2013/8/16 Ben Fritz ... Thanks, It works but I feel dirty :/ -- -- You received this message from the vim_use maillist. Do not
      Message 2 of 10 , Aug 17, 2013
      • 0 Attachment
        2013/8/16 Ben Fritz <fritzophrenic@...>
        On Friday, August 16, 2013 11:56:03 AM UTC-5, Gautier DI FOLCO wrote:
        >
        >
        > I have no difference with CTRL-K (it is alway ^M) but with CTRL-V I can see [0^M for <S-CR>, so, theoretically I can map <S-CR>, can't I?


        Yes, in theory. I'm not exactly sure how to get any of those problematic ones working in the terminal.

        You can try using whatever you get by actually typing <C-V><S-CR> as the left side of a mapping. E.g. so you mapping looks like:

        map ^[0^M A

        But that's not very pretty...I think there's a way to actually fix it.

        I mostly use GUI Vim, so most mappings I try just work without much trouble.

        Thanks,
        It works but I feel dirty :/

        --
        --
        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
         
        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Michael Henry
        ... I ve been working on fixkey, a plugin to help Vim use non-ASCII keys in a terminal emulator: http://www.vim.org/scripts/script.php?script_id=4693 It
        Message 3 of 10 , Aug 18, 2013
        • 0 Attachment
          On 08/17/2013 02:35 PM, Gautier DI FOLCO wrote:
          > 2013/8/16 Ben Fritz <fritzophrenic@...>
          > > You can try using whatever you get by actually typing
          > > <C-V><S-CR> as the left side of a mapping. E.g. so you
          > > mapping looks like:
          >
          > > map ^[0^M A
          >
          > Thanks, It works but I feel dirty :/

          I've been working on fixkey, a plugin to help Vim use non-ASCII
          keys in a terminal emulator:
          http://www.vim.org/scripts/script.php?script_id=4693

          It gathers the community wisdom floating around on the Vim wiki,
          the mailing lists, and the Internet at large into one place.
          The plugin configures Vim to match modern terminal behavior. It
          comes with instructions for any additional terminal
          configuration that must be done to get maximum functionality.

          Earlier in the thread, you'd said "I can see [0^M for <S-CR>,
          so, theoretically I can map <S-CR>, can't I?" I haven't seen
          that sequence in my testing of the terminals supported by the
          fixkey plugin; which terminal emulator are you using?

          If you are using Xterm or KDE Konsole, then perhaps you meant
          the sequence ^[OM (<Escape>OM), in which case fixkey should take
          care of configuring Vim's keycode for <S-Enter> (also known as
          <S-CR>). In that case, you can install the plugin and map
          <S-Enter> to whatever you'd like, e.g.:

          inoremap <S-Enter> Shift-Enter

          Then, in insert mode, pressing <S-Enter> should insert
          "Shift-Enter" into your buffer as a test.

          I should mention that terminals are strange beasts.
          Documentation can be confusing and can conflict with empirically
          determined behavior. The fixkey plugin represents my best
          attempt at supporting the terminals to which I've got easy
          access. A given terminal may be configured differently on your
          system than on mine, causing incorrect behavior. I'm interested
          in improving fixkey to support more terminals, environments, and
          keycodes where possible, though there are some problems that
          can't be fixed with just a Vim plugin.

          Thanks,
          Michael Henry

          --
          --
          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

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • David Fishburn
          ... There are other ways to creating mappings then with the control characters. (On Windows) I map the ALT- keys. In a buffer, go into INSERT mode.
          Message 4 of 10 , Aug 19, 2013
          • 0 Attachment
            ...
            Yes, in theory. I'm not exactly sure how to get any of those problematic ones working in the terminal.

            You can try using whatever you get by actually typing <C-V><S-CR> as the left side of a mapping. E.g. so you mapping looks like:

            map ^[0^M A

            But that's not very pretty...I think there's a way to actually fix it.

            I mostly use GUI Vim, so most mappings I try just work without much trouble.

            Thanks,
            It works but I feel dirty :/


            There are other ways to creating mappings then with the control characters.

            (On Windows) I map the ALT-< and ALT-> keys.

            In a buffer, go into INSERT mode.
            Hit CTRL-V, then type ALT-<
            Hit Escape.
            The character in my buffer is this:
            ¬
            Put your cursor on the character displayed, hit ga
            Vim displays this:
            <¬>  <|,>  <M-,>  172,  Hex ac,  Octal 254

            Using the ACSII number (172), you can create mappings like this:
                map <Char-172> A
            Instead of this:
                map ^[0^M A

            I find that much less dirty, though I document in Vim comments right above the mapping how I came up with Char-172.

            HTH,
            David

            --
            --
            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
             
            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Gautier DI FOLCO
            2013/8/18 Michael Henry ... Your plugin works for ! Thank you so much! ... KDE Konsole and you are right that is ^[OM. I should
            Message 5 of 10 , Aug 19, 2013
            • 0 Attachment
              2013/8/18 Michael Henry <vim@...>
              On 08/17/2013 02:35 PM, Gautier DI FOLCO wrote:
              > 2013/8/16 Ben Fritz <fritzophrenic@...>
              > > You can try using whatever you get by actually typing
              > > <C-V><S-CR> as the left side of a mapping. E.g. so you
              > > mapping looks like:
              >
              > > map ^[0^M A
              >
              > Thanks, It works but I feel dirty :/

              I've been working on fixkey, a plugin to help Vim use non-ASCII
              keys in a terminal emulator:
              http://www.vim.org/scripts/script.php?script_id=4693

              It gathers the community wisdom floating around on the Vim wiki,
              the mailing lists, and the Internet at large into one place.
              The plugin configures Vim to match modern terminal behavior.  It
              comes with instructions for any additional terminal
              configuration that must be done to get maximum functionality.

              Your plugin works for <S-CR>! Thank you so much!
               
              Earlier in the thread, you'd said "I can see [0^M for <S-CR>,
              so, theoretically I can map <S-CR>, can't I?"  I haven't seen
              that sequence in my testing of the terminals supported by the
              fixkey plugin; which terminal emulator are you using?

              If you are using Xterm or KDE Konsole, then perhaps you meant
              the sequence ^[OM (<Escape>OM), in which case fixkey should take
              care of configuring Vim's keycode for <S-Enter> (also known as
              <S-CR>).  In that case, you can install the plugin and map
              <S-Enter> to whatever you'd like, e.g.:

                inoremap <S-Enter>  Shift-Enter

              Then, in insert mode, pressing <S-Enter> should insert
              "Shift-Enter" into your buffer as a test.

              KDE Konsole and you are right that is  ^[OM.

              I should mention that terminals are strange beasts.
              Documentation can be confusing and can conflict with empirically
              determined behavior.  The fixkey plugin represents my best
              attempt at supporting the terminals to which I've got easy
              access.  A given terminal may be configured differently on your
              system than on mine, causing incorrect behavior.  I'm interested
              in improving fixkey to support more terminals, environments, and
              keycodes where possible, though there are some problems that
              can't be fixed with just a Vim plugin.

              Thanks,
              Michael Henry

              Thank you so much!

              --
              --
              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
               
              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • John Little
              ... A plug for xterm. xterm is well maintained by Thomas Dickey, who has been seen on vim_dev. If you have a problem with its documentation, I think he d
              Message 6 of 10 , Aug 20, 2013
              • 0 Attachment
                On Tuesday, August 20, 2013 9:14:56 AM UTC+12, Gautier DI FOLCO wrote:

                >I should mention that terminals are strange beasts.
                >Documentation can be confusing and can conflict with empirically
                >determined behavior.

                A plug for xterm.

                xterm is well maintained by Thomas Dickey, who has been seen on vim_dev. If you have a problem with its documentation, I think he'd welcome a report of it.

                Regards, John Little

                --
                --
                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

                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Thomas E. Dickey
                ... konsole s keyboard hasn t changed in a while (2008 is the most recent): http://invisible-island.net/ncurses/terminfo.ti.html#toc-_K_D_E There are a couple
                Message 7 of 10 , Aug 28, 2013
                • 0 Attachment
                  On Tuesday, August 27, 2013 8:21:06 AM UTC-4, Michael Henry wrote:
                  > On 08/25/2013 05:00 PM, Thomas E. Dickey wrote:

                  konsole's keyboard hasn't changed in a while (2008 is the most recent):

                  http://invisible-island.net/ncurses/terminfo.ti.html#toc-_K_D_E

                  There are a couple of
                  general comments about the xterm keys:

                  a) the \E[ stuff is CSI, used in application mode. \EO is SS3 - normal mode.
                  conventionally xterm uses application mode, which is okay except for bash
                  users who aren't running in full-screen mode.
                  b) the \EOP, \EOQ, etc., are the vt100 PF-keys, which I made xterm use for
                  F1-F4 in the 1990s. Before that (and still configurable) are codes with
                  numbers.
                  c) the modifier stuff came somewhat later (still a long time ago).
                  I recall noticing that the modified keys used SS3, which isn't really
                  right - and changed those to use CSI format as you see in the terminal
                  database. In a quick check, it seems that I did this in 2006.

                  --
                  --
                  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

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                Your message has been successfully submitted and would be delivered to recipients shortly.