-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
45 lines (38 loc) · 1.39 KB
/
init.lua
File metadata and controls
45 lines (38 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---All user settings, accessible via `vim.g.settings`.
---For defaults, refer to `lua/core/options.lua`.
---@class Settings
---@field wakatime WakatimeSettings
---@field github_copilot GithubCopilotSettings
---@field lsp LspSettings
---
---Settings for the Wakatime plugin.
---@class WakatimeSettings
---@field enabled boolean
---
---@class GithubCopilotSettings
---@field enabled boolean
---
---Settings for LSP servers.
---See also: `:help lspconfig-all` for a list of all pre-configured LSPs.
---@class LspSettings
---A table where keys are LSP server names and values are their config options.
---@field servers table<string, table>
local function load_settings_override()
local base_cfg_path = vim.fn.stdpath("config") .. "/.nvim-settings.lua"
local success, settings = pcall(dofile, base_cfg_path)
if success then
return settings
else
return nil
end
end
-- Load user settings override, if available
local settings_override = load_settings_override() or {}
-- Load default settings and merge with overrides, giving precedence to overrides
-- This ensures that any settings not specified in the override file will fall back to defaults,
-- preventing any possible nil access errors.
local default_settings = require("core.options")
local settings = vim.tbl_deep_extend("force", default_settings, settings_override)
---@type Settings
vim.g.settings = settings
require("johannfh")