From 53db9402916822e673b3b49fcba26537e2416b59 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Wed, 20 Jan 2021 11:08:00 +0800 Subject: More QoL changes * basic.el (auto-fill-function): Hide auto-fill-function from the mode line. (auto-revert-mode): Hide auto-revert-mode from the mode line. * common.el (durand-hide-minor-mode): Use a simple macro to facilitate hiding. * elisp.el (eldoc-mode): Use a macro to hide instead. * eww-conf.el (eww-bookmarks-directory): Start Configuring EWW. * init.el ("durand-simple"): My simple utilities. ("search-conf.el"): Configuring searching. * search-conf.el (search-whitespace-regexp): White space as wild cards (isearch-lax-whitespace): as above (isearch-lazy-count): Count the matches (isearch-allow-scroll): Scrolling while searching (durand-search-replace-symbol): For quick refactoring * text-conf.el (assq): Hide using the macro instead. --- basic.el | 12 ++++++++++++ common.el | 7 +++++++ elisp.el | 2 +- eww-conf.el | 19 +++++++++++++++++++ init.el | 13 +++++++++++++ search-conf.el | 25 +++++++++++++++++++++++++ text-conf.el | 5 ----- 7 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 eww-conf.el create mode 100644 search-conf.el diff --git a/basic.el b/basic.el index 97b5345..7a53334 100644 --- a/basic.el +++ b/basic.el @@ -203,6 +203,16 @@ I stole from Protesilaos' dotemacs.") (set 'adaptive-fill-mode t) (add-hook 'text-mode-hook #'auto-fill-mode) +;;; Hide auto-fill mode in the mode line. + +;; The original value is " Fill" +(durand-hide-minor-mode auto-fill-function) + +;;; Hide auto-revert-mode + +;; The original is auto-revert-mode-text +(durand-hide-minor-mode auto-revert-mode) + ;;; enable all commands (set 'disabled-command-function nil) @@ -221,6 +231,7 @@ I stole from Protesilaos' dotemacs.") (define-key global-map (vector ?\s-o) #'other-window) (define-key global-map (vector ?\s-&) #'delete-other-windows) (define-key global-map (vector ?\s-à) #'delete-window) +(define-key global-map (vector ?\C-+) #'enlarge-window) (define-key global-map (vector ?\s-f) #'find-file) (define-key global-map (vector ?\s-v) #'durand-focus-completion-or-minibuffer) @@ -240,3 +251,4 @@ The remaining CONFIGS are evaluated after the package is loaded." (expand-file-name ,package-path ,package-dir)) (require ,package-name) ,@configs)) + diff --git a/common.el b/common.el index 21ba10d..b19a85a 100644 --- a/common.el +++ b/common.el @@ -64,6 +64,13 @@ (user-error "You pressed an intentionally disabled key-binding: %s" (key-description (this-command-keys-vector)))) +;;; Hide some minor mode from the mode line display. + +;;;###autoload +(defmacro durand-hide-minor-mode (minor) + "Hide MINOR from the mode line." + `(setcdr (assq ',minor minor-mode-alist) (list ""))) + (provide 'common) ;;; common.el ends here. diff --git a/elisp.el b/elisp.el index f9a893b..17ff506 100644 --- a/elisp.el +++ b/elisp.el @@ -3,7 +3,7 @@ ;;; Hide Eldoc in the mode line ;; The original value is eldoc-minor-mode-string -(setcdr (assq 'eldoc-mode minor-mode-alist) (list "")) +(durand-hide-minor-mode eldoc-mode) ;;; fontification of extra keywords in emacs lisp files diff --git a/eww-conf.el b/eww-conf.el new file mode 100644 index 0000000..45c1351 --- /dev/null +++ b/eww-conf.el @@ -0,0 +1,19 @@ +;;; eww-conf.el --- My configurations for Emacs Web Wowser -*- lexical-binding: t; -*- + +;;; Author: Durand +;;; Created: 2021-01-20 + +;;; Commentary: + +;; Simply configurations for the great Emacs Web Wowser + +;;; Code: + +(setq eww-bookmarks-directory load-file-directory) + + + + +(provide 'eww-conf) + +;;; eww-conf.el ends here diff --git a/init.el b/init.el index 1b4c8e5..98d0b88 100644 --- a/init.el +++ b/init.el @@ -171,6 +171,10 @@ If FUNCTION-NAME is already a valid function, this won't do anything." (define-key global-map (vector 3 103) 'magit) +;;; eww + +(load-config "eww-conf.el") + ;;; Viewing things (load-config "view-conf.el") @@ -183,6 +187,15 @@ If FUNCTION-NAME is already a valid function, this won't do anything." (define-key global-map (vector ?\s-q) #'window-toggle-side-windows) +;;; My simple utilities + +(use-package "durand-simple" 'durand-simple + (define-key global-map (vector ?\C-\M-\s) #'durand-simple-mark-dwim)) + +;;; Searches + +(load-config "search-conf.el") + ;;; server ;; (cond diff --git a/search-conf.el b/search-conf.el new file mode 100644 index 0000000..bb8297b --- /dev/null +++ b/search-conf.el @@ -0,0 +1,25 @@ +;;; search-conf.el --- My configurations for searching -*- lexical-binding: t; -*- + +(setq search-whitespace-regexp ".*?") +(setq isearch-lax-whitespace t) +(setq isearch-lazy-count t) +(setq isearch-allow-scroll 'unlimited) + +;;;###autoload +(defun durand-search-replace-symbol (&optional arg) + "Search the symbol at point and query-replace. + +If ARG is negative, replace backwards." + (interactive "p") + (isearch-forward-symbol-at-point arg) + (isearch-query-replace-regexp (cond ((< arg 0) arg)))) + +(define-key global-map (vector ?\M-s ?%) #'durand-search-replace-symbol) + + + + + +(provide 'search-conf) + +;;; search-conf.el ends here diff --git a/text-conf.el b/text-conf.el index 46d8fa3..1fe9696 100644 --- a/text-conf.el +++ b/text-conf.el @@ -2,11 +2,6 @@ (require 'text-mode) -;;; Hide auto-fill mode in the mode line. - -; The original value is " Fill" -(setcdr (assq 'auto-fill-function minor-mode-alist) (list "")) - ;;;###autoload (defvar insert-section-heading-history nil "The history of inserted section heading strings") -- cgit v1.2.3-18-g5258