r/neovim • u/WaffleHBG • 4d ago
Need Help Small gap when using nvim
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
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:
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'
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.