From 5ad7502e8808fcd89e8c2c4af959d9d5cbc4a21b Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 31 Jul 2024 12:04:05 +0200 Subject: [PATCH] surround neovide settings with UIEnter event, helps remote connections --- lua/options.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lua/options.lua b/lua/options.lua index cea6b52..00b5ee8 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -92,12 +92,17 @@ vim.opt.sidescrolloff = 12 -- Set cursor pointer to block vim.opt.guicursor = 'n-v-i-c:block-Cursor' --- Options specifically targeted at Neovide -if vim.g.neovide then - vim.o.guifont = 'CaskaydiaCove Nerd Font Mono:h14' - vim.g.neovide_hide_mouse_when_typing = true - vim.g.neovide_cursor_animation_length = 0 - vim.g.neovide_cursor_trail_length = 0 -end +vim.api.nvim_create_autocmd('UIEnter', { + group = vim.api.nvim_create_augroup('SetGUISettings', { clear = true }), + callback = function() + -- Options specifically targeted at Neovide + if vim.g.neovide then + vim.o.guifont = 'CaskaydiaCove Nerd Font Mono:h14' + vim.g.neovide_hide_mouse_when_typing = true + vim.g.neovide_cursor_animation_length = 0 + vim.g.neovide_cursor_trail_length = 0 + end + end, +}) -- vim: ts=2 sts=2 sw=2 et