Skip to content

Commit

Permalink
tweak: multiple minor tweaks and edits
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Nov 30, 2023
1 parent c09eca1 commit 229dd56
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 17 deletions.
32 changes: 22 additions & 10 deletions core/me-builtin.el
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ or file path may exist now."
(use-package transient
:straight t
;; Map ESC and q to quit transient
:bind (:map transient-map
:bind (:map
transient-map
("q" . transient-quit-one)
("<escape>" . transient-quit-one)))

Expand Down Expand Up @@ -280,9 +281,7 @@ or file path may exist now."
(use-package tab-bar
:hook (minemacs-after-startup . tab-bar-mode)
:custom
(tab-bar-format '(tab-bar-format-history
tab-bar-format-tabs
tab-bar-separator))
(tab-bar-format '(tab-bar-format-history tab-bar-format-tabs tab-bar-separator))
(tab-bar-tab-hints t)
(tab-bar-tab-name-format-function #'+tab-bar-tab-spaced-name-format)
(tab-bar-close-button-show nil)
Expand All @@ -291,7 +290,7 @@ or file path may exist now."
(defun +tab-bar-tab-spaced-name-format (tab i)
(let ((current-p (eq (car tab) 'current-tab)))
(propertize
(concat (if tab-bar-tab-hints (format " %c " (+ ?① (1- i)) " "))
(concat (if tab-bar-tab-hints (format " %c " (+ ?① (1- i))) "")
(alist-get 'name tab)
(or (and tab-bar-close-button-show
(not (eq tab-bar-close-button-show
Expand Down Expand Up @@ -319,7 +318,7 @@ or file path may exist now."
"ff" #'+flymake-transient)

(transient-define-prefix +flymake-transient ()
"Transient for dape."
"Transient for flymake."
[[("n" "Next error" flymake-goto-next-error :transient t)
("N" "Prev error" flymake-goto-prev-error :transient t)]
[("B" "Buffer diagnostics" flymake-show-buffer-diagnostics :transient t)
Expand Down Expand Up @@ -1240,6 +1239,18 @@ current line.")
:init
(+map! "gm" '(+smerge-hydra/body :wk "sMerge"))
:config
(defun +smerge-first ()
"Got to the first occurrence."
(interactive)
(goto-char (point-min))
(smerge-next))

(defun +smerge-last ()
"Got to the last occurrence."
(interactive)
(goto-char (point-max))
(smerge-prev))

(with-eval-after-load 'hydra
(defhydra +smerge-hydra (:hint nil
:pre (if (not smerge-mode) (smerge-mode 1))
Expand All @@ -1258,8 +1269,8 @@ current line.")
│ ^_G_^ [_q_] quit
╰─────────────────────────────────────────────────────╯
"
("g" (progn (goto-char (point-min)) (smerge-next)))
("G" (progn (goto-char (point-max)) (smerge-prev)))
("g" +smerge-first)
("G" +smerge-last)
("C-j" smerge-next)
("C-k" smerge-prev)
("j" next-line)
Expand Down Expand Up @@ -1628,7 +1639,7 @@ Useful for quickly switching to an open buffer."
(use-package pulse
:init
;; Add visual pulse when changing focus, like beacon but built-in
;; From https://karthinks.com/software/batteries-included-with-emacs/
;; From: https://karthinks.com/software/batteries-included-with-emacs/
(defun +pulse-line (&rest _)
"Pulse the current line."
(pulse-momentary-highlight-one-line (point)))
Expand All @@ -1637,7 +1648,8 @@ Useful for quickly switching to an open buffer."

(use-package isearch
;; Scroll in isearch history using UP/DOWN or C-j/C-k
:bind (:map isearch-mode-map
:bind (:map
isearch-mode-map
("C-k" . isearch-ring-retreat)
("C-j" . isearch-ring-advance)
("<up>" . isearch-ring-retreat)
Expand Down
2 changes: 2 additions & 0 deletions core/me-fonts.el
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,5 @@ scaling factor for the font in Emacs' `face-font-rescale-alist'. See the


(provide 'me-fonts)

;;; me-fonts.el ends here
4 changes: 2 additions & 2 deletions core/me-splash.el
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
(defvar minemacs-splash-buffer-name "*minemacs-splash*")

(defun minemacs-splash ()
"MinEmacs splash screen"
"MinEmacs splash screen."
;; If there are buffer associated with filenames, we don't show splash screen.
(unless (seq-filter #'identity (mapcar #'buffer-file-name (buffer-list)))
(let* ((buffer (get-buffer-create minemacs-splash-buffer-name))
Expand Down Expand Up @@ -48,7 +48,7 @@
""))
'face 'shadow))

;; Bootstraping
;; Bootstrapping
(unless (file-exists-p (concat minemacs-local-dir "straight/repos/straight.el/bootstrap.el"))
(insert-char ?\n)
(insert-char ?\s 10)
Expand Down
7 changes: 4 additions & 3 deletions core/minemacs-lazy.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

;;; Commentary:

;; Virtual module loaded when idle after `minemacs-loaded'.
;; Used to synchronize loading some other stuff after loading Emacs.
;; Feature loaded when Emacs is idle after `minemacs-loaded', it is used to
;; lazily load other stuff after loading Emacs.

;; The hooks in `minemacs-lazy-hook' are loaded incrementally when Emacs goes
;; idle, but when `minemacs-not-lazy-p' is set to t, they will be all loaded at
Expand All @@ -24,7 +24,7 @@
;; so we defer loading it to the end to maximize the benefit.
(setq minemacs-lazy-hook (append (delq 'gcmh-mode (reverse minemacs-lazy-hook)) '(gcmh-mode)))
(if minemacs-not-lazy-p
(progn ; If `minemacs-no-lazy' is bound and true, force loading lazy hooks immediately
(progn ; If `minemacs-not-lazy-p' is true, force loading lazy hooks immediately
(+log! "Loading %d lazy packages immediately." (length minemacs-lazy-hook))
(run-hooks 'minemacs-lazy-hook))
(+log! "Loading %d lazy packages incrementally." (length minemacs-lazy-hook))
Expand All @@ -33,6 +33,7 @@

(+log! "Providing `minemacs-lazy'.")


(provide 'minemacs-lazy)

;;; minemacs-lazy.el ends here
5 changes: 3 additions & 2 deletions core/minemacs-loaded.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

;;; Commentary:

;; Virtual module loaded at end of init.el (after custom-vars.el)
;; Used to synchronize loading some other stuff after loading Emacs
;; This feature is loaded at end of init.el (after loading custom-vars.el), it
;; is used to synchronize loading some other stuff after loading Emacs

;;; Code:

Expand All @@ -25,6 +25,7 @@

(+log! "Providing `minemacs-loaded'.")


(provide 'minemacs-loaded)

;;; minemacs-loaded.el ends here

0 comments on commit 229dd56

Please sign in to comment.