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

Re: How to use command - z for undo?

Expand Messages
  • panshizhu@routon.com
    ... Hi, the Vim uses u for undo, please :help undo to see it. If you do want the command+z for undo, you can just create a map for that, ... On the above the
    Message 1 of 7 , Jun 5, 2005
    • 0 Attachment
      Unnsse Khan <untz@...> wrote on 2005-06-06 09:13:17:

      > Hello,
      >
      > I am running gvim Vim 7.0aa ALPHA on OS X 10.4 (Tiger) (I downloaded
      > this
      > from: http://macvim.org/OSX/index.html.
      >
      > My .vimrc file looks like this:
      >
      > Raven:~ untz$ cat .vimrc
      > set nocompatible
      > set ts=4
      > set keymodel=startsel
      > set nu
      > set autoindent
      > set ruler
      > set backspace=indent,eol,start
      > syntax on
      > colorscheme torte
      > set gfn=set guifont=Bitstream\ Vera\ Sans\ Mono\ 20
      >
      > My question is, how I use an "undo" on gvim?
      >
      > When I click on "command key + z", it just echos:
      >
      > <D-z>
      >
      > Also, if I copy code from vim or some other program, and try to paste
      > in Outlook,
      > it gives me cryptic characters.... When I tried to copy the <D-z>
      > from gvim into this e-mail,
      > the output is this:
      >
      > ���
      >
      > Any suggestions and tips will be greatly appreciated...
      >
      > With thanks,
      >
      > Unnsse

      Hi, the Vim uses u for undo, please :help undo
      to see it.

      If you do want the command+z for undo, you can just create a map for that,
      like:

      :imap <D-z> <C-O>u

      On the above the <D-z> mean you press the command+z key, but for <C-O> you
      should input the character literally...


      --
      Sincerely
      Pan, Shizhu. ext: 2221
    • Unnsse Khan
      Antoine, I know that I could reference vim s help, but this undo and paste problem seemed akward to me and that s why I posted my question. I have used vim on
      Message 2 of 7 , Jun 5, 2005
      • 0 Attachment
        Antoine,

        I know that I could reference vim's help, but this undo and paste
        problem seemed
        akward to me and that's why I posted my question. I have used vim on
        Windows for
        years and never experienced these "basic" problems, so that's why I
        thought that it
        could be a settings issue. I can't believe that it won't work using
        "Command z" or "Control z",
        default, for that matter.

        Actually, I am using OS X's Mail and Microsoft's Entourage, I just
        told everyone that I was
        using MS Outlook, because I didn't want to complicate matters. Its
        unfortunate that I have to
        use pico to copy and paste different things. I usually use gvim for
        everything.

        All the best,

        Unnsse

        On Jun 5, 2005, at 6:46 PM, A. J. Mechelynck wrote:

        > Unnsse Khan wrote:
        >
        >> Hello,
        >>
        >> I am running gvim Vim 7.0aa ALPHA on OS X 10.4 (Tiger) (I
        >> downloaded this
        >> from: http://macvim.org/OSX/index.html.
        >>
        >> My .vimrc file looks like this:
        >>
        >> Raven:~ untz$ cat .vimrc
        >> set nocompatible
        >> set ts=4
        >> set keymodel=startsel
        >> set nu
        >> set autoindent
        >> set ruler
        >> set backspace=indent,eol,start
        >> syntax on
        >> colorscheme torte
        >> set gfn=set guifont=Bitstream\ Vera\ Sans\ Mono\ 20
        >>
        >> My question is, how I use an "undo" on gvim?
        >>
        >> When I click on "command key + z", it just echos:
        >>
        >> <D-z>
        >>
        >> Also, if I copy code from vim or some other program, and try to paste
        >> in Outlook,
        >> it gives me cryptic characters.... When I tried to copy the <D-z>
        >> from
        >> gvim into this e-mail,
        >> the output is this:
        >>
        >> 獤摤摤
        >>
        >> Any suggestions and tips will be greatly appreciated...
        >>
        >> With thanks,
        >>
        >> Unnsse
        >>
        >>
        >>
        >>
        >>
        >
        > Undo in (g)vim is obtained by hitting u in Normal mode. Vim is highly
        > configurable; but its basic keystrokes are inherited from VI, not from
        > Notepad, not from kedit, not from Word, not from WordPerfect and not
        > from WordStar. Its help is the most comprehensive (and the least
        > out-of-date) I ever saw for _any_ program, bar none; but that help
        > is so
        > voluminous a haystack that sometimes finding your needle in it may be,
        > shall we say, a little awkward. ;-)
        >
        > This said, there are ways to search the help. In this case,
        >
        > :help undo
        >
        > would have given you the answer.
        >
        > I don't know the answer to your paste problem. You are using Outlook,
        > not Outlook Express, are you? I know the latter but not the former.
        > Maybe it doesn't understand the clipboard data copied by "Vim or other
        > programs".
        >
        >
        > Best regards,
        > Tony.
        >
        >
      • A. J. Mechelynck
        ... Vim normally uses u for undo; or Ctrl-O u if in Insert mode. u for undo doesn t sound awkward or complicated to me, but if you want Cmd-Z for undo
        Message 3 of 7 , Jun 5, 2005
        • 0 Attachment
          Unnsse Khan wrote:
          > Antoine,
          >
          > I know that I could reference vim's help, but this undo and paste
          > problem seemed
          > akward to me and that's why I posted my question. I have used vim on
          > Windows for
          > years and never experienced these "basic" problems, so that's why I
          > thought that it
          > could be a settings issue. I can't believe that it won't work using
          > "Command z" or "Control z",
          > default, for that matter.
          >
          > Actually, I am using OS X's Mail and Microsoft's Entourage, I just told
          > everyone that I was
          > using MS Outlook, because I didn't want to complicate matters. Its
          > unfortunate that I have to
          > use pico to copy and paste different things. I usually use gvim for
          > everything.
          >
          > All the best,
          >
          > Unnsse

          Vim normally uses u for undo; or Ctrl-O u if in Insert mode. "u for
          undo" doesn't sound "awkward" or "complicated" to me, but if you want
          "Cmd-Z for undo" instead, you can -- by means of a mapping, see the
          other post in this thread. Cmd-Z is normally unused in Insert mode, so
          you have the luck that there won't be a clash there; if you want to use
          it in all modes, you need another mapping, as follows:

          :map <D-Z> u
          :map! <D-Z> <C-O>u

          (Type all this literally, i.e., < is less-than, > is greater-than, etc.)
          You can put these lines, without the colons, in your vimrc. You will
          lose the Normal-mode Cmd-Z (Ctrl-Z is usually used to suspend Vim) but
          you can use ":suspend" instead, so here too, there's no dramatic loss.

          I would, however, urge you to learn "the Vim way" of doing things,
          rather tran trying to make Vim mimic whatever editor you used before.
          The latter is possible, but the former is usually more rewarding,
          because it's only that way that you can learn all that Vim can do and
          your former editor couldn't.


          I still don't know why whatever mail client you are using (and if it
          isn't Outlook, then what is it? With wrong information you won't get the
          right anwer: garbage in, garbage out, as computer programmers used to
          say) -- why you mail client doesn't read the clipboard data properly.


          Best regards,
          Tony.
        • panshizhu@routon.com
          A. J. Mechelynck wrote on 2005-06-06 ... told ... Hi Tony, I think what he questions is that why cmd-z is not undo by
          Message 4 of 7 , Jun 5, 2005
          • 0 Attachment
            "A. J. Mechelynck" <antoine.mechelynck@...> wrote on 2005-06-06
            11:41:35:

            > Unnsse Khan wrote:
            > > I can't believe that it won't work using
            > > "Command z" or "Control z",
            > > default, for that matter.
            > >
            > > Actually, I am using OS X's Mail and Microsoft's Entourage, I just
            told
            > > everyone that I was
            > > using MS Outlook, because I didn't want to complicate matters. Its
            > > unfortunate that I have to
            > > use pico to copy and paste different things. I usually use gvim for
            > > everything.
            >
            > I still don't know why whatever mail client you are using (and if it
            > isn't Outlook, then what is it? With wrong information you won't get the
            > right anwer: garbage in, garbage out, as computer programmers used to
            > say) -- why you mail client doesn't read the clipboard data properly.
            >
            >
            > Best regards,
            > Tony.

            Hi Tony,

            I think what he questions is that why cmd-z is not undo by default...

            But I don't think cmd-z should be the default, (so that I can use the
            _same_ vim in all platforms.)

            For the paste, I think what he questions is that the cmd-z in vim cannot be
            pasted into his mail client.

            And I don't think non-printable characters like cmd-z should be pasted into
            mail client "as is".

            Right?
          • Manu Anand
            ... Hi Unnsse: I think the problem is that VIM for Windows sources mswin.vim behind ur back. The idea is that the behavious should be consistent with other
            Message 5 of 7 , Jun 6, 2005
            • 0 Attachment
              On 6/6/05, panshizhu@... <panshizhu@...> wrote:
              > "A. J. Mechelynck" <antoine.mechelynck@...> wrote on 2005-06-06
              > 11:41:35:
              >
              > > Unnsse Khan wrote:
              > > > I can't believe that it won't work using
              > > > "Command z" or "Control z",
              > > > default, for that matter.

              Hi Unnsse:

              I think the problem is that VIM for Windows sources mswin.vim behind
              ur back. The idea is that the behavious should be consistent with
              other Windows apps.

              You can source this file from the distribution incase you are missing
              those shortcuts..

              HTH
              Manu



              > > >
              > > > Actually, I am using OS X's Mail and Microsoft's Entourage, I just
              > told
              > > > everyone that I was
              > > > using MS Outlook, because I didn't want to complicate matters. Its
              > > > unfortunate that I have to
              > > > use pico to copy and paste different things. I usually use gvim for
              > > > everything.
              > >
              > > I still don't know why whatever mail client you are using (and if it
              > > isn't Outlook, then what is it? With wrong information you won't get the
              > > right anwer: garbage in, garbage out, as computer programmers used to
              > > say) -- why you mail client doesn't read the clipboard data properly.
              > >
              > >
              > > Best regards,
              > > Tony.
              >
              > Hi Tony,
              >
              > I think what he questions is that why cmd-z is not undo by default...
              >
              > But I don't think cmd-z should be the default, (so that I can use the
              > _same_ vim in all platforms.)
              >
              > For the paste, I think what he questions is that the cmd-z in vim cannot be
              > pasted into his mail client.
              >
              > And I don't think non-printable characters like cmd-z should be pasted into
              > mail client "as is".
              >
              > Right?
              >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.