Add old dotfiles

This commit is contained in:
venomade committed 2025-02-27 17:06:42 +00:00
commit 1cace80e48
192 files changed
+13538

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
;; Set Fonts and their size
(defvar customfontsettings
'((mono . "Iosevka")
(variabl . "RobotoCondensed")
(size . 14)))
(set-face-attribute 'variable-pitch nil
:font (cdr (assoc 'variabl customfontsettings))
:height (* (cdr (assoc 'size customfontsettings)) 10)
:weight 'regular)
(set-face-attribute 'fixed-pitch nil
:font (cdr (assoc 'mono customfontsettings))
:height (* (cdr (assoc 'size customfontsettings)) 10)
:weight 'regular)
(set-face-attribute 'default nil
:font (cdr (assoc 'mono customfontsettings))
:height (* (cdr (assoc 'size customfontsettings)) 10)
:weight 'regular)
(add-to-list 'default-frame-alist
`(font . ,(concat (cdr (assoc 'mono customfontsettings)) "-" (number-to-string (cdr (assoc 'size customfontsettings))))))
(set-face-attribute 'font-lock-comment-face nil
:slant 'italic)
(set-face-attribute 'font-lock-keyword-face nil
:slant 'italic)
;; Set mode-line font
(set-face-attribute 'mode-line nil :inherit 'variable-pitch)
(set-face-attribute 'mode-line-inactive nil :inherit 'variable-pitch)
;; Set Usable Ligatures
(dolist (char/ligature-re
`((?- . ,(rx (or (or "-->" "-<<" "->>" "-|" "-~" "-<" "->") (+ "-"))))
(?/ . ,(rx (or (or "/==" "/=" "/>" "/**" "/*") (+ "/"))))
(?* . ,(rx (or (or "*>" "*/") (+ "*"))))
(?< . ,(rx (or (or "<<=" "<<-" "<|||" "<==>" "<!--" "<=>" "<||" "<|>" "<-<"
"<==" "<=<" "<-|" "<~>" "<=|" "<~~" "<$>" "<+>" "</>"
"<*>" "<->" "<=" "<|" "<:" "<>" "<$" "<-" "<~" "<+"
"</" "<*")
(+ "<"))))
(?: . ,(rx (or (or ":?>" "::=" ":>" ":<" ":?" ":=") (+ ":"))))
(?= . ,(rx (or (or "=>>" "==>" "=/=" "=!=" "=>" "=:=") (+ "="))))
(?! . ,(rx (or (or "!==" "!=") (+ "!"))))
(?> . ,(rx (or (or ">>-" ">>=" ">=>" ">]" ">:" ">-" ">=") (+ ">"))))
(?& . ,(rx (+ "&")))
(?| . ,(rx (or (or "|->" "|||>" "||>" "|=>" "||-" "||=" "|-" "|>"
"|]" "|}" "|=")
(+ "|"))))
(?. . ,(rx (or (or ".?" ".=" ".-" "..<") (+ "."))))
(?+ . ,(rx (or "+>" (+ "+"))))
(?\[ . ,(rx (or "[<" "[|")))
(?\{ . ,(rx "{|"))
(?\? . ,(rx (or (or "?." "?=" "?:") (+ "?"))))
(?# . ,(rx (or (or "#_(" "#[" "#{" "#=" "#!" "#:" "#_" "#?" "#(")
(+ "#"))))
(?\; . ,(rx (+ ";")))
(?_ . ,(rx (or "_|_" "__")))
(?~ . ,(rx (or "~~>" "~~" "~>" "~-" "~@")))
(?$ . ,(rx "$>"))
(?^ . ,(rx "^="))
(?\] . ,(rx "]#"))))
(let ((char (car char/ligature-re))
(ligature-re (cdr char/ligature-re)))
(set-char-table-range composition-function-table char
`([,ligature-re 0 font-shape-gstring]))))
;; Font Zooming
(global-set-key (kbd "C-=") 'text-scale-increase)
(global-set-key (kbd "C--") 'text-scale-decrease)
+50
View File
@@ -0,0 +1,50 @@
;; Pop Out Buffer
;;; Pops the current buffer out into it's own frame.
(defun pop-out-buffer-into-frame ()
(interactive)
(let* ((current-buffer (current-buffer))
(previous-buffer (other-buffer (current-buffer) t))) ;; Get the previous buffer in the window
;; Switch the current window back to the previous buffer
(set-window-buffer (selected-window) previous-buffer)
;; Create a new frame and show the original buffer there
(select-frame (make-frame))
(set-window-buffer (selected-window) current-Kill)))
;; Kill Current Buffer
;;; kill-this-buffer doesn't work in emacs 30 (relies on menubar visibility?) so this is a small implementation of window.el's /C-x 4 0/.
(defun kill-current-buffer()
(interactive)
(let ((buffer-to-kill (current-buffer))))
(kill-buffer (current-buffer)))
;; Duplicate Line (stolen from https://github.com/rexim/dotfiles)
;;; TODO: Expand function to be able duplicate region if region selected
(defun duplicate-line ()
(interactive)
(let ((column (- (point) (point-at-bol)))
(line (let ((s (thing-at-point 'line t)))
(if s (string-remove-suffix "\n" s) ""))))
(move-end-of-line 1)
(newline)
(insert line)
(move-beginning-of-line 1)
(forward-char column)))
;; Use bind-key to override other bindings
(keymap-global-set "C-c y d" 'duplicate-line)
;; Vim's o and S-o (stolen from https://stackoverflow.com/a/2173393)
(defun vi-open-line-above ()
(interactive)
(unless (bolp)
(beginning-of-line))
(newline)
(forward-line -1)
(indent-according-to-mode))
(defun vi-open-line-below ()
(interactive)
(unless (eolp)
(end-of-line))
(newline-and-indent))
(keymap-global-set "C-c O" 'vi-open-line-below)
(keymap-global-set "C-c o" 'vi-open-line-above)
+43
View File
@@ -0,0 +1,43 @@
;; Hide Warnings
(setq warning-minimum-level :emergency)
;; Disable Bell
(setq ring-bell-function 'ignore)
;; Add Scroll Margin
(setq scroll-margin 12)
;; Setup Line Numbers
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
(setq display-line-numbers-type 'relative)
(global-visual-line-mode t)
(add-hook 'prog-mode-hook (lambda () (visual-line-mode -1)))
(setq-default truncate-lines t)
;; Use Spaces over Tabs
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq tab-stop-list (number-sequence 2 200 2))
;; Highlight Column
(setq-default display-fill-column-indicator-column 80)
(add-hook 'prog-mode-hook #'display-fill-column-indicator-mode)
;; Disable GUI Features
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
;; Set Emacs auto-save directories
(setq backup-directory-alist
`(("." . ,(concat user-emacs-directory "backups"))))
(setq auto-save-file-name-transforms
`(("." ,(concat user-emacs-directory "autosaves") t)))
(setq lock-file-name-transforms
`(("." ,(concat user-emacs-directory "lock") t)))
;; Go back to old position on file open
(save-place-mode 1)
;; Disable Fringes
(set-fringe-mode 0)
+6
View File
@@ -0,0 +1,6 @@
;; Add shorthands for Org Functions
(require 'org-tempo)
;; Use both Mono and Variable fonts in a single buffer
(use-package mixed-pitch)
(add-hook 'org-mode-hook 'mixed-pitch-mode)
+10
View File
@@ -0,0 +1,10 @@
(require 'project)
(keymap-global-set "C-c p b" 'project-list-buffers)
(keymap-global-set "C-c p c" 'project-compile)
(keymap-global-set "C-c p e" 'project-dired)
(keymap-global-set "C-c p f" 'project-find-file)
(keymap-global-set "C-c f p" 'project-find-file)
(keymap-global-set "C-c p g" 'project-find-regexp)
(keymap-global-set "C-c p o" 'project-find-dir)
(keymap-global-set "C-c p p" 'project-switch-project)
+33
View File
@@ -0,0 +1,33 @@
;; Replace Emacs default behaviour
(keymap-global-set "C-x b" 'counsel-switch-buffer)
(global-set-key (kbd "C-x C-c") (lookup-key global-map (kbd "C-c")))
;; Rebind Emacs Quit
(keymap-global-set "C-M-S-q" 'save-buffers-kill-terminal)
;; Custom C-c keybinds
(keymap-global-set "C-c e c" (lambda () (interactive) (load-file "~/.emacs.d/init.el")))
(keymap-global-set "C-c f c" (lambda () (interactive) (find-file "~/.emacs.d/config.el")))
(keymap-global-set "C-c f t" (lambda () (interactive) (find-file "~/Documents/TODO.org")))
(keymap-global-set "C-c f b" (lambda () (interactive) (find-file "~/Documents/Bookmarks.org")))
(keymap-global-set "C-c b p" 'previous-buffer)
(keymap-global-set "C-c b n" 'next-buffer)
(keymap-global-set "C-c b r" 'revert-buffer)
(keymap-global-set "C-c e b" 'eval-buffer)
(keymap-global-set "C-c e r" 'eval-region)
(keymap-global-set "C-c e s" 'eshell)
(keymap-global-set "C-c r" 'replace-regexp)
(keymap-global-set "C-c y a" 'copy-from-above-command)
(keymap-global-set "C-c v" 'scroll-other-window)
(keymap-global-set "C-c V" 'scroll-other-window-down)
(keymap-global-set "C-c w n" 'other-window)
(keymap-global-set "C-c w f" 'other-window)
(keymap-global-set "C-c w p" (lambda () (interactive) (other-window -1)))
(keymap-global-set "C-c w b" (lambda () (interactive) (other-window -1)))
+15
View File
@@ -0,0 +1,15 @@
;; Setup the straight package manager to use the use-package syntax
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 6))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(setq straight-use-package-by-default t)
+5
View File
@@ -0,0 +1,5 @@
;; Set Theme
(load-theme 'modus-vivendi t)
;; Add Padding
(set-window-margins nil 0)