Skip to content
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

feat: customized neovide and gui config #1033

Merged
merged 3 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions lua/core/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local global = require("core.global")
local settings = require("core.settings")

-- Create cache dir and data dirs
local createdir = function()
Expand Down Expand Up @@ -77,18 +78,16 @@ local leader_map = function()
vim.api.nvim_set_keymap("x", " ", "", { noremap = true })
end

local gui_config = function()
local config = settings.gui_config
vim.api.nvim_set_option_value("guifont", config.font_name .. ":h" .. config.font_size, {})
end

local neovide_config = function()
vim.api.nvim_set_option_value("guifont", "JetBrainsMono Nerd Font:h15", {})
vim.g.neovide_refresh_rate = 120
vim.g.neovide_cursor_vfx_mode = "railgun"
vim.g.neovide_no_idle = true
vim.g.neovide_cursor_animation_length = 0.03
vim.g.neovide_cursor_trail_length = 0.05
vim.g.neovide_cursor_antialiasing = true
vim.g.neovide_cursor_vfx_opacity = 200.0
vim.g.neovide_cursor_vfx_particle_lifetime = 1.2
vim.g.neovide_cursor_vfx_particle_speed = 20.0
vim.g.neovide_cursor_vfx_particle_density = 5.0
local config = settings.neovide_config
for key, value in ipairs(config) do
vim.g["neovide_" .. key] = value
end
end

local clipboard_config = function()
Expand Down Expand Up @@ -148,6 +147,7 @@ local load_core = function()
disable_distribution_plugins()
leader_map()

gui_config()
neovide_config()
clipboard_config()
shell_config()
Expand All @@ -158,8 +158,8 @@ local load_core = function()
require("core.event")
require("core.pack")

local colorscheme = require("core.settings").colorscheme
local background = require("core.settings").background
local colorscheme = settings.colorscheme
local background = settings.background
vim.api.nvim_command("set background=" .. background)
vim.api.nvim_command("colorscheme " .. colorscheme)
end
Expand Down
22 changes: 22 additions & 0 deletions lua/core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,26 @@ settings["treesitter_deps"] = {
"yaml",
}

-- Settings for the neovim-guis like `neovide`, `neovim-qt`, etc.
-- NOTE: Only supports the options listed below.
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
settings["neovide_config"] = {
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_vfx_particle_speed = 20.0,
cursor_vfx_particle_density = 5.0,
}

return require("modules.utils").extend_config(settings, "user.settings")