Better bindings. Use ibuffer.

This commit is contained in:
Love 2025-01-30 12:55:58 +01:00
parent ed4bfe44c2
commit 18ad943003

60
.emacs
View File

@ -94,6 +94,7 @@
;; If we cannot detect the theme, default to light
(load-theme light-theme t)))))
;; Apply theme at startup
(my/set-theme-based-on-appearance)
@ -101,6 +102,9 @@
;; UI Customizations
;; ===========================
;; Use ibuffer, instead of Buffer-menu-mode.
(global-set-key (kbd "C-x C-b") 'ibuffer)
;; Replace yes-no prompts to y-n
(defalias 'yes-or-no-p 'y-or-n-p)
@ -169,28 +173,64 @@
(use-package evil
:ensure t
:init
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
(setq evil-want-integration t
evil-want-keybinding nil)
:config
(evil-mode 1)) ;; Enable Evil Mode globally
(evil-mode 1)
;; Force modes to start in Emacs state
(dolist (mode '(;;Buffer-menu-mode
;;ibuffer-mode
dired-mode
help-mode
bookmark-bmenu-mode
gnus-summary-mode
gnus-group-mode
package-menu-mode))
(evil-set-initial-state mode 'emacs))
;; Correct keybindings for minibuffer maps using actual keymap objects
(dolist (keymap '(minibuffer-local-map
minibuffer-local-ns-map
minibuffer-local-completion-map
minibuffer-local-must-match-map
minibuffer-local-isearch-map))
(define-key (symbol-value keymap) [escape] 'minibuffer-keyboard-quit))
;; Set escape to quit in Evil states
(with-eval-after-load 'evil-maps
(define-key evil-normal-state-map [escape] 'keyboard-quit)
(define-key evil-visual-state-map [escape] 'keyboard-quit))
(keymap-global-set "C-u" 'evil-scroll-up))
(use-package evil-collection
:init
:after evil
:ensure t
:config
(evil-collection-init))
(keymap-global-set "C-u" 'evil-scroll-up)
(defun my/buffer-menu-evil-fix ()
"Disable Evil's C-n and C-p in `Buffer-menu-mode'."
(evil-define-key 'normal Buffer-menu-mode-map
(kbd "C-n") nil
(kbd "C-p") nil))
(add-hook 'buffer-menu-mode-hook #'my/buffer-menu-evil-fix)
;; ===========================
;; Additional Packages
;; ===========================
;; Install and enable Helm
(use-package helm
:config
(helm-mode 1))
;; Skip helm for now, since it interferes with evil
;;(use-package helm
;;:ensure t
;;:init
;;(setq helm-display-function #'helm-default-display-buffer) ;; Fix potential display issues
;;:config
;;(helm-mode 1)
;;(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ;; Better navigation
;;(define-key helm-map (kbd "C-z") 'helm-select-action)) ;; Show actions list
;; Install and enable Company Mode globally
(use-package company
@ -297,7 +337,7 @@
;; If there is more than one, they won't work right.
'(helm-minibuffer-history-key "M-p")
'(package-selected-packages
'(rainbow-delimiters rainbow-delimiter catppuccin-theme lsp-pyright zenburn-theme which-key solarized-theme rust-mode projectile poetry magit lsp-ui lsp-treemacs kotlin-mode helm flycheck evil-collection dracula-theme company better-defaults)))
'(helm-evil rainbow-delimiters rainbow-delimiter catppuccin-theme lsp-pyright zenburn-theme which-key solarized-theme rust-mode projectile poetry magit lsp-ui lsp-treemacs kotlin-mode helm flycheck evil-collection dracula-theme company better-defaults)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.