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

Re: Dead keys

Expand Messages
  • Antoine J. Mechelynck
    ... AFAIK, Vim doesn t know anything about dead keys. Their use can result from two circumstances: (a) If your national keyboard includes dead keys (as mine
    Message 1 of 8 , Nov 4, 2003
      Steve Hall <digitect@...> wrote:
      > Can anyone point me to some info about dead keys? (Using preceeding ^,
      > ~, ', and ` to enable insertion of western European multi-byte chars.)
      > My Vim configuration apparently squashes gvim's usual default to use
      > them but I have no idea what to set or keep from setting to turn them
      > on.
      >
      > TIA.
      >
      > --
      > Steve Hall [ digitect@... ]

      AFAIK, Vim doesn't know anything about dead keys. Their use can result from
      two circumstances:

      (a) If your national keyboard includes dead keys (as mine does) they will
      remain functional in Vim. It will then take two keypresses before a letter
      such as ê or ü appears in Vim's input buffer. Your 'termencoding' (or, if
      &termencoding == "", your 'encoding') must correspond to what your keyboard
      driver is actually sending for all combinations of dead key + "live" key.
      This is usually achieved by either

      1°) not changing 'encoding' and 'termencoding' yourself, or

      2°) setting 'termencoding' explicitly to the old value of 'encoding'
      before you alter the latter. My short script set_utf8.vim,
      http://vim.sourceforge.net/scripts/script.php?script_id=789 , shows how to
      proceed when the target 'encoding' is utf-8. I suppose it can be easily
      adapted for other targets.

      (b) If you have defined mappings (including those defined by a keymap) whose
      {lhs} includes more than one character, all of those characters except the
      last one can be considered "dead keys". Vim will see them, and will show
      them at bottom right of your screen if 'showcmd' is on (which is the
      Vim-not-Vi default), but it will only act on them when you have typed the
      whole {lhs}, or when it becomes evident that what you are typing is not the
      {lhs} of any mapping.

      Regards,
      Tony.
    • Charles E. Campbell
      ... Vim doesn t have dead-keys, but it does have digraphs. See ... However, you may find the plugin of help. See
      Message 2 of 8 , Nov 4, 2003
        On Tue, Nov 04, 2003 at 10:02:10AM -0500, Steve Hall wrote:
        > Can anyone point me to some info about dead keys? (Using preceeding ^,
        > ~, ', and ` to enable insertion of western European multi-byte chars.)
        ---------------------------------------------------------------------

        Vim doesn't have dead-keys, but it does have digraphs. See

        :he i_ctrl-k

        However, you may find the <EasyAccents.vim> plugin of help. See

        http://vim.sourceforge.net/scripts/script.php?script_id=451

        It basically implements dead keys: ^o 'a `a :e etc.
        EasyAccents toggles on/off via use of the mapping \ea.

        Regards,
        Chip Campbell

        --
        Charles E Campbell, Jr, PhD _ __ __
        Goddard Space Flight Center / /_/\_\_/ /
        cec@... /_/ \/_//_/
        PGP public key: http://www.erols.com/astronaut/pgp.html
      • Chris Jones
        Just curious about this and couldn t find anything online. Has anybody heard of a dead key scheme where the user hits the printable key first and then adds the
        Message 3 of 8 , Jan 22, 2016
          Just curious about this and couldn't find anything online.

          Has anybody heard of a dead key scheme where the user hits the printable
          key first and then adds the diacritic? Same as what I do when using the
          X server's Compose key.. but without the need of a Compose key.

          When you type the Spanish word "qué" for instance, you would first type
          q+u+e... "que" - which has both a different meaning and grammatical role
          from "qué"... and then notice... hmm. I'm missing an accent... So now
          you hit the dead acute key and the "e" at the the end of "que" magically
          becomes "é" in the buffer and "é" is echoed back to the terminal
          replacing the "e" on your screen as if you had backspaced deleting the
          original "e" and typed an "é" to replace it... All in one pass..

          Context: I'm proofreading a couple of e-books in Spanish and French
          (using Vim for the editing) and I'm getting aggravated at having to hit
          an extra key each time I need to add or change a diacritic.

          As to switching to using dead keys as I have seen them explained (with
          the dead key being hit first and the normal key second at least that's
          how I understood it)... well that would mean I'd have to change some
          rather ancient well ingrained habits. So I'm not sure that would be
          suitable at this point.

          So I'm wondering if anybody has ever heard of anything such as this...
          either limited to Vim... or better still... a system-wide solution on
          linux systems running the X window system... possibly as some kind of
          driver/filter/hook...

          Thanks,

          CJ

          --
          --
          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/d/optout.
        • Shawn H Corey
          On Fri, 22 Jan 2016 18:11:26 -0500 ... ViM has its own compose key: CTRL+K http://vim.wikia.com/wiki/Entering_special_characters -- Don t stop where the ink
          Message 4 of 8 , Jan 22, 2016
            On Fri, 22 Jan 2016 18:11:26 -0500
            Chris Jones <cjns1989@...> wrote:

            > Has anybody heard of a dead key scheme where the user hits the
            > printable key first and then adds the diacritic? Same as what I do
            > when using the X server's Compose key.. but without the need of a
            > Compose key.

            ViM has its own compose key: CTRL+K

            http://vim.wikia.com/wiki/Entering_special_characters


            --
            Don't stop where the ink does.
            Shawn

            --
            --
            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/d/optout.
          • Matt Ackeret
            ... option-e e makes é on MacOS.. (hint hint.. heh) -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the
            Message 5 of 8 , Jan 22, 2016
              > On Jan 22, 2016, at 3:11 PM, Chris Jones <cjns1989@...> wrote:
              > So I'm wondering if anybody has ever heard of anything such as this...
              > either limited to Vim... or better still... a system-wide solution on
              > linux systems running the X window system... possibly as some kind of
              > driver/filter/hook...

              option-e e makes é on MacOS..

              (hint hint.. heh)

              --
              --
              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/d/optout.
            • Sven Guckes
              ... umm.. no. ... bzzt! when you hit that dead key.. well.. it s dead, you see. nothing gets sent - nothing is received by vim - nothing happens. you might
              Message 6 of 8 , Jan 22, 2016
                * Chris Jones <cjns1989@...> [2016-01-23 01:36]:
                > Has anybody heard of a dead key scheme where the user hits
                > the printable key first and then adds the diacritic?

                umm.. no.

                > When you type the Spanish word "qué" for instance, you would first
                > type q+u+e... "que" - which has both a different meaning and
                > grammatical role from "qué"... and then notice... hmm. I'm missing
                > an accent... So now you hit the dead acute key and the "e" at
                > the the end of "que" magically becomes "é" in the buffer..

                bzzt! when you hit that dead key.. well.. it's dead, you see.
                nothing gets sent - nothing is received by vim - nothing happens.

                you might tweak your X into sending something, anyway.
                why not quit the habit of *hitting* a *dead* key? ;)

                instead - how about using a single character like a tick (')
                to trigger a function which checks whether the previous character
                is one of which could use it as a diacritic - and then compose it?

                so type "que" then add a tick ("que'") - and presto: "qué"!

                but.. there are not many of those special letters, are there?
                so if you dont want to change much then i
                suggest using the composition with CTRL-K:

                CTRL-K e ' --> é
                CTRL-K n ~ --> ñ

                but if your situation is that you forgot to type a CTRL-K
                and the 'e' or 'n' is already there, then you ":set digraph"
                and you can erase it with CTRL-H and type the accent over it:

                e CTRL-H ' --> é
                n CTRL-H ~ --> ñ

                ta-dah! :-)

                i had found this neat.. however, i sometimes typed a 't',
                erased it, and then typed an 'h' - resulting in a "thorn": þ
                and then there are so many combinations which result in
                funny characters that i finally ":set nodigraph" again. ;)

                see also: ":help digraph"

                > Context: I'm proofreading a couple of e-books in Spanish and French
                > (using Vim for the editing) and I'm getting aggravated at having to
                > hit an extra key each time I need to add or change a diacritic.

                well - you must type *something* to correct an error, right?! ;)

                Sven [still hoping for that ":dwim" patch to be included..]

                --
                https://en.wikipedia.org/wiki/Spanish_orthography
                "In Spanish text, the letters are ranked from most to least common:
                ⟨E A O S R N I D L C T U M P B G V Y Q H F Z J Ñ X W K⟩,
                and the vowels take around 45% of the text."

                --
                --
                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/d/optout.
              • Tony Mechelynck
                ... Well, accent after is the Unicode convention for combining characters, which are however regarded as characters on their own right, except that they
                Message 7 of 8 , Jan 22, 2016
                  theOn Sat, Jan 23, 2016 at 12:11 AM, Chris Jones <cjns1989@...> wrote:
                  > Just curious about this and couldn't find anything online.
                  >
                  > Has anybody heard of a dead key scheme where the user hits the printable
                  > key first and then adds the diacritic? Same as what I do when using the
                  > X server's Compose key.. but without the need of a Compose key.
                  >
                  > When you type the Spanish word "qué" for instance, you would first type
                  > q+u+e... "que" - which has both a different meaning and grammatical role
                  > from "qué"... and then notice... hmm. I'm missing an accent... So now
                  > you hit the dead acute key and the "e" at the the end of "que" magically
                  > becomes "é" in the buffer and "é" is echoed back to the terminal
                  > replacing the "e" on your screen as if you had backspaced deleting the
                  > original "e" and typed an "é" to replace it... All in one pass..
                  >
                  > Context: I'm proofreading a couple of e-books in Spanish and French
                  > (using Vim for the editing) and I'm getting aggravated at having to hit
                  > an extra key each time I need to add or change a diacritic.
                  >
                  > As to switching to using dead keys as I have seen them explained (with
                  > the dead key being hit first and the normal key second at least that's
                  > how I understood it)... well that would mean I'd have to change some
                  > rather ancient well ingrained habits. So I'm not sure that would be
                  > suitable at this point.
                  >
                  > So I'm wondering if anybody has ever heard of anything such as this...
                  > either limited to Vim... or better still... a system-wide solution on
                  > linux systems running the X window system... possibly as some kind of
                  > driver/filter/hook...
                  >
                  > Thanks,
                  >
                  > CJ

                  Well, "accent after" is the Unicode convention for combining
                  characters, which are however regarded as characters on their own
                  right, except that they "share space" with the character preceding
                  them in the text stream. For instance, Russian has an optional acute
                  accent, used to indicate word stress in dictionaries, reading courses
                  (for grade school children or foreigners) and in the rare cases where
                  the place of the stress changes the meaning (e.g. in a book about
                  chess, «у белых есть большая выгода» would normally be understood as
                  «у бе́лых есть больша́я вы́года», "White has a big advantage", but
                  with different stress: «у белых есть бо́льшая выгода» means "White has
                  a bigger advantage"). This acute accent is a separate Unicode
                  codepoint, it just doesn't occupy space on its own.

                  (
                  Since you give Spanish as an example, when typing Spanish you could
                  either use precomposed characters for á é í ó ú ñ (on my Belgian
                  keyboard all of these [except é which has its own key] are produced by
                  a two-key chord using the AltGr modifier, followed by a letter key:
                  see http://users.skynet.be/antoine.mechelynck/other/keybbe.htm), or
                  you could use the letter followed by a combining character, which
                  would result in á é í ó ú ñ, which may or may not be uglier
                  depending on your font and on your mailer's (or other program's)
                  rendering engine. In the second case you could set the clipboard to
                  just the Unicode codepoint U+0301 (combining acute accent) using the
                  Vim command
                  :let @+ =
                  followed on the same line by: single-quote ctrl-v u 0 3 0 1
                  single-quote Enter
                  and add that to make question words out of que, quien, donde, cuando,
                  como, etc. This assumes that a missing tilde is much rarer than a
                  missing acute accent; but you could also add a tilde in the same way,
                  with 0303 instead of 0301.

                  Note however that unlike the French and Spanish precomposed
                  characters, this combining character is not part of the Latin1
                  charset, which may or may not be a problem depending on the charset
                  expected by the recipient of your proofreading. It is also slightly
                  more expensive in media space since in Latin1 e = 0x65, é = 0xE9 (one
                  byte each) while in UTF-8 e is still 0x65 (one ASCII-compatible
                  codepoint, one byte), precomposed é becomes 0xC3 0xA9 (one codepoint,
                  two bytes), and "decomposed" é is 0x65 0xCC 0x81 (two codepoints,
                  three bytes).
                  )

                  OTOH, when typewriters were still widely used, their dead keys used
                  the "accent before" convention, simply because the character bar
                  bearing those accents lacked the tooth which triggered a carriage
                  advance: e.g. in French typewriters, when you hit ^ (circumflex,
                  without Shift) or " (diaeresis, on the same key but with Shift) the
                  character bar hit the paper (through the ribbon) and the carriage did
                  not advance, so that the next character typed (usually a vowel, but
                  when a French typewriter was used to type in Esperanto it could be a
                  consonant) hit the paper on the same "character cell" as the diacritic
                  and made the carriage advance. OTOH, the other accented French
                  lowercase letters (àçéèù) all had their own keys — on modern French
                  and Belgian computer AZERTY keyboards they still do; I'm less sure
                  about Swiss QWERTZ keyboards — and the French typists' tradition
                  included deviating from the printers' tradition in never typing
                  accents over capitals (with the possible exception of Ç which could be
                  awkwardly produced by C backspace comma or vice-versa) and in typing
                  OE and oe instead of Œ and œ (and also AE and ae instead of the rarer
                  Æ and æ, which may be found in some Danish or Latin words, and in a
                  few words such as the given name Lætitia, as it appears spelled-out in
                  Serge Gainsbourg's song "Elaeudanla téitéia", or the Catholic feast of
                  Lætare, which some towns use instead of Mardi Gras for their yearly
                  carnival).

                  In Vim, you can think of a "dead key" whenever an Insert- or
                  Command-line-mode mapping (including a keymap item) has a {lhs}
                  consisting of more than one characters. In those cases, it is more or
                  less the designer's choice whether to put the accent first or last.
                  The choice may even depend on which keys are used to mean what; but
                  remember: as long as you haven't either typed the whole {lhs}, or
                  typed something which discards all mappings, you won't see the {rhs}.
                  This may be more or less significant depending on how many successive
                  characters there are in your {lhs} and on how much your keyboard
                  charset (used in the {lhs}) differs from your text charset (as output
                  by the {rhs}). For instance my private russian-phonetic keymap has two
                  {lhs}es beginning with N (Latin capital N): just N to mean H (Russian
                  capital en) and also N° (N degree) to mean № (Numero sign). The result
                  is that whenever I type N for a Russian Н, the vertical-bar cursor (in
                  gvim) doesn't advance and a latin N is displayed in the same screen
                  cell ("to the right" of the insertion bar), until I follow it with
                  either a degree sign (in which case that N becomes №) or with anything
                  else (in which case N becomes Н, the next character also appears, and
                  the insertion cursor suddenly moves two cells forward). This is
                  sometimes a little disturbing; maybe less so for a (moderately) fast
                  typist not constantly looking at the text screen. For other Russian
                  letters which don't have a "phonetic" equivalent I use a "preceding"
                  dead key, usually %: so I have %Z → Ж, %C → Ч, %U → Ю, etc. This
                  allows me to see immediately the Cyrillic equivalent for Z → З, C → Ц,
                  U → У, etc.

                  See also
                  :help i_CTRL-V_digit
                  http://vim.wikia.com/wiki/How_to_make_a_keymap


                  Best regards,
                  Tony.

                  --
                  --
                  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/d/optout.
                Your message has been successfully submitted and would be delivered to recipients shortly.