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

Re: enter in a map statement

Expand Messages
  • Mathias Michaelis
    Hello Robert ... And CTRL-Q ? Regards Mathias
    Message 1 of 5 , Feb 1 12:56 AM
    • 0 Attachment
      Hello Robert

      > What should I use for the "^M" char to represent "<enter>"? The
      > page says "CTRL-V<return>" but that, of course, is "paste" in
      > windows...
      >
      And "CTRL-Q<return>"?
      Regards
      Mathias
    • Mikolaj Machowski
      ... ... - literally as 4 chars. Will work always and everywhere. m. -- LaTeX + Vim = http://vim-latex.sourceforge.net/ Vim-list(s) Users
      Message 2 of 5 , Feb 1 2:44 AM
      • 0 Attachment
        Dnia wtorek, 1 lutego 2005 07:23, Robert Bram napisaƂ:
        > Hi All!
        >
        > I used this function on Linux a while ago:
        > http://www.linuxgazette.com/node_files/2001-03/2748/tabstops.vimrc.txt
        >
        > " define a function for cycling the tabstops from 2 -> 4 -> 8 -> 2
        > set ts=4 sw=4
        > function Toggle_Tab_Width()
        > if &ts == 2
        > set ts=4 sw=4
        > elseif &ts == 4
        > set ts=8 sw=8
        > else
        > set ts=2 sw=2
        > endif
        > endfunction
        >
        > " call the funciton via the ex style command ':TG<ret>'
        > command TG call Toggle_Tab_Width()
        >
        > " set up Function-Key-1 to run the function. <F1> normally
        > " invokes help, but you can still get to that via :help.
        > unmap <F1>
        > map <F1> :TG^M
        >
        > " Allow this to work in insert mode too.
        > unmap! <F1>
        > map! <F1> <esc>:TG^Mli
        >
        >
        > But now I am in Windows with gvim - what should I use for the "^M" char
        > to represent "<enter>"? The page says "CTRL-V<return>" but that, of
        > course, is "paste" in windows...
        <C-Q><return>

        But better solution is:
        > map! <F1> <esc>:TG<cr>li

        <cr> - literally as 4 chars.

        Will work always and everywhere.

        m.
        --
        LaTeX + Vim = http://vim-latex.sourceforge.net/
        Vim-list(s) Users Map: (last change 6 Oct)
        http://skawina.eu.org/mikolaj/vimlist
        CLEWN - http://clewn.sf.net
      • Wind
        Hello Mathias, I think that is better than eny ^M insertion. So map! :TG li Tuesday, February 1, 2005, 10:56:46 AM, you wrote: MM Hello
        Message 3 of 5 , Feb 1 5:18 AM
        • 0 Attachment
          Hello Mathias,
          I think that <CR> is better than eny ^M insertion.
          So
          map! <F1> <esc>:TG<CR>li

          Tuesday, February 1, 2005, 10:56:46 AM, you wrote:

          MM> Hello Robert

          >> What should I use for the "^M" char to represent "<enter>"? The
          >> page says "CTRL-V<return>" but that, of course, is "paste" in
          >> windows...
          >>
          MM> And "CTRL-Q<return>"?
          MM> Regards
          MM> Mathias



          --
          Best regards,
          Wind mailto:sonic_wind@...
        • Antony Scriven
          Hi ... Only if you source the mswin.vim script. By default windows uses ^V to insert a literal char too. ... Not if `
          Message 4 of 5 , Feb 1 8:33 AM
          • 0 Attachment
            Hi

            Mikolaj Machowski wrote:

            > Dnia wtorek, 1 lutego 2005 07:23, Robert Bram napisa?:
            > > [...]
            > > But now I am in Windows with gvim - what should I use for the "^M" char
            > > to represent "<enter>"? The page says "CTRL-V<return>" but that, of
            > > course, is "paste" in windows...
            > <C-Q><return>

            Only if you source the mswin.vim script. By default windows
            uses ^V to insert a literal char too.

            > But better solution is:
            > > map! <F1> <esc>:TG<cr>li
            >
            > <cr> - literally as 4 chars.
            >
            > Will work always and everywhere.

            Not if `<' is in 'cpoptions', which, I grant you, is pretty
            unlikely. Of course, using <CR> is still a superior way, as
            you note.

            Antony
          Your message has been successfully submitted and would be delivered to recipients shortly.