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

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

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"

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.

None yet

4 participants