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

Dev Env Tweaks #156

Closed
wants to merge 7 commits into from
Closed

Dev Env Tweaks #156

wants to merge 7 commits into from

Conversation

tonysm
Copy link
Contributor

@tonysm tonysm commented Jun 18, 2024

Changed

  • Moves the Golang NeoVim extras plugin config to the dev env script (closer to choosing the lang)
  • Enables the PHP extras plugin in NeoVim (docs) when choosing PHP and define the LSP to intelephense instead of the default (phpactor) - intelephense is much less verbose, IMO, it's the one I prefer using myself and also the one I use in VSCode (there's a comparison here), I made a patch to LazyVim to support it (feat(extras): allow using intelephense instead of phpactor in php extras LazyVim/LazyVim#3691)
  • Enables the Typescript extras plugin (docs), which actually works for all JavaScript environments

@@ -9,10 +9,16 @@ for language in $languages; do
;;
Node.js)
mise use --global node@lts

# Enable the extras plugins in NeoVim
jq '.extras |= (. + ["lazyvim.plugins.extras.lang.typescript"] | unique)' ~/.config/nvim/lazyvim.json >tmp.json && mv tmp.json ~/.config/nvim/lazyvim.json

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

jq '.extras |= (. + ["lazyvim.plugins.extras.lang.php"] | unique)' ~/.config/nvim/lazyvim.json >tmp.json && mv tmp.json ~/.config/nvim/lazyvim.json

# Configure PHP's LSP to use intelephense instead of phpactor (default)
if ! grep -q 'php_lsp' ~/.config/nvim/lua/config/options.lua; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link

@csfh csfh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me. The only thing I would change is create a temporary file using mktemp and possibly a tiny refactor to re-use the mv $OMAKUB_LAZYVIM_TMP ~/.config/nvim/lazyvim.json at the end of the switch, since this seems to be a common statement in most of the cases anyway.

Using mktemp should ensure that we get a fresh clean file every time and there don't somehow end up using a corrupt or bad tmp.json (think other programs, or aborted executions).

OMAKUB_LAZYVIM_TMP=$(mktemp /tmp/omakub.XXXXXX)

...

rm "$OMAKUB_LAZYVIM_TMP"

@tonysm tonysm closed this Sep 2, 2024
@Kasui92
Copy link
Contributor

Kasui92 commented Sep 2, 2024

@tonysm
Oh no! I admit that I was hoping for a merge of this PR, especially to have modular nvim plugins based on the installed languages ​​and not with only golang by default (which I regularly have to disable).

@tonysm
Copy link
Contributor Author

tonysm commented Sep 3, 2024

@Kasui92 ahh, I thought I was the only one wanting this. 😅 Gonna submit another PR tonight then

@tonysm
Copy link
Contributor Author

tonysm commented Sep 9, 2024

@Kasui92 PR sent here: #269

@Kasui92
Copy link
Contributor

Kasui92 commented Sep 9, 2024

@tonysm TY!

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.

5 participants