How do I set the default window size in vim?



As an IT administrator, you may find yourself needing to set the default window size in Vim, the popular text editor. Setting the default window size in Vim can be useful for ensuring that all users have a consistent experience when using the editor and for making sure that users don’t miss important information when working with text files.

To set the default window size in Vim, you will first need to open the Vim configuration file. This file is located in the user’s home directory and is named .vimrc. If the file does not already exist, you can create it. Once you have the file open, you can add the following lines of code:

set lines=
set columns=

The and fields should be replaced with numbers that reflect the size of the window that you want to set as the default. For example, to set the window size to 80 columns by 24 lines, you would enter ‘set lines=24’ and ‘set columns=80’.

Once you have added the lines to the configuration file, you can save the file and close it. The next time Vim is opened, the default window size should be set to the size that you specified in the configuration file.

It is important to note that the window size set in the configuration file will only be applied to new windows opened in Vim. If you wish to apply the new window size to existing windows, you can run the command ‘:set lines=’ and ‘:set columns=’ for each window.

In addition to setting the default window size, you may also want to set other options in the configuration file. These options can be used to customize the look and feel of the editor, as well as to set various preferences. For instance, you can set the color scheme, font size, and line spacing. You can also set options such as ‘set ruler’ to enable the display of line numbers.

In conclusion, setting the default window size in Vim can be a useful way to ensure that all users have a consistent experience when using the editor. Setting the window size in the configuration file is a simple process that requires adding a few lines of code. Once the configuration file has been saved, the next time Vim is opened, the default window size should be set to the size that you specified. Additionally, you can customize the look and feel of the editor by setting other options in the configuration file.

Inquire Now

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Find your next full or part-time role here

ScaleDesk can either help you find your next full time gig or a part time side gig where you can create extra income!

Onboard with us once
Skip HR screening and go to the final interview with with only your resume and a video interview you never have to redo
Get paid electronically every month for the hours you work
We will be your reference even if you work for us once

IT Teams: Use ScaleDesk to augment your team

Schedule Demo