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

gvimdiff and gvim 7 in windows

Expand Messages
  • Robert Cussons
    gvimdiff part: In my .vimrc I have the line: set columns=88 lines=80 because this is the size I want my gvim window to be when it opens, however as gvimdiff
    Message 1 of 7 , Jul 21, 2006
    • 0 Attachment
      gvimdiff part:

      In my .vimrc I have the line:

      set columns=88 lines=80

      because this is the size I want my gvim window to be when it opens,
      however as gvimdiff opens at least two buffers I would like it to open
      full screen, is there a way of getting this to happen?


      gvim 7 in windows part:

      I also use gvim at home, but there I use gvim 7 on windows instead of
      gvim 6.3 on debian. So I have a few questions:

      How do I use gvimdiff in windows?

      If I already have a gvim window open how do I launch a new separate
      instance of gvim from inside the first window (without having to go to
      the desktop and click the icon!)

      Sorry this is more of a windows question than gvim: On my linux machine
      running KDE I have Ctrl-Shift-G set up to launch gvim, is there a way to
      set a keyboard shortcut in Windows XP to do the same?

      Many thanks for any help,
      Rob.
    • Benji Fisher
      ... I have this in my vimrc file: diff to open with horizontal splits. if &diff au VimEnter * windo wincmd K if has( gui_running ) let &columns = &columns +
      Message 2 of 7 , Jul 21, 2006
      • 0 Attachment
        On Fri, Jul 21, 2006 at 01:19:56PM +0200, Robert Cussons wrote:
        > gvimdiff part:
        >
        > In my .vimrc I have the line:
        >
        > set columns=88 lines=80
        >
        > because this is the size I want my gvim window to be when it opens,
        > however as gvimdiff opens at least two buffers I would like it to open
        > full screen, is there a way of getting this to happen?

        I have this in my vimrc file:

        diff to open with horizontal splits.
        if &diff
        au VimEnter * windo wincmd K
        if has("gui_running")
        let &columns = &columns + &foldcolumn
        endif
        endif

        You could put whatever you want inside the test for diff mode. OTOH, I
        do not know how to maximize the window from a script, except when using
        W32. (Kluge: maximize, note the setting of 'lines' and 'columns', and
        then set to those values.)

        > gvim 7 in windows part:
        [snip]

        Maybe someone else can answer this.

        HTH --Benji Fisher
      • A.J.Mechelynck
        ... if &diff set lines=999 columns=999 else set lines=80 columns=88 endif Notes: 1. This doesn t work in Tiny-version vim, which treats everything from :if
        Message 3 of 7 , Jul 21, 2006
        • 0 Attachment
          Robert Cussons wrote:
          > gvimdiff part:
          >
          > In my .vimrc I have the line:
          >
          > set columns=88 lines=80
          >
          > because this is the size I want my gvim window to be when it opens,
          > however as gvimdiff opens at least two buffers I would like it to open
          > full screen, is there a way of getting this to happen?
          >
          >
          > gvim 7 in windows part:
          >
          > I also use gvim at home, but there I use gvim 7 on windows instead of
          > gvim 6.3 on debian. So I have a few questions:
          >
          > How do I use gvimdiff in windows?
          >
          > If I already have a gvim window open how do I launch a new separate
          > instance of gvim from inside the first window (without having to go to
          > the desktop and click the icon!)
          >
          > Sorry this is more of a windows question than gvim: On my linux machine
          > running KDE I have Ctrl-Shift-G set up to launch gvim, is there a way to
          > set a keyboard shortcut in Windows XP to do the same?
          >
          > Many thanks for any help,
          > Rob.
          >
          >

          if &diff
          set lines=999 columns=999
          else
          set lines=80 columns=88
          endif

          Notes:
          1. This doesn't work in Tiny-version vim, which treats everything from
          ":if" to ":endif" as a (recursive) comment.
          2. This won't work, of course, when running console Vim in a
          non-resizable console. If you don't want to ever try resizing a console
          Vim, you may either wrap it all within ":if has('gui_running') or move
          it to your gvimrc .
          3. This won't work when setting diff mode after starting Vim.


          Best regards,
          Tony.
        • panshizhu@routon.com
          ... If you want to maximize the window in Windows, here is the way: if has( gui_win32 ) NT Windows autocmd GUIEnter * :simalt ~x endif Note that it
          Message 4 of 7 , Jul 24, 2006
          • 0 Attachment
            Robert Cussons <r.cussons@...> wrote on 2006.07.21 19:19:56:
            > because this is the size I want my gvim window to be when it opens,
            > however as gvimdiff opens at least two buffers I would like it to open
            > full screen, is there a way of getting this to happen?
            >
            > gvim 7 in windows part:
            >
            > I also use gvim at home, but there I use gvim 7 on windows instead of
            > gvim 6.3 on debian. So I have a few questions:
            >
            > How do I use gvimdiff in windows?
            >
            > If I already have a gvim window open how do I launch a new separate
            > instance of gvim from inside the first window (without having to go to
            > the desktop and click the icon!)
            >
            > Sorry this is more of a windows question than gvim: On my linux machine
            > running KDE I have Ctrl-Shift-G set up to launch gvim, is there a way to
            > set a keyboard shortcut in Windows XP to do the same?
            >
            > Many thanks for any help,
            > Rob.

            If you want to maximize the window in Windows, here is the way:

            if has("gui_win32") " NT Windows
            autocmd GUIEnter * :simalt ~x
            endif

            Note that it should be wrapped inside an autocmd group, if you don't have
            any autocmd inside your .vimrc, here is the way:
            augroup vimrcEx
            autocmd!
            " put your autocmd here.
            augroup END

            About diff mode: I use the following to test for diff mode, but I forget
            why it works.
            let in_diff_mode = 0
            windo let in_diff_mode = in_diff_mode + &l:diff
            if in_diff_mode == 1
            " do something
            else
            " do something else
            endif

            About short-cut key for launch gvim? just create a shortcut on desktop or
            start menu, then right click to change the properties, the short cut key
            could be set there.

            --
            Sincerely, Pan, Shi Zhu. ext: 2606
          • A.J.Mechelynck
            ... :simalt ~x is language-dependent: the x is whatever hotkey activates Maximize on the Control menu. In French is is :simalt ~g with the g of
            Message 5 of 7 , Jul 24, 2006
            • 0 Attachment
              panshizhu@... wrote:
              > Robert Cussons <r.cussons@...> wrote on 2006.07.21 19:19:56:
              >> because this is the size I want my gvim window to be when it opens,
              >> however as gvimdiff opens at least two buffers I would like it to open
              >> full screen, is there a way of getting this to happen?
              >>
              >> gvim 7 in windows part:
              >>
              >> I also use gvim at home, but there I use gvim 7 on windows instead of
              >> gvim 6.3 on debian. So I have a few questions:
              >>
              >> How do I use gvimdiff in windows?
              >>
              >> If I already have a gvim window open how do I launch a new separate
              >> instance of gvim from inside the first window (without having to go to
              >> the desktop and click the icon!)
              >>
              >> Sorry this is more of a windows question than gvim: On my linux machine
              >> running KDE I have Ctrl-Shift-G set up to launch gvim, is there a way to
              >> set a keyboard shortcut in Windows XP to do the same?
              >>
              >> Many thanks for any help,
              >> Rob.
              >
              > If you want to maximize the window in Windows, here is the way:
              >
              > if has("gui_win32") " NT Windows
              > autocmd GUIEnter * :simalt ~x
              > endif

              ":simalt ~x" is language-dependent: the x is whatever hotkey activates
              "Maximize" on the Control menu. In French is is ":simalt ~g" with the g
              of "Agrandir".

              The following (in your vimrc) will maximize gvim on all platforms and
              leave console Vim untouched:

              if has("gui_running")
              set lines=9999 column=9999
              endif

              In some cases there may be a one-column and/or one-line difference with
              clicking the Maximize button.

              >
              > Note that it should be wrapped inside an autocmd group, if you don't have
              > any autocmd inside your .vimrc, here is the way:
              > augroup vimrcEx
              > autocmd!
              > " put your autocmd here.
              > augroup END
              >
              > About diff mode: I use the following to test for diff mode, but I forget
              > why it works.
              > let in_diff_mode = 0
              > windo let in_diff_mode = in_diff_mode + &l:diff
              > if in_diff_mode == 1
              > " do something
              > else
              > " do something else
              > endif
              >
              > About short-cut key for launch gvim? just create a shortcut on desktop or
              > start menu, then right click to change the properties, the short cut key
              > could be set there.
              >
              > --
              > Sincerely, Pan, Shi Zhu. ext: 2606
              >
              >
              >
              >
              >

              For diff mode, you need an external "diff.exe" program in your PATH. If
              you don't yet have a working one, I recommend the diff program from the
              GnuWin32 project at sourceforge.net.

              Once you have a working "diff" program, you can use

              gvim -d file1 file2

              to start in diff mode, or

              :e file1
              :vert diffsplit file2

              to set diff mode after starting Vim, or else

              :windo diffthis

              to establish diff mode between all current windows.

              To clear diff mode, use (e.g.) ":windo set nodiff".

              See
              :help -d
              :help 'diff'
              :help diff.txt



              To start another insance of gvim from within the first one, use

              :!gvim [options] [filename] ...

              The new instance will "fork" away from its caller, which won't get hung.



              Best regards,
              Tony.
            • Robert Cussons
              ... A very late reply to this, thanks for the diff mode tip that works great on Linux, I will try it on windows later. The short-cut key works, I had already
              Message 6 of 7 , Aug 1, 2006
              • 0 Attachment
                panshizhu@... wrote:
                > Robert Cussons <r.cussons@...> wrote on 2006.07.21 19:19:56:
                >
                >>because this is the size I want my gvim window to be when it opens,
                >>however as gvimdiff opens at least two buffers I would like it to open
                >>full screen, is there a way of getting this to happen?
                >>
                >>gvim 7 in windows part:
                >>
                >>I also use gvim at home, but there I use gvim 7 on windows instead of
                >>gvim 6.3 on debian. So I have a few questions:
                >>
                >>How do I use gvimdiff in windows?
                >>
                >>If I already have a gvim window open how do I launch a new separate
                >>instance of gvim from inside the first window (without having to go to
                >>the desktop and click the icon!)
                >>
                >>Sorry this is more of a windows question than gvim: On my linux machine
                >>running KDE I have Ctrl-Shift-G set up to launch gvim, is there a way to
                >>set a keyboard shortcut in Windows XP to do the same?
                >>
                >>Many thanks for any help,
                >>Rob.
                >
                >
                > If you want to maximize the window in Windows, here is the way:
                >
                > if has("gui_win32") " NT Windows
                > autocmd GUIEnter * :simalt ~x
                > endif
                >
                > Note that it should be wrapped inside an autocmd group, if you don't have
                > any autocmd inside your .vimrc, here is the way:
                > augroup vimrcEx
                > autocmd!
                > " put your autocmd here.
                > augroup END
                >
                > About diff mode: I use the following to test for diff mode, but I forget
                > why it works.
                > let in_diff_mode = 0
                > windo let in_diff_mode = in_diff_mode + &l:diff
                > if in_diff_mode == 1
                > " do something
                > else
                > " do something else
                > endif
                >
                > About short-cut key for launch gvim? just create a shortcut on desktop or
                > start menu, then right click to change the properties, the short cut key
                > could be set there.
                >
                > --
                > Sincerely, Pan, Shi Zhu. ext: 2606
                >
                >
                >

                A very late reply to this, thanks for the diff mode tip that works great
                on Linux, I will try it on windows later.

                The short-cut key works, I had already tried it, but I was trying to
                type in the box rather than press the keys themselves, DOH! The only
                problem is that if you already have a gvim session running all the
                shortcut key does is maximize it, but nevermind, in that case I will
                just use what Tony suggested: !gvim

                Thanks,
                Rob.
              • A.J.Mechelynck
                ... don t forget the initial colon ... Best regards, Tony.
                Message 7 of 7 , Aug 1, 2006
                • 0 Attachment
                  Robert Cussons wrote:
                  > panshizhu@... wrote:
                  >> Robert Cussons <r.cussons@...> wrote on 2006.07.21 19:19:56:
                  >>
                  >>> because this is the size I want my gvim window to be when it opens,
                  >>> however as gvimdiff opens at least two buffers I would like it to open
                  >>> full screen, is there a way of getting this to happen?
                  >>>
                  >>> gvim 7 in windows part:
                  >>>
                  >>> I also use gvim at home, but there I use gvim 7 on windows instead of
                  >>> gvim 6.3 on debian. So I have a few questions:
                  >>>
                  >>> How do I use gvimdiff in windows?
                  >>>
                  >>> If I already have a gvim window open how do I launch a new separate
                  >>> instance of gvim from inside the first window (without having to go to
                  >>> the desktop and click the icon!)
                  >>>
                  >>> Sorry this is more of a windows question than gvim: On my linux machine
                  >>> running KDE I have Ctrl-Shift-G set up to launch gvim, is there a way to
                  >>> set a keyboard shortcut in Windows XP to do the same?
                  >>>
                  >>> Many thanks for any help,
                  >>> Rob.
                  >>
                  >>
                  >> If you want to maximize the window in Windows, here is the way:
                  >>
                  >> if has("gui_win32") " NT Windows
                  >> autocmd GUIEnter * :simalt ~x
                  >> endif
                  >>
                  >> Note that it should be wrapped inside an autocmd group, if you don't have
                  >> any autocmd inside your .vimrc, here is the way:
                  >> augroup vimrcEx
                  >> autocmd!
                  >> " put your autocmd here.
                  >> augroup END
                  >>
                  >> About diff mode: I use the following to test for diff mode, but I forget
                  >> why it works.
                  >> let in_diff_mode = 0
                  >> windo let in_diff_mode = in_diff_mode + &l:diff
                  >> if in_diff_mode == 1
                  >> " do something
                  >> else
                  >> " do something else
                  >> endif
                  >>
                  >> About short-cut key for launch gvim? just create a shortcut on desktop or
                  >> start menu, then right click to change the properties, the short cut key
                  >> could be set there.
                  >>
                  >> --
                  >> Sincerely, Pan, Shi Zhu. ext: 2606
                  >>
                  >>
                  >>
                  >
                  > A very late reply to this, thanks for the diff mode tip that works great
                  > on Linux, I will try it on windows later.
                  >
                  > The short-cut key works, I had already tried it, but I was trying to
                  > type in the box rather than press the keys themselves, DOH! The only
                  > problem is that if you already have a gvim session running all the
                  > shortcut key does is maximize it, but nevermind, in that case I will
                  > just use what Tony suggested: !gvim
                  >
                  > Thanks,
                  > Rob.
                  >
                  >

                  don't forget the initial colon

                  :!gvim

                  Best regards,
                  Tony.
                Your message has been successfully submitted and would be delivered to recipients shortly.