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

How can I set copilot-mode enable by deafult in certain modes and disable in others? #306

Open
goodmorning-hwt opened this issue May 15, 2024 · 4 comments

Comments

@goodmorning-hwt
Copy link

How can I set copilot-mode enable by deafult in certain modes and disable in others?
Thanks in advance for any help!

@YueRen
Copy link

YueRen commented May 15, 2024

Depends strongly on how you are loading copilot in the first place. If you are using use-package, then check their readme, especially the passage where they explain how to use :mode (the python example there will make it so that python-mode is automatically activated when you open .py files).

@goodmorning-hwt
Copy link
Author

Depends strongly on how you are loading copilot in the first place. If you are using use-package, then check their readme, especially the passage where they explain how to use :mode (the python example there will make it so that python-mode is automatically activated when you open .py files).

I use spacemacs, and I do not know how spacemacs organize additional packages, I just copied the readme's instruction.😭

@goodmorning-hwt
Copy link
Author

	(add-hook 'prog-mode-hook 'my/disable-copilot-mode)
  (add-hook 'latex-mode-hook 'my/enable-copilot-m) 

I used these lines now to disable copilot in some mode. However, in this way, the Emacs starts the copilot first and then disable it, which I believe is unnecessary.

@tuliolima
Copy link

If you don't want copilot starting in prog-mode just remove the (add-hook 'prog-mode-hook 'my/disable-copilot-mode) line.

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

No branches or pull requests

3 participants