When editing Python files over tramp, elpy continues to use my local python distribution for completion, which is fine by be for what I need.

However, when editing C++, it uses clang output from the remote host and the round-trip is constantly hanging my editor. Right now I just manually disable company-mode, but I am wondering how I can include a hook that says, when editing C++ over tramp, turn off company-mode. Any ideas?

1 Answer 1


Completely untested:

 (lambda () (when (file-remote-p default-directory) (company-mode -1))))
  • 1
    you sir... rock
    – Vince W.
    Commented Mar 31, 2020 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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