Categories: Web and IT News

Vim split to a specific size

Vim supports two kinds of splits: vertical (:vsplit) and horizontal (:split). You can open any file in a split by calling :split path/to/file or :vsplit path/to/file. By default, the full width or height of the current buffer will be divided in two. The new split will take up 50% of the available real estate, and the existing will be reduced to 50% of its original size.

But! Vim has a way to open splits to a specific size: By prepending a number to a split command, that split will be opened to the exact character width or height you specify. For example: :20

Sponsored
vsplit path/to/file will open a split that is exactly 20 characters wide, instead of 50% of the current width.

Note that the number includes the line numbers, gutter, and bar between buffers. For a vertical split, 4 characters will typically be lost to that space.

You can enter this with or without the space between the number. For example: :30split path/to/file and :30 split path/to/file will do the same thing.

Sponsored

We have written a ton about splits, so be sure to check the archives. Our post about resizing slits will come in handy paired with this tip.

The post Vim split to a specific size appeared first on VimTricks.

Vim split to a specific size first appeared on Web and IT News.

awnewsor

Recent Posts

Parvis Reports Q2 Fiscal Quarter 2026

Parvis Reports Q2 Fiscal Quarter 2026 Delivering QoQ revenue growth and significant platform expansion Vancouver,…

3 hours ago

Metavista3D Reports Strong Q3 Financial Results with 100% Revenue Growth

Metavista3D Reports Strong Q3 Financial Results with 100% Revenue Growth Vancouver, British Columbia–(Newsfile Corp. –…

6 hours ago

CORRECTION FROM SOURCE: Enablence Technologies Announces First Quarter 2026 Financial Results

CORRECTION FROM SOURCE: Enablence Technologies Announces First Quarter 2026 Financial Results THIS PRESS RELEASE CORRECTS…

6 hours ago

ALUULA and Airseas Ensure ALUULA’s Composite Fabrics for Seawing Kite for Cargo Vessels to Move Towards Decarbonization

ALUULA and Airseas Ensure ALUULA’s Composite Fabrics for Seawing Kite for Cargo Vessels to Move…

9 hours ago

10 Best Gigantamax Pokémon GO: Raids, Weakness and Get – New Guide from PoGoskill

NEW YORK and HONG KONG, Dec. 2, 2025 (PRESSRELEASECC.COM NEWSWIRE) — With the latest in-game…

9 hours ago

Datadog Launches Bits AI SRE Agent to Resolve Incidents Faster

Datadog Launches Bits AI SRE Agent to Resolve Incidents Faster Bits AI SRE is an…

9 hours ago

This website uses cookies.