Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

tonysm
Copy link
Contributor

@tonysm tonysm commented Sep 9, 2024

Changelog

  • Removes the base lazyvim.json
  • Enable the LazyVIM extras plugin when the language is installed

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.

@tonysm tonysm mentioned this pull request Sep 9, 2024
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
Copy link
Member

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.

Copy link
Contributor Author

@tonysm tonysm Feb 5, 2025

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.

Copy link
Contributor Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants