Advertisement
Guest User

org tangle problem

a guest
May 20th, 2022
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.13 KB | None | 0 0
  1. * opto's Emacs Config
  2.  
  3. :PROPERTIES:
  4. :header-args:
  5. :tangle: yes
  6. :tangle: "~/.emacs.d/init.el"
  7. :END:
  8.  
  9. #+begin_src emacs-lisp
  10. ;; test 4
  11. #+end_src
  12.  
  13. ** Use-Package
  14.  
  15. Use-Package lets us declare packages in our /init/ file and have them installed and configured automatically.
  16.  
  17. First things first, let's do some set-up. We are going to want to tell Use-Package where to get packages. We are going to use Elpa and Melpa, duh.
  18.  
  19. #+begin_src emacs-lisp
  20. (require 'package)
  21. (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
  22. (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
  23. (package-initialize)
  24. #+end_src
  25.  
  26. Next, we are going to tell Use-Package to install itself it's not already installed.
  27.  
  28. #+begin_src emacs-lisp
  29. (unless (package-installed-p 'use-package)
  30. (package-refresh-contents)
  31. (package-install 'use-package))
  32. (eval-and-compile
  33. (setq use-package-always-ensure t
  34. use-package-expand-minimally t))
  35. #+end_src
  36.  
  37. Yay, now we can start calling other packages using Use-Package!
  38.  
  39. ** Emacs Tweaks
  40.  
  41. Here we're going to set out some of the things we want to change about the base of Emacs itself.
  42.  
  43. #+begin_src emacs-lisp :noweb yes
  44. (use-package emacs
  45. :init
  46. (require 'use-package)
  47. (setq ring-bell-function 'ignore)
  48. (setq inhibit-startup-message t)
  49. (setq initial-scratch-message nil))
  50. (menu-bar-mode -1)
  51. (scroll-bar-mode -1)
  52. (tool-bar-mode -1)
  53. (global-visual-line-mode 1)
  54. <<move-saves>>
  55. #+end_src
  56.  
  57. *** Moving Backups and Autosaves to a folder
  58.  
  59. #+name: move-saves
  60. #+begin_src emacs-lisp :tangle no
  61. (setq backup-by-copying t ; don't clobber symlinks
  62. backup-directory-alist '(("." . "~/.emacs.d/.saves/")) ; don't litter my fs tree
  63. delete-old-versions t
  64. kept-new-versions 6
  65. kept-old-versions 2
  66. version-control t) ; use versioned backups
  67. (setq auto-save-file-name-transforms
  68. `((".*" "~/.emacs.d/.saves" t)))
  69. #+end_src
  70. ** EXWM
  71.  
  72. EXWM, the Emacs X Window Manager, is what makes all this possible. Right now, we are going to just load up the default config, and we will update it later.
  73.  
  74. #+begin_src emacs-lisp
  75. (use-package exwm
  76. :ensure t
  77. :config
  78. (start-process-shell-command "setxkbmap" nil "setxkbmap -option ctrl:swapcaps")
  79. ;; Set the default number of workspaces
  80. (setq exwm-workspace-number 5)
  81.  
  82. ;; These keys should always pass through to Emacs
  83. (setq exwm-input-prefix-keys
  84. '(?\C-x
  85. ?\C-u
  86. ?\C-h
  87. ?\M-x))
  88.  
  89. ;; Ctrl+Q will enable the next key to be sent directly
  90. (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
  91.  
  92. ;; Set up global key bindings. These always work, no matter the input state!
  93. ;; Keep in mind that changing this list after EXWM initializes has no effect.
  94. (setq exwm-input-global-keys
  95. `(
  96. ;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard)
  97. ([?\s-r] . exwm-reset)
  98.  
  99. ;; Move between windows
  100. ([?\s-h] . windmove-left)
  101. ([?\s-l] . windmove-right)
  102. ([?\s-k] . windmove-up)
  103. ([?\s-j] . windmove-down)
  104.  
  105. ;; Launch applications via shell command
  106. ([?\s-&] . (lambda (command)
  107. (interactive (list (read-shell-command "$ ")))
  108. (start-process-shell-command command nil command)))
  109.  
  110. ;; Switch workspace
  111. ([?\s-w] . exwm-workspace-switch)
  112. ([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0)))
  113.  
  114. ;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9)
  115. ,@(mapcar (lambda (i)
  116. `(,(kbd (format "s-%d" i)) .
  117. (lambda ()
  118. (interactive)
  119. (exwm-workspace-switch-create ,i))))
  120. (number-sequence 0 9))))
  121.  
  122. (exwm-enable))
  123. #+end_src
  124.  
  125. ** Org
  126.  
  127. We love Org. Let's get some useful things going in it.
  128.  
  129. #+begin_src emacs-lisp :noweb yes
  130. (use-package org
  131. :ensure t
  132. :config
  133. <<org-agenda>>
  134. (setq org-use-property-inheritance t)
  135. (org-babel-do-load-languages
  136. 'org-babel-load-languages
  137. '((lisp . t)
  138. (emacs-lisp . t)))
  139. (setq org-startup-indented t))
  140. #+end_src
  141.  
  142. *** Org-Agenda
  143.  
  144. We're gonna set some things to do with Org Agenda. Right now we are going to
  145.  
  146. 1. Tell Org where to look for tasks
  147. 2. Tell Org how to log completed tasks
  148. 3. Make Agenda start in Log Mode
  149.  
  150. #+name: org-agenda
  151. #+begin_src emacs-lisp :tangle no
  152. (setq org-agenda-files
  153. '("~/org/"))
  154. (setq org-log-done 'time)
  155. (setq org-log-into-drawer t)
  156. (setq org-agenda-start-with-log-mode t)
  157. #+end_src
  158. ** Theme
  159.  
  160. We love Gruvbox, let's get it!
  161.  
  162. #+begin_src emacs-lisp
  163. (use-package gruvbox-theme
  164. :ensure t
  165. :init
  166. (load-theme 'gruvbox-dark-soft t))
  167. #+end_src
  168.  
  169. ** Evil
  170.  
  171. Evil lets us use Vim within Emacs. Perfect!
  172.  
  173. #+begin_src emacs-lisp
  174. (use-package evil
  175. :ensure t
  176. :init
  177. (evil-mode 1))
  178. #+end_src
  179. ** Magit
  180.  
  181. #+begin_src emacs-lisp
  182. (use-package magit
  183. :ensure t
  184. :init)
  185. #+end_src
  186. ** Vertico
  187.  
  188. [[https://github.com/minad/vertico][Vertico provides a performant and minimalistic vertical completion UI based on the default completion system]]
  189.  
  190. #+begin_src emacs-lisp
  191. (use-package vertico
  192. :ensure t
  193. :init
  194. (vertico-mode))
  195. #+end_src
  196. ** Orderless
  197.  
  198. [[https://github.com/oantolin/orderless][Orderless]] provides an orderless completion style that divides the pattern into space-separated components, and matches candidates that match all of the components in any order.
  199.  
  200. #+begin_src emacs-lisp
  201. (use-package orderless
  202. :ensure t
  203. :custom
  204. (completion-styles '(orderless basic))
  205. (completion-category-overrides '((file (styles basic partial-completion)))))
  206. #+end_src
  207.  
  208. ** Save-Hist
  209.  
  210. We want to save our history to persist over restarts, no?
  211.  
  212. #+begin_src emacs-lisp
  213. (use-package savehist
  214. :ensure t
  215. :init
  216. (savehist-mode))
  217. #+end_src
  218.  
  219. ** PDF-Tools
  220.  
  221. #+begin_src emacs-lisp
  222. (use-package pdf-tools
  223. :ensure t)
  224. #+end_src
  225.  
  226. ** Novel Mode
  227.  
  228. [[https://depp.brause.cc/nov.el/][Nov.el]] lets us read .epub files in Emacs.
  229.  
  230. #+begin_src emacs-lisp
  231. (use-package nov
  232. :ensure t
  233. :config* opto's Emacs Config
  234.  
  235. :PROPERTIES:
  236. :header-args:
  237. :tangle: yes
  238. :tangle: "~/.emacs.d/init.el"
  239. :END:
  240.  
  241. #+begin_src emacs-lisp
  242. ;; test 4
  243. #+end_src
  244.  
  245. ** Use-Package
  246.  
  247. Use-Package lets us declare packages in our /init/ file and have them installed and configured automatically.
  248.  
  249. First things first, let's do some set-up. We are going to want to tell Use-Package where to get packages. We are going to use Elpa and Melpa, duh.
  250.  
  251. #+begin_src emacs-lisp
  252. (require 'package)
  253. (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
  254. (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
  255. (package-initialize)
  256. #+end_src
  257.  
  258. Next, we are going to tell Use-Package to install itself it's not already installed.
  259.  
  260. #+begin_src emacs-lisp
  261. (unless (package-installed-p 'use-package)
  262. (package-refresh-contents)
  263. (package-install 'use-package))
  264. (eval-and-compile
  265. (setq use-package-always-ensure t
  266. use-package-expand-minimally t))
  267. #+end_src
  268.  
  269. Yay, now we can start calling other packages using Use-Package!
  270.  
  271. ** Emacs Tweaks
  272.  
  273. Here we're going to set out some of the things we want to change about the base of Emacs itself.
  274.  
  275. #+begin_src emacs-lisp :noweb yes
  276. (use-package emacs
  277. :init
  278. (require 'use-package)
  279. (setq ring-bell-function 'ignore)
  280. (setq inhibit-startup-message t)
  281. (setq initial-scratch-message nil))
  282. (menu-bar-mode -1)
  283. (scroll-bar-mode -1)
  284. (tool-bar-mode -1)
  285. (global-visual-line-mode 1)
  286. <<move-saves>>
  287. #+end_src
  288.  
  289. *** Moving Backups and Autosaves to a folder
  290.  
  291. #+name: move-saves
  292. #+begin_src emacs-lisp :tangle no
  293. (setq backup-by-copying t ; don't clobber symlinks
  294. backup-directory-alist '(("." . "~/.emacs.d/.saves/")) ; don't litter my fs tree
  295. delete-old-versions t
  296. kept-new-versions 6
  297. kept-old-versions 2
  298. version-control t) ; use versioned backups
  299. (setq auto-save-file-name-transforms
  300. `((".*" "~/.emacs.d/.saves" t)))
  301. #+end_src
  302. ** EXWM
  303.  
  304. EXWM, the Emacs X Window Manager, is what makes all this possible. Right now, we are going to just load up the default config, and we will update it later.
  305.  
  306. #+begin_src emacs-lisp
  307. (use-package exwm
  308. :ensure t
  309. :config
  310. (start-process-shell-command "setxkbmap" nil "setxkbmap -option ctrl:swapcaps")
  311. ;; Set the default number of workspaces
  312. (setq exwm-workspace-number 5)
  313.  
  314. ;; These keys should always pass through to Emacs
  315. (setq exwm-input-prefix-keys
  316. '(?\C-x
  317. ?\C-u
  318. ?\C-h
  319. ?\M-x))
  320.  
  321. ;; Ctrl+Q will enable the next key to be sent directly
  322. (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
  323.  
  324. ;; Set up global key bindings. These always work, no matter the input state!
  325. ;; Keep in mind that changing this list after EXWM initializes has no effect.
  326. (setq exwm-input-global-keys
  327. `(
  328. ;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard)
  329. ([?\s-r] . exwm-reset)
  330.  
  331. ;; Move between windows
  332. ([?\s-h] . windmove-left)
  333. ([?\s-l] . windmove-right)
  334. ([?\s-k] . windmove-up)
  335. ([?\s-j] . windmove-down)
  336.  
  337. ;; Launch applications via shell command
  338. ([?\s-&] . (lambda (command)
  339. (interactive (list (read-shell-command "$ ")))
  340. (start-process-shell-command command nil command)))
  341.  
  342. ;; Switch workspace
  343. ([?\s-w] . exwm-workspace-switch)
  344. ([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0)))
  345.  
  346. ;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9)
  347. ,@(mapcar (lambda (i)
  348. `(,(kbd (format "s-%d" i)) .
  349. (lambda ()
  350. (interactive)
  351. (exwm-workspace-switch-create ,i))))
  352. (number-sequence 0 9))))
  353.  
  354. (exwm-enable))
  355. #+end_src
  356.  
  357. ** Org
  358.  
  359. We love Org. Let's get some useful things going in it.
  360.  
  361. #+begin_src emacs-lisp :noweb yes
  362. (use-package org
  363. :ensure t
  364. :config
  365. <<org-agenda>>
  366. (setq org-use-property-inheritance t)
  367. (org-babel-do-load-languages
  368. 'org-babel-load-languages
  369. '((lisp . t)
  370. (emacs-lisp . t)))
  371. (setq org-startup-indented t))
  372. #+end_src
  373.  
  374. *** Org-Agenda
  375.  
  376. We're gonna set some things to do with Org Agenda. Right now we are going to
  377.  
  378. 1. Tell Org where to look for tasks
  379. 2. Tell Org how to log completed tasks
  380. 3. Make Agenda start in Log Mode
  381.  
  382. #+name: org-agenda
  383. #+begin_src emacs-lisp :tangle no
  384. (setq org-agenda-files
  385. '("~/org/"))
  386. (setq org-log-done 'time)
  387. (setq org-log-into-drawer t)
  388. (setq org-agenda-start-with-log-mode t)
  389. #+end_src
  390. ** Theme
  391.  
  392. We love Gruvbox, let's get it!
  393.  
  394. #+begin_src emacs-lisp
  395. (use-package gruvbox-theme
  396. :ensure t
  397. :init
  398. (load-theme 'gruvbox-dark-soft t))
  399. #+end_src
  400.  
  401. ** Evil
  402.  
  403. Evil lets us use Vim within Emacs. Perfect!
  404.  
  405. #+begin_src emacs-lisp
  406. (use-package evil
  407. :ensure t
  408. :init
  409. (evil-mode 1))
  410. #+end_src
  411. ** Magit
  412.  
  413. #+begin_src emacs-lisp
  414. (use-package magit
  415. :ensure t
  416. :init)
  417. #+end_src
  418. ** Vertico
  419.  
  420. [[https://github.com/minad/vertico][Vertico provides a performant and minimalistic vertical completion UI based on the default completion system]]
  421.  
  422. #+begin_src emacs-lisp
  423. (use-package vertico
  424. :ensure t
  425. :init
  426. (vertico-mode))
  427. #+end_src
  428. ** Orderless
  429.  
  430. [[https://github.com/oantolin/orderless][Orderless]] provides an orderless completion style that divides the pattern into space-separated components, and matches candidates that match all of the components in any order.
  431.  
  432. #+begin_src emacs-lisp
  433. (use-package orderless
  434. :ensure t
  435. :custom
  436. (completion-styles '(orderless basic))
  437. (completion-category-overrides '((file (styles basic partial-completion)))))
  438. #+end_src
  439.  
  440. ** Save-Hist
  441.  
  442. We want to save our history to persist over restarts, no?
  443.  
  444. #+begin_src emacs-lisp
  445. (use-package savehist
  446. :ensure t
  447. :init
  448. (savehist-mode))
  449. #+end_src
  450.  
  451. ** PDF-Tools
  452.  
  453. #+begin_src emacs-lisp
  454. (use-package pdf-tools
  455. :ensure t)
  456. #+end_src
  457.  
  458. ** Novel Mode
  459.  
  460. [[https://depp.brause.cc/nov.el/][Nov.el]] lets us read .epub files in Emacs.
  461.  
  462. #+begin_src emacs-lisp
  463. (use-package nov
  464. :ensure t
  465. :config
  466. (setq nov-unzip-program (executable-find "/usr/bin/unzip")))
  467.  
  468. #+end_src
  469. ** SLIME
  470.  
  471. [[https://github.com/slime/slime][SLIME]] is the 'Superior Lisp Interaction Mode for Emacs' and provides an interactive environment for developing with Common Lisp.
  472.  
  473. #+begin_src emacs-lisp
  474. (use-package slime
  475. :ensure t
  476. :config
  477. (setq inferior-lisp-program "sbcl"))
  478. #+end_src
  479.  
  480. * To-Do List
  481.  
  482. :PROPERTIES:
  483. :header-args:
  484. :tangle: no
  485. :END:
  486.  
  487. #+begin_src emacs-lisp
  488. ;; testing second section
  489. #+end_src
  490.  
  491.  
  492.  
  493. (setq nov-unzip-program (executable-find "/usr/bin/unzip")))
  494.  
  495. #+end_src
  496. ** SLIME
  497.  
  498. [[https://github.com/slime/slime][SLIME]] is the 'Superior Lisp Interaction Mode for Emacs' and provides an interactive environment for developing with Common Lisp.
  499.  
  500. #+begin_src emacs-lisp
  501. (use-package slime
  502. :ensure t
  503. :config
  504. (setq inferior-lisp-program "sbcl"))
  505. #+end_src
  506.  
  507. * To-Do List
  508.  
  509. :PROPERTIES:
  510. :header-args:
  511. :tangle: no
  512. :END:
  513.  
  514. #+begin_src emacs-lisp
  515. ;; testing second section
  516. #+end_src
  517.  
  518.  
  519.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement