2022-10-25 13:38:40 +01:00
|
|
|
(setq package-enable-at-startup nil)
|
|
|
|
|
|
|
|
(defun ar/show-welcome-buffer ()
|
|
|
|
"Show *Welcome* buffer."
|
|
|
|
(with-current-buffer (get-buffer-create "*Welcome*")
|
|
|
|
(setq truncate-lines t)
|
|
|
|
(let* ((buffer-read-only)
|
2023-07-25 19:46:27 +01:00
|
|
|
(image-path "~/.emacs.d/splash.png")
|
2022-10-25 13:38:40 +01:00
|
|
|
(image (create-image image-path))
|
|
|
|
(size (image-size image))
|
|
|
|
(height (cdr size))
|
|
|
|
(width (car size))
|
|
|
|
(top-margin (floor (/ (- (window-height) height) 2)))
|
|
|
|
(left-margin (floor (/ (- (window-width) width) 2)))
|
|
|
|
(title "Welcome to Emacs!"))
|
|
|
|
(erase-buffer)
|
|
|
|
(setq mode-line-format nil)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(insert (make-string top-margin ?\n ))
|
|
|
|
(insert (make-string left-margin ?\ ))
|
|
|
|
(insert-image image)
|
|
|
|
(insert "\n\n\n")
|
|
|
|
(insert (make-string (floor (/ (- (window-width) (string-width title)) 2)) ?\ ))
|
|
|
|
(insert title))
|
|
|
|
(setq cursor-type nil)
|
|
|
|
(read-only-mode +1)
|
|
|
|
(switch-to-buffer (current-buffer))
|
2023-01-28 09:26:18 +00:00
|
|
|
(local-set-key (kbd "<escape>") 'kill-this-buffer)
|
2023-07-25 19:46:27 +01:00
|
|
|
(local-set-key (kbd "t") 'vterm)
|
|
|
|
(local-set-key (kbd "c") 'chatgpt-shell)))
|
2022-10-25 13:38:40 +01:00
|
|
|
|
|
|
|
(setq initial-scratch-message nil)
|
|
|
|
(setq inhibit-startup-screen t)
|
|
|
|
|
|
|
|
(when (< (length command-line-args) 2)
|
|
|
|
(add-hook 'emacs-startup-hook (lambda ()
|
|
|
|
(when (display-graphic-p)
|
|
|
|
(ar/show-welcome-buffer)))))
|