Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I right click on a file and open it in Vim, the default window size is too small. How can I change the settings so that the default window size is bigger?

I'm running Vim 7.3.46 in Windows 7.

share|improve this question
up vote 12 down vote accepted

You can set the 'lines' and 'columns' options in ~/.gvimrc (~/_gvimrc on Windows). E.g:

:set lines=35 columns=150

I don't recommend you do this in your vimrc, because setting those options in console Vim can have odd effects, if it works at all; the gvimrc is only loaded when gVim is started.

share|improve this answer
Might also want to make it a part of a GUIEnter autocmd. See also :h GUIEnter. – pottsdl May 1 '12 at 22:19

This page suggests adding the following to _vimrc for avoiding problems with console Vim:

if has("gui_running")
  " GUI is running or is about to start.
  " Maximize gvim window.
  set lines=999 columns=999
  " This is console Vim.
  if exists("+lines")
    set lines=50
  if exists("+columns")
    set columns=100

Also, this SO question looks at how to remember the previous session's window size.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .