1

I recently started using lsp-java and one of the packages it suggests is helm. The suggested changes to the .emacs file to do this is:

(use-package helm-lsp)
(use-package helm
    :config (helm-mode))

This obviously works to start helm mode.

This issue I have is if I open another buffer in another mode (say shell in shell-mode) it continues to use helm which I really don't like.

I have tried adding the helm-lsp and helm mode initializing into a function which in turn is loaded via a java-mode-hook:

(defun init-lsp-java-stuff ()
       (interactive)
       ...
       (use-package helm-lsp)
       (use-package helm
           :config (helm-mode))
       ...
)
...

(add-hook 'java-mode-hook 'init-lsp-java-stuff)

This works if I never enter java mode, but still after entering java mode all my other buffers have helm loaded.

What I want is for helm to ONLY be loaded for java-mode buffers, and NOT be loaded for buffers in any other mode.

0

Don't call helm-mode at all. Helm-mode does not introduce anything for lsp-java per se but IMO improves general emacs usability. You could use helm-lsp function without having helm-mode enabled.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.