-
Notifications
You must be signed in to change notification settings - Fork 543
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
Make the LazyVIM extras more modular based on the installed dev language #269
base: master
Are you sure you want to change the base?
Conversation
c94820f
to
46859d8
Compare
jq_extras="[${jq_extras%,}]" | ||
|
||
jq --argjson extras "$jq_extras" '.extras |= (. + $extras | unique)' ~/.config/nvim/lazyvim.json >"$temp_file" && | ||
mv "$temp_file" ~/.config/nvim/lazyvim.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than the temp file dance, I would just touch ~/.config/nvim/lazyvim.json first, then assume it's there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The temp file is used because we can't read and write to the same file in a pipeline, something to do with it using the same file descriptor. I tried here without the temp file, and the config file ended up empty.
However, I found some tricks to achieve this behavior, as described here. I've updated the code to use one of the tricks described there and it looks like it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(happy to revert it to use a tmp file, if you don't want to use this trick, btw)
Changelog
lazyvim.json
I started this work at #156 but it was mixed with changing PHP's default LSP on LazyVIM. I'll send a separate PR for that.