Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Add options to doom_config (#60) #62

Merged
merged 1 commit into from
Jul 15, 2021
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
7 changes: 7 additions & 0 deletions doom_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,13 @@ local nvim = {
-- end
-- }
functions = {},
-- Set custom options
-- @default = {}
-- example:
-- {
-- { ['shiftwidth'] = 4 }
-- }
options = {},
}
-- }}}

Expand Down
1 change: 1 addition & 0 deletions lua/doom/core/default/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ M.custom_options = function()
functions.load_custom_settings(config.nvim.functions, 'functions')
functions.load_custom_settings(config.nvim.mappings, 'mappings')
functions.load_custom_settings(config.nvim.global_variables, 'variables')
functions.load_custom_settings(config.nvim.global_options, 'options')
end

return M
4 changes: 4 additions & 0 deletions lua/doom/core/functions/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ M.load_custom_settings = function(settings_tbl, scope)
for var, val in pairs(settings_tbl) do
vim.g[var] = val
end
elseif scope == 'options' then
for var, val in pairs(settings_tbl) do
vim.opt[var] = val
end
end
end
end
Expand Down