Compare commits
16 Commits
367e33de41
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d26e2dbce6 | |||
| 397704f046 | |||
| 413ad5305a | |||
| 519de17eaa | |||
| f6cdc61863 | |||
| d74a5495c9 | |||
| 733c445ed9 | |||
| 8daa4d552e | |||
| 4cd34cc992 | |||
| f1578588e4 | |||
| b07bfdf7c2 | |||
| d8851cea8e | |||
| 3a3b501e57 | |||
| fc0993bd93 | |||
| 352bf38d03 | |||
| 48cc2c513f |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -30,3 +30,4 @@ eln-cache
|
|||||||
straight/
|
straight/
|
||||||
dark-mode
|
dark-mode
|
||||||
org-persist/
|
org-persist/
|
||||||
|
*.frameg
|
||||||
38
frameg.el
Normal file
38
frameg.el
Normal 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)))
|
||||||
58
init.el
58
init.el
@@ -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
|
||||||
@@ -354,6 +378,9 @@
|
|||||||
(when (executable-find "pandoc")
|
(when (executable-find "pandoc")
|
||||||
(setq markdown-command "pandoc -f markdown -t html")))
|
(setq markdown-command "pandoc -f markdown -t html")))
|
||||||
|
|
||||||
|
(use-package org-remoteimg
|
||||||
|
:straight (org-remoteimg :type git :host github :repo "gaoDean/org-remoteimg"))
|
||||||
|
|
||||||
(setq
|
(setq
|
||||||
;; Edit settings
|
;; Edit settings
|
||||||
org-auto-align-tags nil
|
org-auto-align-tags nil
|
||||||
@@ -361,20 +388,12 @@
|
|||||||
org-catch-invisible-edits 'show-and-error
|
org-catch-invisible-edits 'show-and-error
|
||||||
org-special-ctrl-a/e t
|
org-special-ctrl-a/e t
|
||||||
org-insert-heading-respect-content t
|
org-insert-heading-respect-content t
|
||||||
|
org-display-remote-inline-images 'cache
|
||||||
)
|
)
|
||||||
|
|
||||||
;; 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."
|
||||||
@@ -431,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)
|
||||||
|
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ Errors when the request fails or the API reports an error."
|
|||||||
(org-set-property "runtime" runtime)
|
(org-set-property "runtime" runtime)
|
||||||
(org-set-property "genre" genre)
|
(org-set-property "genre" genre)
|
||||||
(org-set-property "director" director)
|
(org-set-property "director" director)
|
||||||
(org-set-property "poster" (concat "[[" poster "]]"))
|
|
||||||
(org-set-property "plot" plot)
|
(org-set-property "plot" plot)
|
||||||
|
(org-set-property "poster" (concat "[[" poster "]]"))
|
||||||
))
|
))
|
||||||
|
|
||||||
(org-movies-mode 1)
|
(org-movies-mode 1)
|
||||||
Reference in New Issue
Block a user