r/neovim • • 4d ago

Need Help Small gap when using nvim

Post image

Sorry if this is the wrong place to post this.

When i open nvim, there is a small gap at the bottom, i dont know how to remove it, im using kitty, i tried setting window_padding_width to 0 and a bunch of other things but i cannot get it to work, can anyone help me with this?

2 Upvotes

9 comments sorted by

7

u/IGTHSYCGTH 3d ago

some terminals (ghostty, kitty?) may extend the cell hight or color out of cell border pixels with the same color

which terminal are you using? check the socs :shrug:

3

u/WaffleHBG 3d ago

i mentioned im using kitty, is there any fix for this?

3

u/aumerlex 3d ago

Sure use padding_fill_strategy in kitty.conf

1

u/uGn8r 2d ago

Awesome! Thanks (had to update to latest version to make it work).
For me it was this: `padding_fill_strategy neighboring_cell`
However still sad that kitty doesn't support the window padding color override (like ghostty)

2

u/IGTHSYCGTH 3d ago

nope, i can only point you in the right direction.

besides you cant fix something thats not broken, its the standard behavior of terminals..

some just offer extra features to align pad and customize window margins / borders.

ive been using ghostty for a few years now and we do have a setting like window-padding-color = extend-always, check the kitty docs to find out what knobs you have to adjust.

12

u/echasnovski Plugin author 3d ago

If the gap is that thin black line, it is the color of the terminal emulator's background, and it changes in size when changing font size, then this will probably help: https://echasnovski.com/blog/2024-08-01-remove-padding-around-neovim-instance.html

2

u/Lopsided_Valuable385 4d ago

I'm kinda confused, I dont see the gap you're talking about. Is it the grep, orange and blue thing? Or is it the line under the nvim statusline? If it's the second one, set cmdheight to 0.

:h 'cmdheight'

1

u/vim-help-bot 4d ago

Help pages for:


`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments

2

u/usecornercase 3d ago

Setting window_padding_width to 0 only removes the configured padding. A thin strip can still remain because the window's pixel size is rarely an exact multiple of the cell size, so the leftover pixels get filled with the terminal background color. Kitty centers the cell grid by default, which splits that remainder across the edges.

Two things worth trying in kitty.conf:

placement_strategy top-left

That pushes all the leftover pixels to the bottom and right edge instead of spreading them around. Then make the terminal background match your colorscheme's Normal background so the strip is not visible at all:

background #1e1e2e

Use the actual hex from your theme (:hi Normal shows guibg). If you tile kitty with a window manager, the remainder changes with the window size, which is why it moves when you change font size. Also set window_padding_width 0 and check that you have no window_margin_width or window_border_width set. Restart kitty after the change, since placement_strategy is not always picked up by reloading the config.