From 01013aa6ce18ee2775f63d5e3808ae3d7bba1b58 Mon Sep 17 00:00:00 2001 From: pupbrained Date: Fri, 4 Oct 2024 21:40:04 -0400 Subject: [PATCH] some more improvements --- .gitignore | 5 ++- config.org | 110 +++++++++++++++++++++++++++++++++++++++++++++-------- init.el | 4 +- 3 files changed, 101 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index a29827d..8609e06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ -elpaca/ +auto-save-list/ eln-cache/ elpa/ +elpaca/ recentf transient/ undo/ +amx-items config.el +tramp diff --git a/config.org b/config.org index b81067b..68c5695 100644 --- a/config.org +++ b/config.org @@ -47,13 +47,37 @@ ** Dirvish #+begin_src emacs-lisp + (setq dired-omit-files + (rx (or (seq bol (? ".") "#") + (seq bol "." eol)))) + + (add-hook 'dired-mode-hook 'dired-omit-mode) + + (defun my/dirvish-create-file () + "Create a new file in the current directory." + (interactive) + (let ((new-file (read-file-name "New file name: " (dired-current-directory)))) + (if (file-exists-p new-file) + (message "File already exists!") + (write-region "" nil new-file) + (revert-buffer) ;; Refresh the directory listing + (message "File created: %s" new-file)))) + (use-package dirvish :ensure t - :config + :init (dirvish-override-dired-mode) + :config + (dirvish-peek-mode) (dirvish-side-follow-mode) + (setq dirvish-mode-line-format + '(:left (sort symlink) :right (omit yank index))) + (setq dired-listing-switches "-al --ignore='^\\.$' --human-readable --group-directories-first") (setq dired-mouse-drag-files t) - (setq mouse-drag-and-drop-region-cross-program t)) + (setq mouse-drag-and-drop-region-cross-program t) + (setq dirvish-subtree-state-style 'nerd) + (setq dirvish-attributes + '(vc-state subtree-state nerd-icons collapse git-msg file-time file-size))) ;; Addtional syntax highlighting for dired (use-package diredfl @@ -64,8 +88,10 @@ :config (set-face-attribute 'diredfl-dir-name nil :bold t)) - (use-package all-the-icons - :ensure t) + (use-package nerd-icons + :ensure t + :custom + (nerd-icons-font-family "Maple Mono NF")) (use-package ns-auto-titlebar :ensure t @@ -106,6 +132,7 @@ (global-evil-leader-mode) (setq evil-leader/leader "") (evil-leader/set-key "a" #'eglot-code-actions) + (evil-leader/set-key "bb" #'switch-to-buffer) (evil-leader/set-key "bd" #'kill-this-buffer) (evil-leader/set-key "e" #'dirvish-side)) @@ -146,11 +173,13 @@ (setq display-line-numbers-type 'relative) - (dolist (mode '(term-mode-hook - vterm-mode-hook - shell-mode-hook - dirvish-setup-hook - eshell-mode-hook)) + (dolist (mode + '(term-mode-hook + vterm-mode-hook + shell-mode-hook + org-mode-hook + dirvish-setup-hook + eshell-mode-hook)) (add-hook mode (lambda () (display-line-numbers-mode 0)))) #+end_src @@ -168,7 +197,7 @@ ((eq system-type 'darwin) (setq default-frame-alist '((font . "Iosevka Comfy-14")))) ((eq system-type 'gnu/linux) - (setq default-frame-alist '((font . "Maple Mono NF-12") + (setq default-frame-alist '((font . "Iosevka Comfy Medium-12") (undecorated . t))))) #+end_src @@ -178,6 +207,12 @@ (setq use-short-answers t) #+end_src +** Enable ctrl+c/ctrl+v + +#+begin_src emacs-lisp + (cua-mode 1) +#+end_src + ** Undo Tree #+begin_src emacs-lisp @@ -200,16 +235,59 @@ (setq dashboard-center-content t) (setq dashboard-vertically-center-content t) (setq dashboard-startup-banner 'logo) - (setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))) - (setq recentf-exclude '("~/.emacs.d/.cache/treemacs-persist"))) + (setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))) +#+end_src + +** Better M-x + +*** Ivy Mode (Completions) + +#+begin_src emacs-lisp + (setq ivy-ignore-buffers '("\\` " "\\`\\*")) + + (use-package ivy + :ensure t + :config + (ivy-mode) + (setq ivy-use-virtual-buffers t) + (setq enable-recursive-minibuffers t)) +#+end_src + +*** Amx Mode (Better Interface) + +#+begin_src emacs-lisp + (use-package amx + :ensure t + :config + (amx-mode)) #+end_src ** Ido Mode #+begin_src emacs-lisp - (setq ido-ignore-buffers - '("\\` " "^\*")) ;; Ignore buffers that start with a space or * + (set-face-attribute 'default nil :font "Iosevka Comfy-12") + (set-face-attribute 'fixed-pitch nil :font "Iosevka Comfy-12") + (set-face-attribute 'variable-pitch nil :font "Iosevka Comfy Motion Duo-14") - (ido-mode 1) - (ido-everywhere 1) + (dolist (face '(default fixed-pitch)) + (set-face-attribute `,face nil :font "Iosevka Comfy-12")) + + (use-package mixed-pitch + :hook + (org-mode . mixed-pitch-mode)) + + (add-hook 'org-mode-hook 'visual-line-mode) + + (setq org-ellipsis "…") + + (use-package org-modern + :ensure t + :hook (org-mode . org-modern-mode) + :config + (setq org-modern-star 'replace)) + + (use-package org-modern-indent + :ensure (org-modern-indent :type git :host github :repo "jdtsmith/org-modern-indent") + :config + (add-hook 'org-mode-hook #'org-modern-indent-mode 90)) #+end_src diff --git a/init.el b/init.el index caf3287..59431ae 100644 --- a/init.el +++ b/init.el @@ -1,3 +1,4 @@ +(setq elpaca-core-date '(20240911)) (defvar elpaca-installer-version 0.7) (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) @@ -38,7 +39,8 @@ (elpaca `(,@elpaca-order)) (elpaca elpaca-use-package - (elpaca-use-package-mode)) + (elpaca-use-package-mode) + (setq elpaca-use-package-by-default t)) (use-package emacs :ensure nil :config (setq ring-bell-function #'ignore))