Skip to content

Commit

Permalink
feat: move neovide config to settings.
Browse files Browse the repository at this point in the history
Signed-off-by: ayamir <[email protected]>
  • Loading branch information
ayamir committed Oct 21, 2023
1 parent 874b413 commit eef7aa6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
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
18 changes: 18 additions & 0 deletions lua/core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,22 @@ settings["treesitter_deps"] = {
"yaml",
}

settings["gui_config"] = {
font_name = "JetBrainsMono Nerd Font",
font_size = 12,
}

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")

0 comments on commit eef7aa6

Please sign in to comment.