-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to change the font size if you're using init.lua (lua environment) and not .vimrc file #1211
Comments
Hi! You can do so with the VimScript: set guifont=Source_Code_Pro:h12:#h-slight Lua: vim.o.guifont = "Source Code Pro:h12:#h-slight" A few things to note:
Original misinformed comment from longer agoThe option Neovide uses for this is builtin in NeoVim, it's called `guifont`. So that has nothing to do with Neovide itself. According to `:h lua-vim-opt`, you could just usevim.opt.guifont = { "Source Code Pro", "h12" } EDIT: Probably where |
I know about
Still the font size doesn't change Then I read for fonts to work properly and not breaking, you need to use Here's the init.lua file
|
That's truly difficult to tell, as any of those imported files could contain a new value for |
I'd be surprised if this works. We currently parse the guifont manually, and I don't know how lua objects get converted. I use vim.o.guifont = "Cascadia Code PL,Delugia Nerd Font:h11" in my config. (I think thats right. I'm translating from fennel and don't remember precisely what the lua syntax is). If you wanted to make this dynamic, or bind to a function, I'd achieve that with string concatenation. |
Well, I just followed the example in |
@MultisampledNight your code |
For those who did this, and see font family setting both works in nvim and neovide, but the font size setting doesn't work for neovide, add a vim.opt.guifont = { "Source Code Pro", ":h12" } |
@alai Thank you <3 |
this was exactly my problem! no matter what I did neovide was just HUGE all the time and I was racking my brain but this does the trick! |
👍 Thanks, this worked for me! |
On Win10 I had to use an "_" in place of spaces and the colon in the height to make it work. vim.opt.guifont = { "JetBrains_Mono", ":h10" } |
On neovim-qt on Windows 11, this worked: Note the unescaped space, and having to set the height option as a colon-separated element in the string. vim.opt.guifont didn't work, although it would have looked prettier IMO. |
I wanted to use Neovide but am not using standard .vimrc file.
my source file is a lua file.
Can we get a feature to edit fonts in lua environment.
Neovide
The text was updated successfully, but these errors were encountered: