Emacs: Enable counsel-projectile everywhere.

Previous config was inconsistent.
This commit is contained in:
tastytea 2020-08-03 03:13:46 +02:00
parent 6c0dd5b147
commit 963bae0b9c

View File

@ -1,6 +1,6 @@
;;; ui.el --- Configure user interfaces. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-05-30T19:34:23+0200>
;; Time-stamp: <2020-08-03T03:13:27+0200>
;;; Commentary:
;; * treemacs
@ -89,18 +89,19 @@
(use-package counsel-projectile
:demand t
:after (projectile)
:custom ((counsel-projectile-mode t)
(projectile-switch-project-action 'my/switch-project))
:config (progn
;; I'm not exactly sure what I did here but it seems to work.
(defun my/counsel-projectile-switch-project-action (project)
"Call `my/switch-project'."
(let ((projectile-switch-project-action 'my/switch-project))
(counsel-projectile-switch-project-by-name project)))
(counsel-projectile-modify-action
'counsel-projectile-switch-project-action
'((add ("Y" my/counsel-projectile-switch-project-action
"open project in treemacs") 1)))))
"open project in treemacs") 1)))
;; Overwrite keybindings and so on.
(counsel-projectile-mode)))
;; Shows tabs of all visible buffers per window.
(when (>= emacs-major-version 27)