Compare commits

...

14 Commits

Author SHA1 Message Date
d26e2dbce6 Support for wayland clipboard 2026-01-26 13:30:20 +01:00
397704f046 Add keybind for windows compatability 2026-01-24 11:20:20 +01:00
413ad5305a Use minimap for scrollbar 2026-01-22 13:58:03 +01:00
519de17eaa Ignore geometry files 2026-01-22 13:47:06 +01:00
f6cdc61863 Use farmg package instead of static default frame 2026-01-22 13:43:49 +01:00
d74a5495c9 Show scrollbar by default 2026-01-22 10:43:55 +01:00
733c445ed9 Update default frame size 2026-01-05 07:51:14 +01:00
8daa4d552e Remove copilot completely 2025-12-04 08:28:28 +01:00
4cd34cc992 Remove evil mode 2025-12-02 07:58:21 +01:00
f1578588e4 Update default font 2025-11-11 11:07:15 +01:00
b07bfdf7c2 No evil-mode in elfeed buffers 2025-11-10 15:12:49 +01:00
d8851cea8e Add evil-mode binding for :wq 2025-11-10 14:56:20 +01:00
3a3b501e57 evil-mode key configuration 2025-11-10 10:16:12 +01:00
fc0993bd93 Add evil mode 2025-11-05 17:58:02 +01:00
3 changed files with 76 additions and 19 deletions

1
.gitignore vendored
View File

@@ -30,3 +30,4 @@ eln-cache
straight/ straight/
dark-mode dark-mode
org-persist/ org-persist/
*.frameg

38
frameg.el Normal file
View File

