Skip to content

Commit

Permalink
fix: user_config handling #73
Browse files Browse the repository at this point in the history
  • Loading branch information
Allaman committed Feb 7, 2024
1 parent bc479a2 commit 5b095c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ FROM ${ARCH}allaman/nvim-full:latest
RUN mkdir -p .config/nvim \
&& mkdir -p .local/share/nvim/mason/packages \
## Create empty user config file
&& echo "return {}" > $HOME/.nvim_config.lua \
&& echo "return {}" > .nvim_config.lua \
## Add mason tools dir to path
&& echo "PATH=$PATH:$HOME/.local/share/nvim/mason/bin" >> $HOME/.bashrc
&& echo "PATH=$PATH:~/.local/share/nvim/mason/bin" >> ~/.bashrc

COPY --chown=nvim:nvim . .config/nvim

Check failure on line 12 in Dockerfile

View workflow job for this annotation

GitHub Actions / checks

DL3045 warning: `COPY` to a relative destination without `WORKDIR` set.
# Install plugins and tools with Mason and go.nvim
Expand Down
10 changes: 7 additions & 3 deletions lua/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ local function validate_config(config) end

local function init()
local user_config = utils.load_user_config()
validate_config(user_config)

-- Merge defaults and user config
vim.g.config = utils.merge_tables(require("config.defaults"), user_config)
if next(user_config) ~= nil then
validate_config(user_config)
-- Merge defaults and user config
vim.g.config = utils.merge_tables(require("config.defaults"), user_config)
else
vim.g.config = require("config.defaults")
end

-- configure vim.opt
for k, v in pairs(vim.g.config.options) do
Expand Down

0 comments on commit 5b095c7

Please sign in to comment.