Skip to content

Commit

Permalink
chore(gui-settings): more annotations and minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jint-lzxy committed Oct 23, 2023
1 parent 87066d7 commit 2562799
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
10 changes: 4 additions & 6 deletions lua/core/init.lua
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -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

Expand Down
22 changes: 13 additions & 9 deletions lua/core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, boolean|number|string>
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")

0 comments on commit 2562799

Please sign in to comment.