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

Re: How to insert ASCII value?

Expand Messages
  • Benji Fisher
    ... IMHO the right way to repay the vim community for the help it gave you is to post this as a vim tip: from http://www.vim.org/tips/index.php follow the
    Message 1 of 6 , Feb 25, 2006
    • 0 Attachment
      On Sat, Feb 25, 2006 at 09:42:06AM +0800, Edward Wong wrote:
      > Thank you all guys. Your ideas just inspired me. I have put everything
      > together and I really like the idea of making it a toggle mode. After
      > some trial and error I have finally made it works. Here is what I
      > have:

      IMHO the right way to repay the vim community for the help it gave
      you is to post this as a vim tip: from
      http://www.vim.org/tips/index.php
      follow the link to "add tip".

      [snip]
      > exe 'inoremap ' . nr2char(i) . ' ' . '0'.Nr2Hex(i+0x80).'H,'

      One feature of the :execute command that is often overlooked is
      that it accepts multiple arguments. Like :echo, it inserts a space
      between them. So I would write this line as

      execute 'inoremap' nr2char(i) '0' . Nr2Hex(i+0x80) . 'H,'

      HTH --Benji Fisher
    Your message has been successfully submitted and would be delivered to recipients shortly.