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

Re: Maximizing (or Zooming) Carbon Vim?

Expand Messages
  • Matthew J. Stott
    Windows GUI and Mac OS X GUI are quite a bit different. One thing is maximizing. OS X really doesn t have a full maximize feature. Some apps will resize to
    Message 1 of 3 , Jan 12, 2005
    • 0 Attachment
      Windows GUI and Mac OS X GUI are quite a bit different. One thing is
      maximizing.
      OS X really doesn't have a full maximize feature. Some apps will
      resize to some form
      of an optimum (fit the whole page, etc.) that may not be full screen.
      Carbon ViM defaults
      to setting max height but it won't change the width of the window.
      Other apps like
      iTunes will turn from a compact mode to the last window size. It's a
      bit strange for
      Windows users at first (me included).

      What you can do with Carbon ViM is to define the
      :winsize {width} {height} - Based on font characters
      :winpos {x} {y} - Based on pixels

      Attributes within the .gvimrc file. (these only work with the Carbon
      ViM and not the
      console ViM).

      You will need to experiment with the settings a bit. Just open up vim
      and look-up
      the help for winsize and winpos. Note, you can use the short form of
      win and winp
      respectively. Remember there is command history in ViM so you can
      press the
      up arrow to pull up the last command issued. Note, you can and probably
      will place
      the Carbon ViM window off the screen using winp settings. The zero
      point is really
      the first pixel point within the editor not counting the window
      titlebar, etc.
      So setting winp 0 0 will place the ViM title bar off the screen behind
      the Apple top
      most menu bar.

      Once you get values that work for your font and video mode, you can set
      the values
      within the .gvimrc file and ViM will default to that window layout
      every time you open it.

      With a little ViM scripting you might do things like only apply the
      winsize and winpos
      settings for a particular file type. i.e. when you edit say Java code
      but if you open a
      non-java file it will open the default window size and position or an
      alternative.
      (hint: search help for FileType & autocmd).

      Here's a first stab at it, that I just attempted, so bare with me...

      in .gvimrc
      -------------

      autocmd BufEnter *.rb exec('winsize 120 54 | winpos 25 55')

      in .vimrc
      -----------

      filetype on
      filetype plugin on

      The above code will change the winsize and winpos variables when I edit
      a Ruby file. You could probably set a BufLeave event as well.

      Now isn't ViM Cool? I am constantly amazed at what you can accomplish.
      Add into this the ability to run Perl, Python, Ruby, and TCL code from
      within ViM
      and the possibilities are almost endless!


      On Jan 12, 2005, at 6:42 PM, whiteinge.6276866@... wrote:

      > Hello everyone,
      >
      > I'm new to the list but have tried searching the archives
      > and the web (and the help pages) to no avail.
      >
      > Does anyone know of a way to
      > automatically maximize the Carbon version of Vim? Such as the 'au
      > GUIEnter
      > * simalt ~x' Windows method detailed in the gui-win32-maximized help
      > page.
      >
      > Cheers!
      >
      > - whiteinge
    • whiteinge.6276866@bloglines.com
      Matthew, Thanks a lot for the reply and the sample code! That did it. - whiteinge
      Message 2 of 3 , Jan 13, 2005
      • 0 Attachment
        Matthew,
        Thanks a lot for the reply and the sample code! That did it.
        -
        whiteinge
      Your message has been successfully submitted and would be delivered to recipients shortly.