Repository navigation
Expand file tree
/
Copy path__default.el
More file actions
executable file
·710 lines (603 loc) · 23.5 KB
/
Copy path__default.el
File metadata and controls
executable file
·710 lines (603 loc) · 23.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
(";;; package --- summary
;;; Commentary:
;;; code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; * basic init stuff
(setq initial-scratch-message \";;
;; I'm sorry, Emacs failed to start correctly.
;; Hopefully the issue will be simple to resolve.
;;
;; _.-^^---....,,--
;; _-- --_
;; < SONIC >)
;; | BOOOOOOOOM! |
;; \\._ _./
;; ```--. . , ; .--'''
;; | | |
;; .-=|| | |=-.
;; `-=#$%&%$#=-'
;; | ; :|
;; _____.,-#%&$@%#&#~,._____
\")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#+startup fold
* ;; org-use-speed-commands’ to a non-‘nil’ value
(setq org-use-speed-commands t)
* ;; looking at this for eww text to be centered?
;; pet poject Iam working on.
(setq
shr-bullet \"• \" ; Character for an <li> list item
shr-indentation 14) ; Left margin
* ;; doom/save-and-kill-buffer [ZX]
;; a doom function copied here for reference
;;;;###autoload
(defun doom/save-and-kill-buffer ()
\"Save the current buffer to file, then kill it.\"
(interactive)
(save-buffer)
(kill-current-buffer))
* ;;;; my update readme file with ediff ;;;;
(defun my/readme-update-ediff ()
\"Update git README\\\\ using ediff.\"
(interactive)
(ediff \"~/.config/doom/config.org\" \"~/.config/doom/README.org\"))
* ;;;; here's a 'regular-expression' that matches Twitter URLs: ;;;;;;;;;;;;;;;;
;;;; -----------------------------------------------------------------------;;;;
;; ```regex
;; https?:\\/\\/(www\\.)?twitter\\.com\\/.+
;; ```
;; This regular expression will match URLs that begin with \"http://\" or \"https://\",
;; followed by \"www.twitter.com\" or \"twitter.com\",
;; and then any character sequence (`.+`).
;; Here's a breakdown of the regular expression:
;; - `https?:\\/\\/` - matches either \"http://\" or \"https://\"
;; - `(www\\.)?` - matches \"www.\" (optional)
;; - `twitter\\.com` - matches \"twitter.com\"
;; - `\\/.*` - matches any character sequence following \"twitter.com\"
* ;;;; 'dired-preview--kill-buffers' ;;;;;;;;;;;;;;;;;;;;;
(dired-preview--kill-buffers)
(setq! dired-preview--buffers-threshold 1024)
(setq! dired-preview--buffers-threshold 1024000)
;; \"Maximum cumulative buffer size of previews.
;; When the accumulated preview buffers exceed this number and
;; `dired-preview--kill-buffers' is called, it will kill buffers
;; until it drops below this number.\")
(map! \"<f5> w\" :desc \"which-key-next-page-cycle\" #'which-key-show-next-page-cycle)
* ;; This is the function that makes the buffer in elfeed-summary
;;
;; ;;;###autoload
;; (defun elfeed-summary ()
;; \"Display a feed summary for elfeed.\"
;; (interactive)
;; (elfeed-summary--ensure)
;; (unless elfeed-summary--setup
;; (elfeed-summary--setup))
;; (when-let ((buffer (get-buffer elfeed-summary-buffer)))
;; (kill-buffer buffer))
;; (let ((buffer (get-buffer-create elfeed-summary-buffer)))
;; (with-current-buffer buffer
;; (elfeed-summary--render
;; (elfeed-summary--get-data)))
;; (switch-to-buffer buffer)
;; (goto-char (point-min))))
(after! elfeed-summary (λ! forward-line 3))
* ;;;; 'template' using 3 key combo template ;;;;;;;;;;;;;
(map! :leader
(:prefix-map (\"n\" . \"notes\")
(:prefix (\"j\" . \"journal\")
:desc \"New Entry\" \"j\" #'org-journal-new-entry
:desc \"New Scheduled Entry\" \"J\" #'org-journal-new-scheduled-entry
:desc \"Search Forever\" \"s\" #'org-journal-search-forever)))
* ;; possible config setting for 'org-web-tools' ;;;;;;;;;
;;
(use-package! org-web-tools
:commands (org-web-tools-read-url-as-org
org-web-tools-insert-web-page-as-entry
org-web-tools-insert-link-for-url)
:general ([remap comment-line] #'evilnc-comment-or-uncomment-lines))
* ;;;; covert to org funtion
(defun convert2org ()
“Convert the current buffer’s content into Org-mode format.”
(interactive)
;; Set buffer to Org mode
(org-mode)
;; Add a simple org-mode header to the buffer
(goto-char (point-min))
(insert “#+TITLE: Converted Document\\n”)
(insert “#+DATE: “ (format-time-string “%Y-%m-%d”) “\\n”)
;; Add an empty line for separation
(insert “\\n”)
;; Message indicating conversion is complete
(message “Buffer converted to Org-mode format.”))
* ;;;; smart paren key map
;;; smartparens
(map! (:after smartparens
:map smartparens-mode-map
\"C-M-a\" #'sp-beginning-of-sexp
\"C-M-e\" #'sp-end-of-sexp
\"C-M-f\" #'sp-forward-sexp
\"C-M-b\" #'sp-backward-sexp
\"C-M-n\" #'sp-next-sexp
\"C-M-p\" #'sp-previous-sexp
\"C-M-u\" #'sp-up-sexp
\"C-M-d\" #'sp-down-sexp
\"C-M-k\" #'sp-kill-sexp
\"C-M-t\" #'sp-transpose-sexp
\"C-M-<backspace>\" #'sp-splice-sexp))
* ;; This snippet of code can create diary entries in #emacs
;; This snippet of code can create diary entries in #emacs using the folder
;; structure like ~/Diary/2024/05_May 2024/22 May 2024, Wednesday.md just by
;; hitting C-d-d and selecting the date from the calendar.
;; Missing folders are created automatically. If an entry already exists, it will be just opened for editing.
#+begin_src emacs-lisp
(setq diary-folder \"~/Diary\")
(defun create-diary-entry (time)
(let* ((year (format-time-string \"%Y\" time))
(month-number (format-time-string \"%m\" time))
(month-name (format-time-string \"%B\" time))
(date (format-time-string \"%d\" time))
(week-day (format-time-string \"%A\" time))
(month-folder-name (concat month-number \"_\" month-name \" \" year))
(entry-name (concat date \" \" month-name \" \" year \", \" week-day))
(year-folder-path (concat diary-folder \"/\" year))
(month-folder-path (concat year-folder-path \"/\" month-folder-name))
(entry-path (concat month-folder-path \"/\" entry-name \".md\")))
(if (not (file-directory-p year-folder-path))
(make-directory year-folder-path))
(if (not (file-directory-p month-folder-path))
(make-directory month-folder-path))
(if (not (file-exists-p entry-path))
(write-region (concat \"# \" entry-name \"\\n\\n\") nil (expand-file-name entry-path)))
(find-file entry-path)
(beginning-of-line 3)))
(setq diary-date-keymap (make-sparse-keymap))
(global-set-key (kbd \"C-c d\") diary-date-keymap)
(define-key diary-date-keymap (kbd \"d\") (lambda () \"Create a diary entry with a date chosen from calendar\" (interactive) (create-diary-entry (date-to-time (org-read-date)))))
#+end_src
* ;;;; 'if' statement ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if COND THEN ELSE...) ;; format
#+begin_src emacs-lisp
;; FIXME (setting-constant nil)
(add-hook elfeed-summary-mode-hook #'cursor-placement)
(defun cursor-placement ()
\"Move cursor to first entry.\"
(interactive)
(if (point-min)
(forward-line 3)
(forward-line 3)))
#+end_src
* ;;;; lexical-binding syntax
;;; <FILE> --- <DESCRIPTION> -*- lexical-binding:t -*-
* ;;;; org-capture example template
#+begin_src emacs-lisp
(setq! org-capture-templates
(\"c\" \"codes\")
(\"cl\" \"code link\" entry
(file+headline \"~/org/wiki/code-capture.org\" \"Links\")
\"** %^{link} %^g\\n- %^{note}\\n%^{image url}\"
:immediate-finish t :prepend t))
#+end_src
* ;;;; To check whether the minor mode is enabled in the current buffer,
#+begin_src emacs-lisp
evaluate (default-value \\=repeat-mode)'.
#+end_src
* ;;;; repeat-map \"outline\"
;;;; this is what is there for Navigating.
#+begin_src emacs-lisp
;; not sure were this came from
(defvar-keymap outline-navigation-repeat-map
:repeat t
\"C-b\" #'outline-backward-same-level
\"b\" #'outline-backward-same-level
\"C-f\" #'outline-forward-same-level
\"f\" #'outline-forward-same-level
\"C-n\" #'outline-next-visible-heading
\"n\" #'outline-next-visible-heading
\"C-p\" #'outline-previous-visible-heading
\"p\" #'outline-previous-visible-heading
\"C-u\" #'outline-up-heading
\"u\" #'outline-up-heading)
;;;; not sure what this is could be a incomplete project.
(map! :after org
:map org-navigation-repeat-map
:desc \"org-previous-visible-header\"
:n \"k\" #'org-previous-visible-heading
:desc \"org-up-header\"
:n \"u\" #'org-up-heading
:desc \"evil-forward-sentence-begin\"
:n \"]\" #'evil-forward-sentence-begin)
;; this one looks official, but can't say were it comes from.
;;; Repeat-mode map.
(defvar org-navigation-repeat-map (make-sparse-keymap)
\"Repeat keymap for navigation commands.\")
(org-defkey org-navigation-repeat-map (kbd \"b\") #'org-backward-heading-same-level)
(org-defkey org-navigation-repeat-map (kbd \"f\") #'org-forward-heading-same-level)
(org-defkey org-navigation-repeat-map (kbd \"n\") #'org-next-visible-heading)
(org-defkey org-navigation-repeat-map (kbd \"p\") #'org-previous-visible-heading)
(org-defkey org-navigation-repeat-map (kbd \"u\") #'org-up-heading)
(org-defkey org-navigation-repeat-map (kbd \"0\") #'evil-forward-sentence-begin)
(map-keymap
(lambda (_key cmd)
(put cmd 'repeat-map 'org-navigation-repeat-map))
org-navigation-repeat-map)
#+end_src
* ;;;; proj automate sorting?
#+begin_src emacs-lisp
(setq my-function
(org-sort-entries t ?o))
#+end_src
* ;;;; focus-mode Read-Only
;;;###autoload
#+begin_src emacs-lisp
(define-minor-mode focus-read-only-mode
\"A read-only mode optimized for `focus-mode'.\"
:init-value nil
:keymap (let ((map (make-sparse-keymap)))
(define-key map (kbd \"n\") 'focus-next-thing)
(define-key map (kbd \"p\") 'focus-prev-thing)
(define-key map (kbd \"i\") 'focus-turn-off-focus-read-only-mode)
(define-key map (kbd \"q\") 'focus-turn-off-focus-read-only-mode)
map)
(when cursor-type
(setq focus-cursor-type cursor-type))
(if focus-read-only-mode (focus-read-only-init) (focus-read-only-terminate)))
#+end_src
* ;;;; focus-mode function
#+begin_src emacs-lisp
(map! \"C-c u\" #'focus-next-thing)
#+end_src
* ;;;; capture template for anki card (LLM)
#+begin_src emacs-lisp
(setq org-capture-templates
'((\"ra\" \"anki\" entry
(file+headline \"~/org/wiki/anki\" \"Drill Items\")
\"* %^{Front}\\n:PROPERTIES:\\n:ANKI_DECK: Master\\n:ANKI_NOTE_TYPE: Basic\\n:END:\\n\\\\** Back\\n %^{Back}\\n\\\\** Additional Info\\n %^{Additional Info}\\n\")))
#+end_src
* ;;;; example template using a function in capture
#+begin_src emacs-lisp
(setq org-capture-templates
'((\"x\" \"Test entry 1\" plain
(file \"~/tmp/test.txt\")
(function my/expense-template)
:account \"Account:Bank\")
(\"y\" \"Test entry 2\" plain
(file \"~/tmp/test.txt\")
(function my/expense-template)
:account \"Account:AnotherBank\")))
#+end_src
* ;;;; found this in a gist called my notes grab this.
#+begin_src emacs-lisp
(defun my/notes-new (title)
\"Create a new note given a title\"
(interactive \"sTitle: \")
(let ((default-directory (concat my/notes-directory \"/\")))
(find-file (concat (my/title-to-filename title) \".org\"))
(when (= 0 (buffer-size))
(insert \"#+title: \" title \"\\n\"
\"#+date: \")
(org-insert-time-stamp nil)
(insert \"\\n\\n\"))))
(defun my/title-to-filename (title)
\"Convert TITLE to a reasonable filename.\"
;; Based on the slug logic in org-roam, but org-roam also uses a
;; timestamp, and I use only the slug. BTW \"slug\" comes from
;; <https://en.wikipedia.org/wiki/Clean_URL#Slug>
(setq title (s-downcase title))
(setq title (s-replace-regexp \"[^a-zA-Z0-9]+\" \"-\" title))
(setq title (s-replace-regexp \"-+\" \"-\" title))
(setq title (s-replace-regexp \"^-\" \"\" title))
(setq title (s-replace-regexp \"-$\" \"\" title))
title)
#+end_src
* ;;; change face of ace-window
#+begin_src emacs-lisp
(custom-set-faces!
'(aw-leading-char-face
:foreground \"white\" :background \"red\"
:weight bold :height 2.5 :box (:line-width 10 :color \"red\")))
#+end_src
* ;;;; elfeed-summary-settings
#+begin_src emacs-lisp
(setq elfeed-summary-settings
(expand-file-name \"myrepo/elfeed-summary-layout/+elfeed-summary-settings.el\" doom-user-dir))
(elfeed-summary--restore-folding-state folding-state)
(elfeed-summary--refresh)
(elfeed-summary--refresh-if-exists)
(add-hook elfeed-summary-mode-hook)
;; example for reference
;; elfeed
(use-package! elfeed
:commands (elfeed)
:init
(setq elfeed-db-directory (concat doom-local-dir \"elfeed/db/\")
elfeed-enclosure-default-dir (concat doom-local-dir \"elfeed/enclosures/\"))
:config
(setq elfeed-search-filter \"@6-months-ago \"
;; what Doom has updated to.
(use-package! elfeed
:commands elfeed
:init
(setq elfeed-db-directory (file-name-concat doom-profile-data-dir \"elfeed\" \"db/\")
elfeed-enclosure-default-dir (file-name-concat doom-profile-data-dir \"elfeed\" \"enclosures/\"))
:config
(setq elfeed-search-filter \"@2-week-ago \"
elfeed-show-entry-switch #'pop-to-buffer
elfeed-show-entry-delete #'+rss/delete-pane
shr-max-image-proportion 0.8)
#+end_src
#+begin_src emacs-lisp
(setq doom-scratch-initial-major-mode org)
#+end_src
* ;;;; end-of-sexp this only works in programming modes
#+begin_src emacs-lisp
(sp-end-of-sexp &optional ARG)
#+end_src
* ;;;; evilem-default-keybindings
#+begin_src emacs-lisp
(evilem-default-keybindings \"SPC\")
;; not sure were this came from but it confuses me
(map! :prefix \"C-c\"
:n \"a\" #'evilem-motion)
;; definition of the above
(defun evilem-default-keybindings (prefix)
\"Define easymotions for all motions evil defines by default\"
(define-key evil-motion-state-map (kbd prefix) evilem-map))
#+end_src
#+begin_src emacs-lisp
(custom-set-variables
'(greader-keymap-prefix \"C-c g\"))
(defcustom greader-keymap-prefix \"C-c r\"
\"The prefix for `greader-mode' commands.\"
:type 'string
:group 'greader)
(map! :after greader
:map greader-prefix-keymap
)
(defvar greader-prefix-keymap
(let ((map (make-sparse-keymap)))
(define-key map (kbd \"s\") #'greader-toggle-tired-mode)
(define-key map (kbd \"r\") #'isearch-backward)
(define-key map (kbd \"M-SPC\") #'greader-read)
(define-key map (kbd \"l\") #'greader-set-language)
(define-key map (kbd \"t\") #'greader-toggle-timer)
(define-key map (kbd \"f\") #'greader-get-attributes)
(define-key map (kbd \"b\") #'greader-change-backend)
(define-key map (kbd \"c\") #'greader-compile-at-point)
map))
(map! :leader
(:prefix-map (\"d\" . denote)
:desc \"create note\"
:n \"n\" #'denote))
#+end_src
;; placed under config but did nothing
#+begin_src emacs-lisp
(add-hook! elfeed-summar-mode-hook #'elfeed-summary--refresh-if-exists)
#+end_src
* ;;;; rss convertion
** youtube
raw channel link
https://www.youtube.com/channel/UCaKZDEMDdQc8t6GzFj1_TDw ;; be inspired
https://www.youtube.com/channel/UCkEowWfq-LO_3EEYYzKoSoA ;; Baron coleman
example you tube feed syntax.
*** [[https://youtube.com/feeds/videos.xml?channel_id=UCL0u5uz7KZ9q-pe-VC8TY-w][Candace Owens]]
template
*** [[https://youtube.com/feeds/videos.xml?channel_id=paste-channel-id][name of link]]
*** [[https://youtube.com/feeds/videos.xml?channel_id=UCkEowWfq-LO_3EEYYzKoSoA][Baron Coleman]]
** bitchute
raw channel link
https://www.bitchute.com/channel/DBRhorSh3qv8 memerman
example rss
*** [[https://api.bitchute.com/feeds/rss/channel/LarkenRose][Larken Rose]]
needed to try it several versions till I get the right name. (open in browser)
*** [[https://api.bitchute.com/feeds/rss/channel/MemermanTheGreat][Memerman]]
* ;;;; gallery-dl function assembly tryouts
#+begin_src emacs-lisp
(defun gallery-dl-get-link()
\"Run gallery-dl on link at point.\"
(interactive)
(async-shell-command (format \"gallery-dl %s\" link)))
#+end_src
* ;;;; piper-tts testing
- finally got something to work this.
- the problem is it does not say the given text instead say albatras. Have no idea were that is coming from or what it means.
- but it is the first time it has done something other than error out. So progress.
#+begin_src bash
echo \"Hello, this is a test of Piper TTS.\" | piper-tts --model /usr/share/piper-voices/en/en_US/ryan/medium/en_US-ryan-medium.onnx -output-raw | aplay -r 22050 -f S16_LE -t raw
piper -m en_US-joe-medium -f test.wav -- 'This is a test.'
#+end_src
* org-download
#+begin_src emacs-lisp
(after! org
(use-package! org-download
:defer 15
:config
(setq-default org-download-image-dir \"~/org/wiki/note-images\")
(setq org-download-heading-lvl nil)
(add-hook 'dired-mode-hook 'org-download-enable)))
#+end_src
* pandoc-import-to-org
#+begin_src emacs-lisp
;; $DOOMDIR/packages.el
(package! org-pandoc-import
:recipe (:host github
:repo \"tecosaur/org-pandoc-import\"
:files (\"*.el\" \"filters\" \"preprocessors\")))
;; $DOOMDIR/config.el
(use-package! org-pandoc-import :after org)
#+end_src
* batch load init
#+begin_src bash
emacs -batch -l /home/dvsdude/.config/doom/config.el --eval '(message \"config.el loaded successfully!\")'
#+end_src
* ediff directory
#+begin_src emacs-lisp
(ediff \"~/.config/doom/modules/corfudvs/config.el\" \"~/.config/emacs/modules/completion/corfudvs/config.el\" nil)
(ediff \"~/.config/doom/config.org\" \"~/.config/doom/README.org\"))
#+end_src
* webpage jump from function.
here is an example.
#+begin_src emacs-lisp
;;;###autoload
(defun doom/issue-tracker ()
\"Open Doom Emacs' global issue tracker on Discourse.\"
(interactive)
(browse-url \"https://git.doomemacs.org/todo\"))
(defun tube-surf ()
\"open channel surfer\"
(interactive)
(browse-url \"https://channelsurfer.tv\"))
#+end_src
* rss-cleanup
#+begin_src emacs-lisp
'kill-emacs-hook
(defun +rss-cleanup-h ()
\"Clean up after an elfeed session. Kills all elfeed and elfeed-org files.\"
(interactive)
(add-hook 'kill-emacs-hook #'+rss--cleanup-on-kill-h)
(let ((buf (previous-buffer)))
(when (or (null buf) (not (doom-real-buffer-p buf)))
(switch-to-buffer (doom-fallback-buffer))))
(let ((search-buffers (doom-buffers-in-mode 'elfeed-search-mode))
(show-buffers (doom-buffers-in-mode 'elfeed-show-mode))
kill-buffer-query-functions)
(dolist (file (bound-and-true-p rmh-elfeed-org-files))
(when-let* ((buf (get-file-buffer (expand-file-name file org-directory))))
(kill-buffer buf)))
(dolist (b search-buffers)
(with-current-buffer b
(remove-hook 'kill-buffer-hook #'+rss-cleanup-h :local)
(kill-buffer b)))
(mapc #'kill-buffer show-buffers))
(if (and (modulep! :ui workspaces)
(+workspace-exists-p +rss-workspace-name))
(+workspace/kill +rss-workspace-name)
(when (window-configuration-p +rss--wconf)
(set-window-configuration +rss--wconf))
(setq +rss--wconf nil)
(previous-buffer)))
dirvish-setup-hook ??
#+end_src
* pdf theme
#+begin_src emacs-lisp
(pdf-view-themed-minor-mode t)
(setopt pdf-view-themed-minor-mode t)
#+end_src
* dirvish hl-line extend t
#+begin_src emacs-lisp
(after! dirvish
(add-hook! 'dired-mode-hook
(lambda ()
(face-remap-add-relative 'hl-line :extend t))))
#+end_src
* set archive directory
#+begin_src emacs-lisp
(setopt org-archive-location \"~/org/archive.org::* From %s\")
#+end_src
* set org ellipsis
#+begin_src emacs-lisp
(setopt org-ellipsis \" [...] \") ;; new default
(setopt org-ellipsis \" ... \")
(setopt org-ellipsis nil)
#+end_src
* set up for gifs
#+begin_src emacs-lisp
;; If non-nil, and the cursor is over a gif inline-image preview, animate it
(setopt +org-startup-with-animated-gifs t)
#+end_src
* +fold ellipsis
#+begin_src emacs-lisp
(setopt +fold-ellipsis \" ... \")
#+end_src
* set tag column
#+begin_src emacs-lisp
(setopt org-tag-column -77)
#+end_src
* elfeed-curate
#+begin_src emacs-lisp
;; remove a start
(defun bjm/elfeed-unstar ()
\"Remove starred tag from all selected entries.\"
(interactive )
(let* ((entries (elfeed-search))
(tag (intern \"cur8\")))
(cl-loop for entry in entries do (elfeed-untag entry tag))
(mapc #'elfeed-search-update-entry entries)
(unless (use-region-p) (forward-line))))
#+end_src
* unison sync .dir-locals.el
#+begin_src emacs-lisp
this was in a file called .dir-local.el
;; ((nil . ((unison-sync-root1 . \"/home/dvsdude/.config/doom/modules/corfudvs\")
;; (unison-sync-root2 . \"/home/dvsdude/.config/emacs/modules/completion/corfudvs\")
;; (unison-sync-excluded . (\"*.tmp\" \"*.log\"))
;; (unison-sync-one-way-sync . nil))))
#+end_src
* elfeed moving of db.
#+begin_src emacs-lisp
(use-package! elfeed
:commands (elfeed)
:init
;; (setq elfeed-db-directory (concat doom-local-dir \"elfeed/db/\")
;; elfeed-enclosure-default-dir (concat doom-local-dir \"elfeed/enclosures/\"))
(setq elfeed-db-directory (file-name-concat doom-profile-data-dir \"elfeed\" \"db/\")
elfeed-enclosure-default-dir (file-name-concat doom-profile-data-dir \"elfeed\" \"enclosures/\"))
:config
(setq elfeed-search-filter \"@6-months-ago \"
elfeed-show-entry-switch #'pop-to-buffer
elfeed-show-entry-delete #'+rss/delete-pane
elfeed-sort-order 'ascending
shr-max-image-proportion 0.8)
(set-popup-rule! \"^\\\\*elfeed-entry\"
:size 0.75 :actions '(display-buffer-below-selected)
:select t :quit nil :ttl t)
(make-directory elfeed-db-directory t)
;; Ensure elfeed buffers are treated as real
(add-hook! 'doom-real-buffer-functions
(defun +rss-buffer-p (buf)
(string-match-p \"^\\\\*elfeed\" (buffer-name buf))))
;; Enhance readability of a post
(add-hook 'elfeed-show-mode-hook #'+rss-elfeed-wrap-h)
;; (add-hook 'elfeed-search-mode-hook #'elfeed-summary)
(add-hook! 'elfeed-search-mode-hook
(add-hook 'kill-buffer-hook #'+rss-cleanup-h nil 'local))
;; Large images are annoying to scroll through, because scrolling follows the
;; cursor, so we force shr to insert images in slices.
(when +rss-enable-sliced-images
(setq-hook! 'elfeed-show-mode-hook
shr-put-image-function #'+rss-put-sliced-image-fn
shr-external-rendering-functions '((img . +rss-render-image-tag-without-underline-fn))))
;; keymap
(map! :after elfeed
:map elfeed-search-mode-map
:n [remap save-buffer] 'elfeed-tube-save
:n \"8\" #'elfeed-toggle-star
:n \"d\" #'elfeed-youtube-dl
:n \"e\" #'elfeed-eww-open
:n \"F\" #'my/elfeed-search-filter-point
:n \"h\" #'dvs/elfeed-hn-show-comments
;; :n \"r\" #'elfeed-search-update--force
:n \"r\" #'revert-buffer
:n \"R\" #'elfeed-summary
:n \"q\" #'kill-current-buffer
:n \"T\" #'my/elfeed-reddit-show-commments
:n \"v\" #'elfeed-view-mpv
:n (kbd \"M-RET\") #'elfeed-search-browse-url)
(map! :after elfeed-show
:map elfeed-show-mode-map
:n [remap next-buffer] #'+rss/next
:n [remap previous-buffer] #'+rss/previous
:n [remap save-buffer] 'elfeed-tube-save
:n \"d\" #'yt-dl-it
:n \"e\" #'my/elfeed-show-visit-eww
:n \"m\" #'elfeed-curate-toggle-star
:n \"x\" #'elfeed-kill-buffer
:n \"gc\" nil
:n \"gc\" #'elfeed-kill-link-url-at-point))
#+end_src
* map! prefix sytax
#+begin_src emacs-lisp
(map! :prefix (\"C-c M\" . \"mode-command\")
:desc \"Option A\" \"o\" #'function-a
:desc \"Option B\" \"p\" #'function-b)
#+end_src
" 23353 org-mode)