I want to enable counsel-projectile-mode by default.

I have added (counsel-projectile-mode) to .emacs file as per project's usage guide but it doesn't work; meaning projectile still uses ido for finding files and such) ...

But after the Emacs is open if i M-x counsel-projectile-mode twice to disable and re-enable it, from within emacs, it will start working. (meaning projectile will use counsel for finding files, instead of using ido)

Any idea what's wrong?

This is my .emacs file.


I'm not sure why you have both (counsel-projectile-mode) and (counsel-projectile-mode nil) in your .emacs file. Have you tried simply adding a hook to start (counsel-projectile-mode) when loading projectile? Delete (or comment out) the lines you currently have for counsel-projectile-mode and try this:

(add-hook 'projectile-mode-hook 'counsel-projectile-mode)
  • I added the one with nil for testing, after the first one wouldn't work ... (it didn't work with nil either) tried the hook but apparently it gets into some sort of loop ... and doesn't work either ... Jan 18 '20 at 18:49
  • I solved the problem, but not sure what's the deal, gonna make a bug report Jan 18 '20 at 18:53

Adding this to the .emacs file, solves the problem:

(add-hook 'emacs-startup-hook 'counsel-projectile-mode)

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.