From 8a269b52e9a1b51d947fc685819cebd1b54d5ce9 Mon Sep 17 00:00:00 2001 From: pupbrained Date: Tue, 13 Aug 2024 00:54:31 -0400 Subject: [PATCH] update --- config/default.nix | 6 ++++++ config/init.el | 38 ++++++++++++++++++++++++++++++-------- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/config/default.nix b/config/default.nix index da399d3..0f2efb3 100644 --- a/config/default.nix +++ b/config/default.nix @@ -9,6 +9,12 @@ with pkgs; alwaysEnsure = true; alwaysTangle = true; + extraEmacsPackages = epkgs: + with epkgs; [ + treemacs + treemacs-evil + ]; + override = epkgs: epkgs // { diff --git a/config/init.el b/config/init.el index cf72951..24f2d4c 100644 --- a/config/init.el +++ b/config/init.el @@ -1,3 +1,6 @@ +; Fixes "Symbol's value as variable is void: personal-keybindings" error +(require 'bind-key) + ; Disable bars (menu-bar-mode -1) (scroll-bar-mode -1) @@ -19,12 +22,20 @@ (use-package emojify :hook (after-init . global-emojify-mode)) +; Undo tree +(use-package undo-tree + :demand t + :config + (global-undo-tree-mode) ;; Enable undo-tree mode globally + (setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))) ;; Directory for undo files + ; Evil mode (use-package evil :ensure t :init (setq evil-want-integration t) ;; This is optional since it's already set to t by default. (setq evil-want-keybinding nil) + (setq evil-undo-system 'undo-tree) :config (evil-mode 1)) @@ -41,14 +52,8 @@ :config (global-evil-leader-mode) (setq evil-leader/leader "") ;; Set the leader key to space - (evil-leader/set-key - "a" #'eglot-code-actions)) - -(use-package undo-tree - :demand t - :config - (global-undo-tree-mode) ;; Enable undo-tree mode globally - (setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))) ;; Directory for undo files + (evil-leader/set-key "a" #'eglot-code-actions) + (evil-leader/set-key "e" #'treemacs)) ; Dashboard (use-package dashboard @@ -57,6 +62,14 @@ (dashboard-setup-startup-hook) (setq dashboard-startup-banner 'logo)) +(defun dashboard-recentf-filter (file) + "Add to ~recentf-exclude~ to filter recent files in dashboard buffer." + (when (eq (get-buffer dashboard-buffer-name) + (current-buffer)) + (string-match "treemacs-persist$" file))) + +(add-to-list 'recentf-exclude 'dashboard-recentf-filter) + ; Direnv (use-package direnv :config @@ -120,3 +133,12 @@ (use-package eglot :hook (eglot-mode . sideline-mode)) ; enable it when eglot is on +; Centaur tabs +(use-package centaur-tabs + :demand t + :config + (centaur-tabs-mode t) + (setq centaur-tabs-style "wave") + :bind + ("C-" . centaur-tabs-backward) + ("C-" . centaur-tabs-forward))