init.el 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. ;; Package mirrors
  2. (setq package-archives '(("melpa" . "https://melpa.org/packages/")
  3. ("org" . "https://orgmode.org/elpa/")
  4. ("elpa" . "https://elpa.gnu.org/packages/")))
  5. (package-initialize)
  6. (unless package-archive-contents
  7. (package-refresh-contents))
  8. ;; Initialize use-package on non-Linux platforms
  9. (unless (package-installed-p 'use-package)
  10. (package-install 'use-package))
  11. (require 'use-package)
  12. (setq use-package-always-ensure t)
  13. ;; Auto refresh when they get changed
  14. (global-auto-revert-mode 1)
  15. ;; Stop making my directories filled with backups
  16. (setq make-backup-files nil)
  17. ;; Text wrap everything
  18. (add-hook 'text-mode-hook 'visual-line-mode)
  19. ;; Better scrolling
  20. (setq scroll-step 1
  21. scroll-conservatively 10000)
  22. ;; Make ESC quit prompts
  23. (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
  24. ;; Set the default directory
  25. (setq default-directory "C:/SGZ_Pro/" )
  26. ;; Don't beep
  27. (setq visible-bell t)
  28. ;; remove some annoything UI in emacs
  29. (scroll-bar-mode -1) ; Disable visible scrollbar
  30. (tool-bar-mode -1) ; Disable the toolbar
  31. (tooltip-mode -1) ; Disable tooltips
  32. (set-fringe-mode 10) ; Give some breathing room
  33. (menu-bar-mode -1) ; Disable the menu bar
  34. ;; remove the ugly start menu
  35. (setq inhibit-startup-message t)
  36. ;; Numbers
  37. (column-number-mode)
  38. (global-display-line-numbers-mode t)
  39. ;; Font
  40. (add-to-list 'default-frame-alist '(font . "Dejavu Sans Mono-10"))
  41. (set-face-attribute 'default t :font "DejaVu Sans Mono")
  42. ;;Time on your status bar
  43. (setq display-time-24hr-format t)
  44. (setq display-time-day-and-date t)
  45. (setq display-time-default-load-average 'nil)
  46. (display-time-mode 1)
  47. (setq browse-url-browser-function 'browse-url-generic
  48. browse-url-generic-program "librewolf-portable")
  49. ;; Powerline status bar
  50. (use-package powerline
  51. :ensure t)
  52. (powerline-default-theme)
  53. ;; Doom theme
  54. (use-package doom-themes
  55. :config
  56. (load-theme 'doom-gruvbox t))
  57. ;; Evil mode
  58. (use-package undo-fu)
  59. (use-package evil
  60. :init
  61. (setq evil-want-keybinding nil)
  62. (setq evil-undo-system 'undo-fu)
  63. :config
  64. (evil-mode 1))
  65. (use-package evil-collection
  66. :after evil
  67. :config
  68. (evil-collection-init))
  69. ;; Org
  70. (use-package org)
  71. (setq org-src-preserve-indentation t)
  72. ;; God mode org setting
  73. (setq org-startup-indented t)
  74. ;;org to html
  75. (defun html-org-export-settings ()
  76. "Insert good html org settings"
  77. (interactive)
  78. (let ((user-input (completing-read "Enter a title here: " nil)))
  79. (insert (format "#+TITLE: %s\n#+HTML_HEAD: <link rel='stylesheet' type='text/css' href='styles.css' />\n#+OPTIONS: html-style:nil toc:nil num:nil \n\n* License\n#+BEGIN_EXPORT html \n<hr> \n<footer> \n<a rel='license' href='http://creativecommons.org/licenses/by-sa/4.0/'><img alt='Creative Commons License' style='border-width:0' width='88' height='31' src='../images/cc-by-sa.png' /></a><br> \nUnless otherwise noted, all content on this website is Copyright Zortazert 2021-2023 and is licensed under <a rel='license' href='http://creativecommons.org/licenses/by-sa/4.0/'>CC BY-SA 4.0</a>. \n</footer> \n#+END_EXPORT \n" user-input)))
  80. (forward-line -11)
  81. (end-of-line))
  82. (use-package htmlize)
  83. ;;Org to tangle (Config)
  84. (defun tangle-org-export-settings ()
  85. "Insert good tangle org settings"
  86. (interactive)
  87. (insert "#+TITLE: \n#+PROPERTY: header-args :tange ")
  88. (forward-line -1)
  89. (end-of-line))
  90. ;;Org to PDF
  91. (defun pdf-org-export-settings ()
  92. "Insert good tangle org settings"
  93. (interactive)
  94. (insert "#+TITLE: \n#+OPTIONS: toc:nil author:nil\n#+DESCRIPTION: \n#+ATTR_LATEX: :environment longtable :align |p{3cm}|p{6cm}|l|l|l|l|l|l|")
  95. (forward-line -3)
  96. (end-of-line))
  97. ;; Org Capture
  98. (setq org-capture-templates
  99. '(
  100. ("j" "Journal" entry (file+datetree "C:/SGZ_Pro/Hobbys/Writings/Org/journal.org")
  101. "* %?\n %i\n %a")
  102. )
  103. )
  104. (use-package counsel
  105. :bind (("C-M-j" . 'counsel-switch-buffer)
  106. :map minibuffer-local-map
  107. ("C-r" . 'counsel-minibuffer-history))
  108. :custom
  109. (counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)
  110. :config
  111. (counsel-mode 1))
  112. ;; Ivy
  113. (use-package ivy
  114. :diminish
  115. :bind (("C-s" . swiper)
  116. :map ivy-minibuffer-map
  117. ("TAB" . ivy-alt-done)
  118. ("C-l" . ivy-alt-done)
  119. ("C-j" . ivy-next-line)
  120. ("C-k" . ivy-previous-line)
  121. :map ivy-switch-buffer-map
  122. ("C-k" . ivy-previous-line)
  123. ("C-l" . ivy-done)
  124. ("C-d" . ivy-switch-buffer-kill)
  125. :map ivy-reverse-i-search-map
  126. ("C-k" . ivy-previous-line)
  127. ("C-d" . ivy-reverse-i-search-kill))
  128. :config
  129. (ivy-mode 1))
  130. (setq ivy-initial-inputs-alist nil)
  131. (use-package ivy-rich
  132. :init
  133. (ivy-rich-mode 1))
  134. ;; Variables for packages
  135. (custom-set-variables
  136. ;; custom-set-variables was added by Custom.
  137. ;; If you edit it by hand, you could mess it up, so be careful.
  138. ;; Your init file should contain only one such instance.
  139. ;; If there is more than one, they won't work right.
  140. '(newsticker-url-list
  141. '(("Pyero" "https://argo.codeberg.page/rss.xml" nil nil nil)
  142. ("Zortazert's Blog" "https://zortazert.codeberg.page/rss.xml" nil nil nil)
  143. ("davidovski" "https://davidovski.xyz/rss.xml" nil nil nil)
  144. ("Luke Smith's Webpage" "https://lukesmith.xyz/rss.xml" nil nil nil)
  145. ("beparanoid.de" "https://beparanoid.de/rss.xml" nil nil nil)
  146. ("TheLinuxCast Website" "https://thelinuxcast.org/feed/feed.xml" nil nil nil)
  147. ("WeedSmokingJew" "https://wsmj.neocities.org/index.xml" nil nil nil)
  148. ("Drew DeVault's blog" "https://drewdevault.com/blog/index.xml" nil nil nil)
  149. ("DenshiBlog" "https://denshi.org/rss.xml" nil nil nil)
  150. ("" "https://bugswriter.com/atom.xml" nil nil nil)
  151. ("Cadence's Blog" "https://cadence.moe/blog/rss.xml?limit=30" nil nil nil)
  152. ("Beans (Blog)" "https://thebeanbakery.xyz/rss.xml" nil nil nil)
  153. ("Jaiden Animations" "https://invidio.xamh.de/feed/channel/UCGwu0nbY2wSkW8N-cghnLpA" nil nil nil)
  154. ("TheOdd1sOut" "https://invidio.xamh.de/feed/channel/UCo8bcnLyZH8tBIH9V1mLgqQ" nil nil nil)
  155. ("GingerPale" "https://invidio.xamh.de/feed/channel/UCGGTAB19HlHEWPwwmxHsEKA" nil nil nil)
  156. ("Kevin Temmer Tunes" "https://invidio.xamh.de/feed/channel/UCR4u8Ny7c3V8qkvIF3JJG-Q" nil nil nil)
  157. ("illymation" "https://invidio.xamh.de/feed/channel/UCsKVP_4zQ877TEiH_Ih5yDQ" nil nil nil)
  158. ("Jazza" "https://invidio.xamh.de/feed/channel/UCHu2KNu6TtJ0p4hpSW7Yv7Q" nil nil nil)
  159. ("Young Yong Tales" "https://invidio.xamh.de/feed/channel/UCWPB0WpnMIy-g7zncwIhvQg" nil nil nil)
  160. ("Crowne Prince" "https://invidio.xamh.de/feed/channel/UCwf7GkXUML0Whgdt6lvMFTw" nil nil nil)
  161. ("Brandon James Greer" "https://invidio.xamh.de/feed/channel/UCC26K7LTSrJK0BPAUyyvtQg" nil nil nil)
  162. ("Xabio Arts" "https://invidio.xamh.de/feed/channel/UC7uTTvYKpjsDGRO_bcaMf7A" nil nil nil)
  163. ("Pontypants" "https://invidio.xamh.de/feed/channel/UCORaUhZVpg7yhxJeaPSTGmQ" nil nil nil)
  164. ("Vimlark" "https://invidio.xamh.de/feed/channel/UClqFSFR_H1yJJ7NRs8xxGCQ" nil nil nil)
  165. ("White Vault" "https://invidio.xamh.de/feed/channel/UC5-snCpm24G-mJvAbQP9HyA" nil nil nil)
  166. ("Dani" "https://invidio.xamh.de/feed/channel/UCIabPXjvT5BVTxRDPCBBOOQ" nil nil nil)
  167. ("Dani2" "https://invidio.xamh.de/feed/channel/UCzmtKpQQyZ-9ZNY_bbFtVHw" nil nil nil)
  168. ("DanisTutorials" "https://invidio.xamh.de/feed/channel/UCn7E5qFz-BML6o7XnjtlytA" nil nil nil)
  169. ("ThePrimeagen" "https://invidio.xamh.de/feed/channel/UC8ENHE5xdFSwx71u3fDH5Xw" nil nil nil)
  170. ("hnhx" "https://invidio.xamh.de/feed/channel/UCoQXr-stSbE69TB1eZtbd8w" nil nil nil)
  171. ("Jake@Linux" "https://invidio.xamh.de/feed/channel/UC1yGcBvdPGxRIMT1yo_bKIQ" nil nil nil)
  172. ("VickyTheChills" "https://invidio.xamh.de/feed/channel/UCexZJIiztSPe6chi2foArug" nil nil nil)
  173. ("Recent Commits to librex:main" "https://github.com/hnhx/librex/commits.atom" nil nil nil)
  174. ("Recent Commits to zet:main" "https://github.com/rwxrob/zet/commits.atom" nil nil nil)
  175. ("Feed of \"SimpleWeb/SimpleAmazon\"" "https://codeberg.org/SimpleWeb/SimpleAmazon.rss" nil nil nil)
  176. ("Pokemon News" "https://zortazert.codeberg.page/pokemon-news.xml" nil nil nil)
  177. ("Professor Alex Silver" "https://invidio.xamh.de/feed/channel/UC9PgkQgiREP0f_Or0ENUaGg" nil nil nil)
  178. ("Lumiose Trainer Zac" "https://invidio.xamh.de/feed/channel/UCAu71emkK4JWb3sEnqg9gOQ" nil nil nil)
  179. ("aDrive" "https://invidio.xamh.de/feed/channel/UCTrRj46ZQfPQoVREvCMmhwQ" nil nil nil)
  180. ("MunchingOrange" "https://invidio.xamh.de/feed/channel/UC7yMooezVAKSTHrL-pG3sWg" nil nil nil)
  181. ("Release notes from rss-bridge" "https://github.com/RSS-Bridge/rss-bridge/releases.atom" nil nil nil)
  182. ("MortMort 🍞 / @MortMort_" "https://nitter.42l.fr/mortmort_/rss" nil nil nil)
  183. ("Taran Van Hemert / @TaranVH" "https://nitter.42l.fr/TaranVH/rss" nil nil nil)
  184. ("@curvygurlflo" "https://bibliogram.jordanplayz158.xyz/u/curvygurlflo/rss.xml" nil nil nil)
  185. ("curvygurlflo" "https://proxitok.herokuapp.com/@curvygurlflo/rss" nil nil nil)
  186. ("CurvyGurlFlo" "https://invidio.xamh.de/feed/channel/UCXpU9UIedzYOgryYfS6TJHQ" nil nil nil)
  187. ("curvygurlflo - Instagram Bridge" "https://feed.eugenemolotov.ru/?action=display&bridge=InstagramBridge&context=Username&u=curvygurlflo&media_type=all&format=Atom" nil nil nil)
  188. ("Gus Johnson" "https://invidio.xamh.de/feed/channel/UCpIafFPGutTAKOBHMtGen7g" nil nil nil)
  189. ("Getgle" "https://invidio.xamh.de/feed/channel/UCtbXNvxdkAdNoUkLZ5YaDvg" nil nil nil)
  190. ("Language Simp" "https://invidio.xamh.de/feed/channel/UCYNyKRHBzd7UPRUtDhofUKg" nil nil nil)
  191. ("DenshiLive" "https://denshi.live/rss.xml" nil nil nil)
  192. ("Groomer Gaming" "https://vid.puffyan.us/feed/channel/UCzmKGGMyq82DW9merws7_mg" nil nil nil)
  193. ("Gonkee" "https://invidio.xamh.de/feed/channel/UCG2IoSJBUhrGL8fb5stMCWw" nil nil nil)))
  194. '(package-selected-packages
  195. '(lsp-mode org-visibility yaml-mode mastodon license-templates licence-templates emms-setup emms jabber magit quelpa-use-package rust-mode keycast all-the-icons counsel use-package ivy-rich evil-collection))
  196. '(send-mail-function 'smtpmail-send-it))
  197. (custom-set-faces
  198. ;; custom-set-faces was added by Custom.
  199. ;; If you edit it by hand, you could mess it up, so be careful.
  200. ;; Your init file should contain only one such instance.
  201. ;; If there is more than one, they won't work right.
  202. )
  203. (use-package which-key
  204. :defer 0
  205. :diminish which-key-mode
  206. :config
  207. (which-key-mode)
  208. (setq which-key-idle-delay 1))
  209. (use-package dashboard
  210. :ensure t
  211. :init
  212. (progn
  213. (setq dashboard-banner-logo-title "Welcome to Emacs! Be productive B)")
  214. (setq dashboard-startup-banner "C:/SGZ_Pro/Hobbys/Drawings/sphere-man.png")
  215. (setq dashboard-center-content t)
  216. (setq dashboard-items '((recents . 30)
  217. (bookmarks . 5)
  218. (projects . 5)
  219. (agenda . 5)))
  220. )
  221. :config
  222. (dashboard-setup-startup-hook))
  223. (use-package elfeed
  224. :config
  225. :commands (elfeed)
  226. :bind ((:map elfeed-show-mode-map
  227. ("p" . browse-url-with-mpv)))
  228. )
  229. ;; Allow opened entries to be in a bottom split
  230. (setq elfeed-show-entry-switch 'display-buffer)
  231. (setq elfeed-search-remain-on-entry t)
  232. (defun browse-url-with-mpv (url &optional ignored)
  233. (interactive (browse-url-interactive-arg "URL: "))
  234. (call-process "mpv" nil 0 nil url))
  235. ;;Elfeed feed list
  236. (setq elfeed-feeds (quote
  237. (("https://denshi.org/rss.xml" website blog denshi)
  238. ("https://lbry.bcow.xyz/@thelinuxcast:4/rss" thelinuxcast)
  239. ("https://davidovski.xyz/rss.xml" iksvo)
  240. ("https://lbry.bcow.xyz/@bugswriter:8/rss" bugswriter)
  241. ("https://lbry.bcow.xyz/@DenshiVideo:f/rss?enclosure=true" denshi)
  242. ("https://lukesmith.xyz/rss.xml" website blog luke)
  243. ("https://lbry.bcow.xyz/@Luke:7/rss?enclosure=true" luke)
  244. ("https://zortazert.codeberg.page/rss.xml" me)
  245. ("https://lbry.bcow.xyz/@AlphaNerd:8/rss?enclosure=true" mentaloutlaw)
  246. ("https://librarian.ix.tc/@DistroTube:2?enclosure=true" distrotube)
  247. ("https://lbry.bcow.xyz/@GavinFreeborn:d?enclosure=true" gavinfreeborn)
  248. ("https://lbry.bcow.xyz/@Odysee:8/rss" blog odysee)
  249. ("https://lbry.bcow.xyz/@Odysee:8?enclosure=true" blog odysee)
  250. ("https://lbry.bcow.xyz/@OdyseeHelp:b?enclosure=true" blog odysee)
  251. ("https://lbry.bcow.xyz/@SystemCrafters:e/rss?enclosure=true" emacs systemcrafters)
  252. ("https://lbry.bcow.xyz/@blenderdumbass:f/rss?enclosure=true" blenderdumbass)
  253. ("https://lbry.bcow.xyz/@ArgoLargo:2/rss?enclosure=true" argolargo)
  254. ("https://vid.puffyan.us/feed/channel/UCsn9MzwyPKeCE6MEGtMU4gg" mort)
  255. ("https://nitter.42l.fr/mortmort_/rss" mort)
  256. ("https://lbry.bcow.xyz/@vertbyqb:8/rss?enclosure=true" verty)
  257. ("https://lbry.bcow.xyz/@lbry:3f/rss?enclosure=true" odysee blog lbry)
  258. ("https://lbry.bcow.xyz/@Nasikla:5/rss?enclosure=true" naskila troler)
  259. ("https://lbry.bcow.xyz/@BrodieRobertson:5/rss?enclosure=true" brodie))))
  260. ;; markdown stuff
  261. (use-package markdown-mode
  262. :ensure t
  263. :commands (markdown-mode gfm-mode)
  264. :mode (("README\\.md\\'" . gfm-mode)
  265. ("\\.md\\'" . markdown-mode)
  266. ("\\.markdown\\'" . markdown-mode))
  267. :init (setq markdown-command "multimarkdown"))
  268. (setq ispell-program-name "C:/SGZ_Pro/z-Apps_Drivers/Hunspell/hunspell-1.3.2-3-w32-bin/bin/hunspell.exe")
  269. ;; Show keys being pressed
  270. (use-package keycast)
  271. ;; Roooost
  272. (use-package rust-mode)
  273. ;; gnus
  274. (setq user-mail-address "trueauracoral@fedora.email"
  275. user-full-name "TrueAuraCoral")
  276. (setq gnus-select-method
  277. '(nnimap "imaps"
  278. (nnimap-address "fedora.email")
  279. (nnimap-server-port "imaps")
  280. (nnimap-stream ssl)))
  281. (setq smtpmail-smtp-server "fedora.email"
  282. smtpmail-smtp-service 587)
  283. (setq gnus-message-archive-group "nnimap:Sent")
  284. ;; OLD ACCOUNT
  285. ;;(setq user-mail-address "zortazert@matthewevan.xyz"
  286. ;; user-full-name "Zorta Zert")
  287. ;;
  288. ;;(setq gnus-select-method
  289. ;; '(nnimap "imaps"
  290. ;; (nnimap-address "mail.matthewevan.xyz")
  291. ;; (nnimap-server-port "imaps")
  292. ;; (nnimap-stream ssl)))
  293. ;;
  294. ;;(setq smtpmail-smtp-server "mail.matthewevan.xyz"
  295. ;; smtpmail-smtp-service 587)
  296. ;;(setq gnus-message-archive-group "nnimap:Sent")
  297. ;; eww
  298. (setq eww-search-prefix "https://search.davidovski.xyz/search.php?q=")
  299. ;; mastodon
  300. ;;(setq mastodon-instance-url "https://mastodon.online/")
  301. ;;(setq mastodon-activate-user "@trueauracoral")
  302. ;;(setq mastodon-auth-source-file "~/.emacs.d/masto")
  303. ;; magit
  304. (use-package magit)
  305. ;; emojify
  306. (use-package emojify)
  307. (setf dired-kill-when-opening-new-dired-buffer t)
  308. ;; licence-templates
  309. (use-package license-templates)
  310. ;; yaml
  311. (use-package yaml-mode)
  312. ;; Very nice setting to make closing emacs much quicker.
  313. (setq confirm-kill-processes nil)
  314. ;; org-visiblity
  315. (use-package org-visibility
  316. :after (org)
  317. :demand t
  318. :bind* (:map org-visibility-mode-map
  319. ("C-x C-v" . org-visibility-force-save) ; defaults to `find-alternative-file'
  320. ("C-x M-v" . org-visibility-remove)) ; defaults to undefined
  321. :hook (org-mode . org-visibility-mode)
  322. :custom
  323. ;; list of directories and files to automatically persist and restore visibility state of
  324. (org-visibility-include-paths `(,(file-truename "C:/SGZ_Pro/Hobbys/Writing/Org")
  325. ,(file-truename "C:/SGZ_Pro/Hobbys/Writing/todo.org")))
  326. ;; list of directories and files to not persist and restore visibility state of
  327. (org-visibility-exclude-paths `(,(file-truename "~/org/old")
  328. ,(file-truename "~/org/test"))))
  329. (use-package lsp-mode
  330. :commands (lsp lsp-deferred)
  331. ;; Add hooks for langs supported by lsp-mode
  332. :hook (lsp-mode . td/lsp-mode-setup)
  333. :init
  334. (setq lsp-keymap-prefix "C-c l")
  335. :config
  336. (lsp-enable-which-key-integration t))