@@ -0,0 +1,38 @@
;; https://www.reddit.com/r/emacs/comments/4ermj9/comment/d237n0i/?utm_source=share&utm_medium=web2x&context=3
;; Custom functions/hooks for persisting/loading frame geometry upon save/load
(defun save-frameg ()
"Gets the current frame's geometry and saves to ~/.emacs.frameg."
(let ((frameg-font (frame-parameter (selected-frame) 'font))
(frameg-left (frame-parameter (selected-frame) 'left))
(frameg-top (frame-parameter (selected-frame) 'top))
(frameg-width (frame-parameter (selected-frame) 'width))
(frameg-height (frame-parameter (selected-frame) 'height))
(frameg-file (expand-file-name ".emacs.frameg" user-emacs-directory)))
(with-temp-buffer
;; Turn off backup for this file
(make-local-variable 'make-backup-files)
(setq make-backup-files nil)
(insert
";;; This file stores the previous emacs frame's geometry.\n"
";;; Last generated " (current-time-string) ".\n"
"(setq initial-frame-alist\n"
" '("
(format " (top . %d)\n" (max frameg-top 0))
(format " (left . %d)\n" (max frameg-left 0))
(format " (width . %d)\n" (max frameg-width 0))
(format " (height . %d)))\n" (max frameg-height 0)))
(when (file-writable-p frameg-file)
(write-file frameg-file)))))
(defun load-frameg ()
"Loads ~/.emacs.frameg which should load the previous frame's geometry."
(let ((frameg-file (expand-file-name ".emacs.frameg" user-emacs-directory)))
(when (file-readable-p frameg-file)
(load-file frameg-file))))
;; Special work to do ONLY when there is a window system being used
(if window-system
(progn
(add-hook 'after-init-hook 'load-frameg)
(add-hook 'kill-emacs-hook 'save-frameg)))

54
init.el
View File

@@ -47,23 +47,26 @@
(delete-file dark-mode-file) (delete-file dark-mode-file)
(with-temp-buffer (with-temp-buffer
(write-file dark-mode-file))) (write-file dark-mode-file)))
(modus-themes-toggle)))) (modus-themes-toggle)))))
;; Default frame size
(setq default-frame-alist
(append (list '(width . 90) '(height . 50)
'(vertical-scroll-bars . nil)
'(internal-border-width . 5)))))
;; Disable some UI elements ;; Disable some UI elements
(tool-bar-mode -1) (tool-bar-mode -1)
(menu-bar-mode -1) (menu-bar-mode -1)
(scroll-bar-mode -1)
(tooltip-mode -1) (tooltip-mode -1)
(fringe-mode -1) (fringe-mode -1)
(scroll-bar-mode -1)
;; The minimap gives a much better scrolling experience
(use-package minimap
:straight t
:config
(minimap-mode)
(setq minimap-window-location 'right)
(setq minimap-width-fraction 0.10))
;; Font settings ;; Font settings
(set-face-attribute 'default nil :font "Inconsolata-10") (set-face-attribute 'default nil :font "Iosevka Fixed SS05-12")
(set-face-attribute 'fixed-pitch nil :family 'unspecified) (set-face-attribute 'fixed-pitch nil :family 'unspecified)
(set-face-attribute 'variable-pitch nil :family 'unspecified) (set-face-attribute 'variable-pitch nil :family 'unspecified)
@@ -81,6 +84,21 @@
(setq auto-save-default nil) (setq auto-save-default nil)
(setq create-lockfiles nil) (setq create-lockfiles nil)
(when (getenv "WAYLAND_DISPLAY")
;; Without this, copy and pasting from other wayland apps into
;; emacs-pgtk doesn't work.
;; https://www.emacswiki.org/emacs/CopyAndPaste#h5o-4
(setq wl-copy-process nil)
(defun wl-copy (text)
(setq wl-copy-process (make-process :name "wl-copy"
:buffer nil
:command '("wl-copy" "-f" "-n")
:connection-type 'pipe
:noquery t))
(process-send-string wl-copy-process text)
(process-send-eof wl-copy-process))
(setq interprogram-cut-function 'wl-copy))
;; Dired settings ;; Dired settings
(defun embark-open-externally (file) (defun embark-open-externally (file)
"Open FILE externally using the default application of the system." "Open FILE externally using the default application of the system."
@@ -174,6 +192,7 @@
(global-auto-revert-mode 1) (global-auto-revert-mode 1)
;; Keybindings ;; Keybindings
(bind-key "M-<f4>" 'kill-emacs)
(bind-key "C-x k" 'kill-buffer-with-prejudice) (bind-key "C-x k" 'kill-buffer-with-prejudice)
(bind-key "C-w" 'kill-buffer-with-prejudice) (bind-key "C-w" 'kill-buffer-with-prejudice)
(bind-key "C-x C-k" 'kill-buffer-and-window) (bind-key "C-x C-k" 'kill-buffer-and-window)
@@ -229,6 +248,11 @@
(switch-to-buffer (other-buffer (current-buffer) 1))) (switch-to-buffer (other-buffer (current-buffer) 1)))
(bind-key "M-p" 'switch-to-previous-buffer) (bind-key "M-p" 'switch-to-previous-buffer)
(defun save-and-kill-buffer-with-prejudice ()
(interactive)
(save-buffer)
(kill-buffer-with-prejudice))
;; Ace for qucik window switching ;; Ace for qucik window switching
(use-package ace-window (use-package ace-window
:straight t :straight t
@@ -370,15 +394,6 @@
;; Programming configuration ;; Programming configuration
(add-hook 'prog-mode-hook 'display-line-numbers-mode) (add-hook 'prog-mode-hook 'display-line-numbers-mode)
;; Copilot
;; (use-package copilot
;; :straight (:host github :repo "zerolfx/copilot.el" :files ("dist" "*.el"))
;; :ensure t)
;; (add-hook 'prog-mode-hook 'copilot-mode)
;; (define-key copilot-completion-map (kbd "<tab>") 'copilot-accept-completion)
;; (define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion)
;; (define-key copilot-completion-map (kbd "C-.") 'copilot-complete)
;; Elisp ;; Elisp
(defun my-elisp-mode-hook () (defun my-elisp-mode-hook ()
"My elisp customizations." "My elisp customizations."
@@ -435,6 +450,9 @@
(when (current-buffer-matches-file-p) (set-buffer-modified-p nil)) (when (current-buffer-matches-file-p) (set-buffer-modified-p nil))
(kill-buffer)) (kill-buffer))
;; saving/restoring of the default frame
(load "~/.emacs.d/frameg.el")
;; movies.org package ;; movies.org package
(load "~/.emacs.d/org-movies.el" 'noerror) (load "~/.emacs.d/org-movies.el" 'noerror)