diff --git a/init/basics/ui.el b/init/basics/ui.el index c0d4e13..f7add30 100644 --- a/init/basics/ui.el +++ b/init/basics/ui.el @@ -1,29 +1,34 @@ ;;; ui.el --- Configure user interfaces. -*- lexical-binding: t; -*- -;; Time-stamp: <2019-10-15T12:17:42+00:00> +;; Time-stamp: <2019-11-09T17:19:20+00:00> ;;; Commentary: -;; * neotree. +;; * treemacs ;; * ivy + counsel. ;;; Code: -;; Show directory tree in a window. -(use-package neotree - :pin melpa ; <= 0.5.2 changes directory on file switch. +;; Directory tree. +(use-package treemacs :demand t - :after (all-the-icons) :custom - (neo-smart-open t) - (neo-show-updir-line t) ; Disabled by doom-themes? - (neo-window-width 40) - (neo-show-hidden-files t) - (neo-theme 'icons) + (treemacs-project-follow-cleanup t) :bind - ("" . neotree-show) - ("C-" . neotree-hide) + ("" . treemacs-select-window) ; Focus treemacs. + ("C-" . treemacs) ; Toggle treemacs. + ("M-" . treemacs-add-and-display-current-project) ; Add current project. + (:map treemacs-mode-map + ("" . treemacs-single-click-expand-action)) + ) + +(use-package treemacs-projectile + :after (treemacs projectile) + ) + +(use-package treemacs-magit + :after (treemacs magit) ) ;; Completion in many Emacs commands. diff --git a/init/programming/common.el b/init/programming/common.el index b11296c..4464a32 100644 --- a/init/programming/common.el +++ b/init/programming/common.el @@ -1,6 +1,6 @@ ;;; common.el --- Common programming settings. -*- lexical-binding: t; -*- -;; Time-stamp: <2019-10-14T15:06:34+00:00> +;; Time-stamp: <2019-11-09T17:48:35+00:00> ;;; Commentary: @@ -100,16 +100,29 @@ ;; Automatic project management. (unless slow-computer (use-package projectile - :after (neotree ivy) + :after (treemacs ivy) :init (defvar my/cmake-compile-command ; cmake command for compiling with 1 (concat "cmake --build . -- -j" ; core less than available. (substring (shell-command-to-string "nproc --ignore=1") 0 -1))) + (defun my/switch-project () + "Add project to treemacs." + (treemacs-add-and-display-current-project) + (treemacs-collapse-other-projects)) + + (defun my/projectile-kill-buffers () + "Kill project buffers and remove project from treemacs." + (interactive) + (projectile-kill-buffers) + (let ((current-prefix-arg (projectile-project-name))) + (treemacs-remove-project-from-workspace))) + :custom (projectile-project-compilation-dir "build") - (projectile-switch-project-action 'neotree-projectile-action) + ;; (projectile-switch-project-action 'neotree-projectile-action) + (projectile-switch-project-action 'my/switch-project) (projectile-project-configure-cmd "cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -GUnix\\ Makefiles ..") @@ -126,6 +139,8 @@ :bind ("C-c p" . 'projectile-command-map) + (:map projectile-command-map + ("k" . 'my/projectile-kill-buffers)) ) ) ; unless slow-computer.