;;; ui.el --- Configure user interfaces. -*- lexical-binding: t; -*- ;; Time-stamp: <2020-03-10T23:26:19+0100> ;;; Commentary: ;; * treemacs ;; * ivy + counsel. ;;; Code: ;; Directory tree. (use-package treemacs :pin melpa ; We need > 2.6 for lsp-treemacs. :demand t :after (display-line-numbers) :custom ((treemacs-project-follow-cleanup t) ; Collapse projects when leaving. (treemacs-silent-refresh t)) ; No log message on refresh. :bind (("" . treemacs-select-window) ; Focus treemacs. ("C-" . treemacs) ; Toggle treemacs. ("M-" . treemacs-add-and-display-current-project) (:map treemacs-mode-map ("" . treemacs-single-click-expand-action))) :hook (treemacs-mode . my/disable-line-numbers)) (use-package treemacs-projectile :after (treemacs projectile)) (use-package treemacs-magit :after (treemacs magit) :pin melpa) ; Compatibility with treemacs-vcs. ;; Completion in many Emacs commands. (use-package ivy :demand t :diminish ivy-mode :custom ((ivy-use-virtual-buffers t) (ivy-count-format "[%d/%d] ") (ivy-wrap t)) :config (ivy-mode 1) :bind (("C-c C-r" . ivy-resume) (:map ivy-minibuffer-map ("M-" . ivy-previous-history-element) ("M-" . ivy-next-history-element) ("S-" . ivy-immediate-done)))) ; Ignore completion. ;; Extensions for ivy (use-package counsel :after (ivy) :demand t :bind (("C-x C-f" . counsel-find-file) ("M-x" . counsel-M-x))) ;; Use icons in ivy. (use-package all-the-icons-ivy :after (all-the-icons counsel) :config (all-the-icons-ivy-setup)) ;; More information in ivy mini-buffers. (use-package ivy-rich ;; all-the-icons-ivy would override the ivy-rich switch-buffer improvements. :after (all-the-icons-ivy counsel) :config (ivy-rich-mode 1)) ;; Use icons in ivy-rich. (use-package all-the-icons-ivy-rich :after (all-the-icons ivy-rich) :config (all-the-icons-ivy-rich-mode 1)) (use-package ivy-purpose :after (window-purpose) :config (ivy-purpose-setup) :bind (:map purpose-mode-map ("C-x b" . ivy-switch-buffer))) (use-package counsel-projectile :after (projectile) :custom ((counsel-projectile-mode t) (projectile-switch-project-action 'my/switch-project)) :config (progn (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))))) ;; Shows tabs of all visible buffers per window. (when (>= emacs-major-version 27) (use-package tab-line :custom-face (tab-line ((t (:inherit ruler-mode-default)))) (tab-line-tab ((t (:inherit ruler-mode-default)))) (tab-line-tab-inactive ((t (:inherit tab-line-tab)))) (tab-line-tab-current ((t (:inherit tab-line-tab :background "grey10" :foreground "grey70")))) (tab-line-highlight ((t (:inherit tab-line-tab-current :foreground "white")))))) (provide 'basics/ui) ;;; ui.el ends here