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

Unable to enter functions keys in .vimrc or any other file

Expand Messages
  • Mahendra Ladhe
    Hi,    I am using vim 7.3 on Windows XP. I m trying to map some function keys using map command in the .vimrc When I enter the key sequence ctrl-v followed
    Message 1 of 5 , May 2, 2011
    View Source
    • 0 Attachment
      Hi,
         I am using vim 7.3 on Windows XP. I'm trying to map some function keys using 'map'
      command in the .vimrc
      When I enter the key sequence ctrl-v followed by some function key, say F1,
      vim enters the 4-character sequence <F1> instead of the actual control key F1.
      Btw, I'm able to use ctrl-v key for visual mode text selection.
      How do I enter function or any other control keys in .vimrc

      Thanks,
      Mahendra

      --
      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
    • Michael Hauser
      ... Hitting the function keys in insert mode seems to default to print . Are you asking about the syntax? Perhaps I am misunderstanding you here, but
      Message 2 of 5 , May 2, 2011
      View Source
      • 0 Attachment
        On Mon, May 2, 2011 at 22:59, Mahendra Ladhe <lml108@...> wrote:
        >    I am using vim 7.3 on Windows XP. I'm trying to map some function keys using 'map'
        > command in the .vimrc
        > When I enter the key sequence ctrl-v followed by some function key, say F1,
        > vim enters the 4-character sequence <F1> instead of the actual control key F1.
        > Btw, I'm able to use ctrl-v key for visual mode text selection.
        > How do I enter function or any other control keys in .vimrc

        Hitting the function keys in insert mode seems to default to print <F1>.
        Are you asking about the syntax?
        Perhaps I am misunderstanding you here, but mapping e.g. ':q!' to 'F4'
        works like this in .vimrc:

        map <F4> :q!<CR>

        Regards,
        mih

        --
        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
      • Jean-Rene David
        ... Indeed it does. And have you tried to see if your mapping worked with the 4-character sequence? Because that is the intended behavior and works fine here.
        Message 3 of 5 , May 2, 2011
        View Source
        • 0 Attachment
          * Mahendra Ladhe [2011.05.02 18:40]:
          > When I enter the key sequence ctrl-v followed by some function key, say F1,
          > vim enters the 4-character sequence <F1> instead of the actual control key F1.

          Indeed it does. And have you tried to see if your mapping worked with
          the 4-character sequence? Because that is the intended behavior and
          works fine here.

          --
          JR

          --
          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
        • Mahendra Ladhe
          Thanks JR. The mapping is working. On my earlier Windows XP PC with vim 7.2, the control keys like F1 would be displayed in blue color, different than the rest
          Message 4 of 5 , May 3, 2011
          View Source
          • 0 Attachment
            Thanks JR. The mapping is working. On my earlier Windows XP PC with
            vim 7.2,
            the control keys like F1 would be displayed in blue color, different
            than the rest of the text.
            That's why I found it odd when vim 7.3 was entering 4-character plain-
            text sequence for keys like F1.

            On May 2, 7:18 pm, Jean-Rene David <jrda...@...> wrote:
            > * Mahendra Ladhe [2011.05.02 18:40]:
            >
            > > When I enter the key sequence ctrl-v followed by some function key, say F1,
            > > vim enters the 4-character sequence <F1> instead of the actual control key F1.
            >
            > Indeed it does. And have you tried to see if your mapping worked with
            > the 4-character sequence? Because that is the intended behavior and
            > works fine here.
            >
            > --
            > JR

            --
            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
          • pansz
            ... Ctrl-A to Ctrl-Z are real control characters which will display in real control character, F1 is not a character and it will not shown as control character
            Message 5 of 5 , May 3, 2011
            View Source
            • 0 Attachment
              On Wed, May 4, 2011 at 1:59 AM, Mahendra Ladhe <lml108@...> wrote:
              > Thanks JR. The mapping is working. On my earlier Windows XP PC with
              > vim 7.2,
              > the control keys like F1 would be displayed in blue color, different
              > than the rest of the text.
              > That's why I found it odd when vim 7.3 was entering 4-character plain-
              > text sequence for keys like F1.

              Ctrl-A to Ctrl-Z are real control characters which will display in
              real control character, F1 is not a character and it will not shown as
              control character in vim.

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