From 2562799a288e449b698356b572f9c454f7c87412 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:24:10 +0800 Subject: [PATCH] chore(gui-settings): more annotations and minor cleanup --- lua/core/init.lua | 10 ++++------ lua/core/settings.lua | 22 +++++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lua/core/init.lua b/lua/core/init.lua index 43cdd6309..8343c74f8 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -1,5 +1,5 @@ -local global = require("core.global") local settings = require("core.settings") +local global = require("core.global") -- Create cache dir and data dirs local createdir = function() @@ -79,14 +79,12 @@ local leader_map = function() end local gui_config = function() - local config = settings.gui_config - vim.api.nvim_set_option_value("guifont", config.font_name .. ":h" .. config.font_size, {}) + vim.api.nvim_set_option_value("guifont", settings.gui_config.font_name .. ":h" .. settings.gui_config.font_size, {}) end local neovide_config = function() - local config = settings.neovide_config - for key, value in ipairs(config) do - vim.g["neovide_" .. key] = value + for name, config in ipairs(settings.neovide_config) do + vim.g["neovide_" .. name] = config end end diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 1d86594e6..fd44daf16 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -161,26 +161,30 @@ settings["treesitter_deps"] = { "yaml", } --- Settings for the neovim-guis like `neovide`, `neovim-qt`, etc. --- NOTE: Only supports the options listed below. +-- Set the options for neovim's gui clients like `neovide` and `neovim-qt` here. +-- NOTE: Currently, only the following options related to the GUI are supported. Other entries will be IGNORED. +---@type { font_name: string, font_size: number } settings["gui_config"] = { font_name = "JetBrainsMono Nerd Font", font_size = 12, } --- Settings for `neovide`. --- NOTE: Get the full configurable options: https://neovide.dev/configuration.html +-- Set the options specific to `neovide` here. +-- NOTE: You should remove the `neovide_` prefix (with trailing underscore) from all your entries below. +-- Check the below link for all supported entries: +-- https://neovide.dev/configuration.html +---@type table settings["neovide_config"] = { + no_idle = true, refresh_rate = 120, cursor_vfx_mode = "railgun", - no_idle = true, - cursor_animation_length = 0.03, - cursor_trail_length = 0.05, - cursor_antialiasing = true, cursor_vfx_opacity = 200.0, - cursor_vfx_particle_lifetime = 1.2, + cursor_antialiasing = true, + cursor_trail_length = 0.05, + cursor_animation_length = 0.03, cursor_vfx_particle_speed = 20.0, cursor_vfx_particle_density = 5.0, + cursor_vfx_particle_lifetime = 1.2, } return require("modules.utils").extend_config(settings, "user.settings")