Vimr: Unknown option: guifont

Created on 27 Feb 2020  Â·  12Comments  Â·  Source: qvacua/vimr

For some reason, vimr recently started to complain about guifont option, and that doesn't happen if I use plain neovim:

Error detected while processing <path>/vim/vimfiles/init.vim:
line   69:
E518: Unknown option: guifont=Hasklig:h12

VimR version:

NVIM v0.4.3
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -mmacosx-version-min=10.13 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -I/Users/hat/.jenkins/workspace/vimr_build/NvimView/neovim/build/config -I/Users/hat/.jenkins/workspace/vimr_build/NvimView/neovim/src -I/Users/hat/.jenkins/workspace/vimr_build/NvimView/neovim/.deps/usr/include -I/Users/hat/.jenkins/workspace/vimr_build/NvimView/third-party/libintl/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Users/hat/.jenkins/workspace/vimr_build/NvimView/neovim/build/src/nvim/auto -I/Users/hat/.jenkins/workspace/vimr_build/NvimView/neovim/build/include
Compiled by [email protected]

Features: +acl +iconv -tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info

Most helpful comment

@kuntau not all fonts are available in the preferences panel.. anyone figure out how to get other fonts in preferences?

All 12 comments

You set vimr font on it's preference panel and not in init file unlike gvim

I'm running into this issue with VimR 0.32.0 as well, had to go back to 0.31.0 for now.

As far as I understand, here's what's going on: I'm using SpaceVim distribution, and it has some generic code in there that checks for gui_running flag and sets guifont to something (some of those checks were added specifically for VimR. This used to work fine in VimR up to 0.31.0 cause it did not have gui_running set so no issues with guifont either, but 0.32.0 break that logic as it has gui_running=true but has no guifont command supported. The sad part is it's not just guifont can't be set that way; the complete configuration fails to load now.

@kuntau not all fonts are available in the preferences panel.. anyone figure out how to get other fonts in preferences?

Any update on this issue? I'm using SpaceVim too and VimR becomes unusable now.

You can use my fork https://github.com/ncihnegn/vimr for such compatibility.

@ncihnegn does this allow us to select the font from the settings menu as well?

@ncihnegn does this allow us to select the font from the settings menu as well?

Yes.

not sure why but every time I run code_sign=false use_carthage_cache=false ./bin/build_vimr.sh i get this error: ### Building VimR target ./bin/build_vimr.sh: line 11: carthage_update: true or false

well its not really an error more so does nothing..

nvm fixed it.

SpaceVim 1.5.0 has merged a workaround for this VimR issue. I'm able to start SpaceVim 1.5.0 on the latest as-of-now VimR 0.33.1.

Neovim provides the guifont option even if run in a terminal simply because it's a default option that plugins can check for. IMO breaking plugins because "You set vimr font on it's preference panel and not in init file unlike gvim" is a giant no-go. MacVim also allows you to set the font on it's preference panel yet provides a working guifont option.

And just to be clear - I'm not talking about not being able to set guifont but about the fact that a default vim / nvim global is not available and there is no way for plugins to test for it or work around without specifically considering vimR.

[EDIT]
Created a pull request that implements scaffolding for future handling of more remote options as well as allowing the use of guifont in one-way fashion (setting it in your init.vim or via set works as intended and changes are reflected in VimR's preference panel too; the last set value con be read from guifont as expected). If the RPC allows it and I find the time required I might look into making it completely two-way so that the initial value of guifont reflects whatever is currently set in VimR's preferences.

[EDIT 2]
The initial before init.vim is executed as well as any changes via the Preferences are now properly reflected in the guifont variable.

Was this page helpful?
0 / 5 - 0 ratings