Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How make Vim fill Terminal window

When running Vim in a Terminal, the vim window does not fill the entire screen space, which is very irritating when the terminal background color radically differs from vim's. Admittedly, one might want to keep them somewhat in sync, but given that I don't want that, how can I make vim stretch across the entire window? The screenshot below illustrates the problem.

enter image description here

like image 827
oarfish Avatar asked Nov 14 '14 19:11

oarfish


People also ask

How do I switch between NVIM and terminal?

Switching between Normal and Terminal modes Any time we want to switch back into Terminal mode, we can do so by pressing the i key. In a regular text buffer, we can use shift-A to insert at the end of a line, or shift-I to insert at the start of a line.

Can Vim be used as a terminal?

Vim can run terminal commands without leaving the text editor, open an instance of a terminal, work with shell environments, and other things depending on the use case.

What is Vim terminal mode?

Vim has a Terminal Mode! Why use this? Mainly because it saves you jumping to a separate terminal window. You can also use Vim commands to manipulate a shell session and easily transfer clipboard content between the terminal and files you're working on.


2 Answers

You have only two solutions:

  • give your terminal emulator's background and Vim's background the same color,

  • or remove Vim's background color.

Vim, your shell and every command-line program divide the screen in a grid of which every cell is the size of a character. If the GUI window's size in pixels doesn't fit your shell's grid size you get that ugly padding.

Example:

  • my cell size is 7x19 and my display is 1680x1050,
  • I can fit 240 columns and 55 lines but I will always have a 5 pixels padding at the bottom of the screen.

Additionally, most terminal emulators add a default padding around the usable screen to increase legibility so you will never be able to make Vim really full screen when run in a terminal emulator.

like image 79
romainl Avatar answered Oct 16 '22 17:10

romainl


It looks like your terminal allows resizing in increments less than a single row/column.

Vim, on the other hand, draws only complete rows or columns. The partially visible rows/columns in the terminal are therefore not being drawn when Vim displays its window.

like image 26
jamessan Avatar answered Oct 16 '22 17:10

jamessan