aboutsummaryrefslogtreecommitdiff
path: root/nix/users/fcuny/configs
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2025-05-22 19:45:40 -0700
committerFranck Cuny <franck@fcuny.net>2025-05-22 19:45:40 -0700
commit487d2dea0786f1ff0bee861364b80f534a9c5c62 (patch)
tree2c7b937a512851ea22a984d850574267d4788068 /nix/users/fcuny/configs
parentmore configuration for emacs (diff)
downloadinfra-487d2dea0786f1ff0bee861364b80f534a9c5c62.tar.gz
more refactoring, move things up
Diffstat (limited to 'nix/users/fcuny/configs')
-rw-r--r--nix/users/fcuny/configs/emacs/early-init.el6
-rw-r--r--nix/users/fcuny/configs/emacs/init.el110
2 files changed, 61 insertions, 55 deletions
diff --git a/nix/users/fcuny/configs/emacs/early-init.el b/nix/users/fcuny/configs/emacs/early-init.el
index 7efb3aa..e98d23a 100644
--- a/nix/users/fcuny/configs/emacs/early-init.el
+++ b/nix/users/fcuny/configs/emacs/early-init.el
@@ -35,8 +35,10 @@
(set-default-coding-systems 'utf-8)
;; `use-package' is builtin since 29.
-;; It must be set before loading `use-package'.
-(setq use-package-enable-imenu-support t)
+;; These variables must be set before loading `use-package'.
+(setq use-package-always-ensure nil
+ use-package-always-defer t
+ use-package-enable-imenu-support t)
(set-face-attribute 'default nil :family "Source Code Pro" :height 150)
diff --git a/nix/users/fcuny/configs/emacs/init.el b/nix/users/fcuny/configs/emacs/init.el
index 6283f3b..aa38090 100644
--- a/nix/users/fcuny/configs/emacs/init.el
+++ b/nix/users/fcuny/configs/emacs/init.el
@@ -8,7 +8,6 @@
(setq create-lockfiles nil) ;; don't use a lock file
(use-package recentf
- :ensure nil
:hook (after-init . recentf-mode)
:config
(setq recentf-max-saved-items 1000)
@@ -22,33 +21,28 @@
;;;; Auto revert mode
(use-package autorevert
- :ensure nil
:hook (after-init . global-auto-revert-mode)
:config
(setq auto-revert-verbose t))
;;;; Display current time
(use-package time
- :ensure nil
+ :commands (world-clock)
:hook (after-init . display-time-mode)
:config
(setq display-time-format " %a %e %b, %H:%M ")
(setq display-time-24hr-format t)
(setq display-time-interval 60)
- (setq display-time-default-load-average nil))
-
-;;;; World clock (M-x world-clock)
-(use-package time
- :ensure nil
- :commands (world-clock)
- :config
+ (setq display-time-default-load-average nil)
(setq display-time-world-list t)
- (setq zoneinfo-style-world-list ; M-x shell RET timedatectl list-timezones
- '(("America/Los_Angeles" "Berkeley")
- ("America/Chicago" "Chicago")
- ("UTC" "UTC")
- ("Europe/Paris" "Paris")))
+ ;; M-x shell RET timedatectl list-timezones
+ (setq zoneinfo-style-world-list '(("America/Los_Angeles" "Berkeley")
+ ("America/Chicago" "Chicago")
+ ("UTC" "UTC")
+ ("Europe/Paris" "Paris")))
+
+ ;; M-x world-clock
(setq world-clock-list t)
(setq world-clock-time-format "%z %R %a %d %b (%Z)")
(setq world-clock-buffer-name "*world-clock*") ; Placement handled by `display-buffer-alist'
@@ -57,14 +51,60 @@
;;;; Emacs server (allow emacsclient to connect to running session)
(use-package server
- :ensure nil
:defer 1
:config
(setq server-client-instructions nil)
(unless (server-running-p)
(server-start)))
-(require 'ibuffer)
+;;;; improved buffers management
+(use-package ibuffer
+ :ensure nil
+ :bind ("C-x C-b" . ibuffer)
+ :init
+ (setq ibuffer-expert t) ;; set expert mode
+ (setq ibuffer-jump-offer-only-visible-buffers t) ;; only show visible buffers
+ (setq ibuffer-use-other-window t) ;; open ibuffer in other window
+ (setq ibuffer-filter-group-name-face '(:inherit (font-lock-string-face bold))))
+
+;;;; magit, the best git client
+(use-package magit
+ :bind ("C-x g" . magit-status)
+ :custom
+ (magit-diff-refine-hunk t)
+ (magit-repository-directories '(("~/workspace" . 1)))
+ (magit-repolist-column-flag-alist '((magit-untracked-files . "N")
+ (magit-unstaged-files . "U")
+ (magit-staged-files . "S")))
+ (magit-repolist-columns '(("Name" 25 magit-repolist-column-ident nil)
+ ("" 3 magit-repolist-column-flag)
+ ("Version" 25 magit-repolist-column-version
+ ((:sort magit-repolist-version<)))
+ ("B<U" 3 magit-repolist-column-unpulled-from-upstream
+ ((:right-align t)
+ (:sort <)))
+ ("B>U" 3 magit-repolist-column-unpushed-to-upstream
+ ((:right-align t)
+ (:sort <)))
+ ("Path" 99 magit-repolist-column-path nil)))
+ (magit-clone-default-directory "~/workspace/")
+ :config
+ ;; show ANSI colors in the process buffer, so it's easier to read what's going on
+ ;; for some reasons if it's in the `:custom' section it does not get set
+ (setq magit-process-finish-apply-ansi-colors t))
+
+;;;; create links from a git commit to a forge
+(use-package git-link
+ :defines git-link-remote-alist
+ :bind ("C-c Y" . git-link)
+ :commands (git-link git-link-commit git-link-homepage)
+ :custom
+ (git-link-open-in-browser t)
+ :config
+ ;; sets up roblox git enterprise as a git-link handler
+ (add-to-list 'git-link-remote-alist '("github\\.rblx\\.com" git-link-github))
+ (add-to-list 'git-link-commit-remote-alist '("github\\.rblx\\.com" git-link-commit-github)))
+
(require 'imenu)
(require 'midnight)
@@ -74,9 +114,6 @@
(setq delete-by-moving-to-trash t) ;; delete files by moving them to the trash
(setq highlight-nonselected-windows nil) ;; don't highlight inactive windows
(setq history-delete-duplicates t) ;; delete duplicate from history
-(setq ibuffer-expert t) ;; set expert mode
-(setq ibuffer-jump-offer-only-visible-buffers t) ;; only show visible buffers
-(setq ibuffer-use-other-window t) ;; open ibuffer in other window
(setq imenu-auto-rescan t) ;; rescan automatically
(setq initial-major-mode 'fundamental-mode) ;; default mode for the scratch buffer
(setq initial-scratch-message "") ;; makes the scratch buffer empty
@@ -103,7 +140,6 @@
;; some key bindings
(global-set-key (kbd "M-j") 'join-line)
-(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "C-c y") 'git-link)
(global-set-key (kbd "C-c C-r") 'eval-region)
(global-set-key (kbd "C-c C-d") 'eval-defun)
@@ -157,38 +193,6 @@
(message "File '%s' successfully renamed to '%s'" name (file-name-nondirectory new-name))))))))
-;;; magit
-(require 'magit)
-(setq magit-diff-refine-hunk t
- magit-repository-directories '(("~/workspace" . 1))
- magit-clone-default-directory "~/workspace/"
- magit-repolist-columns '(("Name" 25 magit-repolist-column-ident nil)
- ("" 3 magit-repolist-column-flag)
- ("Version" 25 magit-repolist-column-version
- ((:sort magit-repolist-version<)))
- ("B<U" 3 magit-repolist-column-unpulled-from-upstream
- ((:right-align t)
- (:sort <)))
- ("B>U" 3 magit-repolist-column-unpushed-to-upstream
- ((:right-align t)
- (:sort <)))
- ("Path" 99 magit-repolist-column-path nil))
- magit-repolist-column-flag-alist '((magit-untracked-files . "N")
- (magit-unstaged-files . "U")
- (magit-staged-files . "S")))
-
-;; show ANSI colors in the process buffer, so it's easier to read what's going on
-;; for some reasons if it's in the `:custom' section it does not get set
-(setq magit-process-apply-ansi-colors t)
-
-;;; git-link
-(require 'git-link)
-(setq git-link-open-in-browser t)
-
-;; FIXME sets up roblox git enterprise as a git-link handler
-(with-eval-after-load 'git-link
- (add-to-list 'git-link-remote-alist '("github\\.rblx\\.com" git-link-github))
- (add-to-list 'git-link-commit-remote-alist '("github\\.rblx\\.com" git-link-commit-github)))
;;; rg
(require 'rg)