adding devdocs

This commit is contained in:
Chris Cochrun 2022-03-24 13:51:32 -05:00
parent 3cf1d6aa36
commit b7e7249283
2 changed files with 106 additions and 35 deletions

View file

@ -944,8 +944,8 @@ Trying out corfu instead of company
;; Add `completion-at-point-functions', used by `completion-at-point'. ;; Add `completion-at-point-functions', used by `completion-at-point'.
(add-to-list 'completion-at-point-functions #'cape-file) (add-to-list 'completion-at-point-functions #'cape-file)
;; (add-to-list 'completion-at-point-functions #'cape-tex) ;; (add-to-list 'completion-at-point-functions #'cape-tex)
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-keyword) (add-to-list 'completion-at-point-functions #'cape-keyword)
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
;;(add-to-list 'completion-at-point-functions #'cape-sgml) ;;(add-to-list 'completion-at-point-functions #'cape-sgml)
;;(add-to-list 'completion-at-point-functions #'cape-rfc1345) ;;(add-to-list 'completion-at-point-functions #'cape-rfc1345)
;;(add-to-list 'completion-at-point-functions #'cape-abbrev) ;;(add-to-list 'completion-at-point-functions #'cape-abbrev)
@ -953,11 +953,20 @@ Trying out corfu instead of company
;;(add-to-list 'completion-at-point-functions #'cape-dict) ;;(add-to-list 'completion-at-point-functions #'cape-dict)
;; (add-to-list 'completion-at-point-functions #'cape-symbol) ;; (add-to-list 'completion-at-point-functions #'cape-symbol)
;;(add-to-list 'completion-at-point-functions #'cape-line) ;;(add-to-list 'completion-at-point-functions #'cape-line)
:config :config
(setq cape-dabbrev-min-length 2) (setq cape-dabbrev-min-length 2)
) )
#+END_SRC #+END_SRC
*** Devdocs
Devdocs.io is a pretty great place to see documentation on nearly any developer technology. Devdocs.el will bring all that documentation right inside Emacs.
#+begin_src emacs-lisp
(use-package devdocs
:general
(chris/leader-keys 'normal
"hd" 'devdocs-lookup))
#+end_src
** YASnippet ** YASnippet
YASnippet is a templating system. It's powerful. YASnippet is a templating system. It's powerful.
@ -1109,7 +1118,23 @@ Since I like to make my window manager handle a lot of the window management, I
:commands (helpful-callable helpful-variable helpful-command helpful-key) :commands (helpful-callable helpful-variable helpful-command helpful-key)
:general :general
(general-def 'normal 'helpful-mode-map (general-def 'normal 'helpful-mode-map
"q" 'chris/kill-buffer-frame)) "q" 'helpful-kill-buffers)
:config
(defun helpful--autoloaded-p (sym buf)
"Return non-nil if function SYM is autoloaded."
(-when-let (file-name (buffer-file-name buf))
(setq file-name (s-chop-suffix ".gz" file-name))
(help-fns--autoloaded-p sym)))
(defun helpful--skip-advice (docstring)
"Remove mentions of advice from DOCSTRING."
(let* ((lines (s-lines docstring))
(relevant-lines
(--take-while
(not (or (s-starts-with-p ":around advice:" it)
(s-starts-with-p "This function has :around advice:" it)))
lines)))
(s-trim (s-join "\n" relevant-lines)))))
#+end_src #+end_src
** Format ** Format
@ -1319,7 +1344,8 @@ I'm making a small function in here to open files in the appropriate program usi
(message file) (message file)
(call-process "xdg-open" nil 0 nil file))) (call-process "xdg-open" nil 0 nil file)))
(setq dired-dwim-target t) (setq dired-dwim-target t
delete-by-moving-to-trash t)
(setq dired-listing-switches "-aoh --group-directories-first") (setq dired-listing-switches "-aoh --group-directories-first")
(setq dired-hide-details-hide-symlink-targets nil (setq dired-hide-details-hide-symlink-targets nil
@ -1332,7 +1358,7 @@ I'm making a small function in here to open files in the appropriate program usi
:keymaps 'override :keymaps 'override
"od" '(dired-jump :which-key "open dired here") "od" '(dired-jump :which-key "open dired here")
"oD" '(dired :which-key "open dired select")) "oD" '(dired :which-key "open dired select"))
(general-def 'normal dired-mode-map ('normal dired-mode-map
"q" 'kill-this-buffer "q" 'kill-this-buffer
"C-<return>" 'chris/dired-open-xdg "C-<return>" 'chris/dired-open-xdg
"C-'" 'embark-act)) "C-'" 'embark-act))
@ -1407,9 +1433,17 @@ Let's try using dirvish as a kind of ranger
("t" "~/.local/share/Trash/files/" "TrashCan"))) ("t" "~/.local/share/Trash/files/" "TrashCan")))
:config :config
(dirvish-override-dired-mode) (dirvish-override-dired-mode)
(dirvish-peek-mode) ;; (dirvish-peek-mode)
(setq dirvish-attributes '(all-the-icons file-size)) (setq dirvish-attributes '(all-the-icons file-size))
(dirvish-define-preview exa (file)
"Uses `exa' to generate directory preview."
(when (file-directory-p file) ; we only interest in directories here
`(shell . ("exa" "--color=always" "-al" ,file))))
(add-to-list 'dirvish-preview-dispatchers 'exa)
(set-face-attribute 'ansi-color-blue nil :foreground "#FFFFFF")
(defun chris/dirvish-quit () (defun chris/dirvish-quit ()
"quit a fullscreen dirvish if it's open, else do a normal kill buffer" "quit a fullscreen dirvish if it's open, else do a normal kill buffer"
(interactive) (interactive)
@ -1417,10 +1451,8 @@ Let's try using dirvish as a kind of ranger
(dirvish-quit-h) (dirvish-quit-h)
(with-current-buffer (with-current-buffer
(current-buffer) (current-buffer)
(dirvish-toggle-fullscreen)) (dirvish-toggle-fullscreen)
(with-current-buffer (dirvish-quit-h))))
(current-buffer)
(kill-this-buffer))))
:general :general
(chris/leader-keys 'normal 'override (chris/leader-keys 'normal 'override
"od" 'dirvish-dired :which-key "open dirvish here") "od" 'dirvish-dired :which-key "open dirvish here")
@ -1530,7 +1562,7 @@ Part of this config includes some special capture templates for my work as a you
:jump-to-captured t) :jump-to-captured t)
("r" "Templates for projects") ("r" "Templates for projects")
("rt" "Project-local todo" entry ("rt" "Project-local todo" entry
(file+headline +org-capture-project-todo-file "Inbox") (file+headline chris/project-todo "Inbox")
"* TODO %?\n%i\n%a" :prepend t) "* TODO %?\n%i\n%a" :prepend t)
("rn" "Project-local notes" entry ("rn" "Project-local notes" entry
(file+headline +org-capture-project-notes-file "Inbox") (file+headline +org-capture-project-notes-file "Inbox")
@ -1576,6 +1608,7 @@ Part of this config includes some special capture templates for my work as a you
"/home/chris/org/newsletter.org" "/home/chris/org/newsletter.org"
"/home/chris/org/archive.org" "/home/chris/org/archive.org"
"/home/chris/org/nvtfc_social_media.org" "/home/chris/org/nvtfc_social_media.org"
"/home/chris/dev/church-presenter/TODO.org"
"/home/chris/org/lessons/") "/home/chris/org/lessons/")
org-id-method 'ts org-id-method 'ts
org-agenda-tags-column -105) org-agenda-tags-column -105)
@ -1672,6 +1705,10 @@ We need to create a lesson capture function to find our lesson files differently
(search-forward "PLAN"))) (search-forward "PLAN")))
#+end_src #+end_src
#+begin_src emacs-lisp
(defun chris/project-todo ()
(concat (projectile-project-root) "TODO.org"))
#+end_src
We are also going to make our config auto-tangle. This is so helpful on saving the .org file tangles out the config automatically. We are also going to make our config auto-tangle. This is so helpful on saving the .org file tangles out the config automatically.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun chris/org-babel-tangle-config () (defun chris/org-babel-tangle-config ()
@ -1997,7 +2034,7 @@ If on a:
(setq mu4e-contexts (setq mu4e-contexts
(list (list
(make-mu4e-context (make-mu4e-context
:name "office" :name "work"
:match-func :match-func
(lambda (msg) (lambda (msg)
(when msg (when msg
@ -2008,9 +2045,9 @@ If on a:
(mu4e-trash-folder . "/office/Deleted Items") (mu4e-trash-folder . "/office/Deleted Items")
(mu4e-refile-folder . "/office/Archive") (mu4e-refile-folder . "/office/Archive")
(smtpmail-smtp-user . "chris@tfcconnection.org") (smtpmail-smtp-user . "chris@tfcconnection.org")
(mu4e-compose-signature . "---\nChris Cochrun"))) (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun")))
(make-mu4e-context (make-mu4e-context
:name "outlook" :name "personal"
:match-func :match-func
(lambda (msg) (lambda (msg)
(when msg (when msg
@ -2021,7 +2058,7 @@ If on a:
(mu4e-trash-folder . "/outlook/Deleted") (mu4e-trash-folder . "/outlook/Deleted")
(mu4e-refile-folder . "/outlook/Archive") (mu4e-refile-folder . "/outlook/Archive")
(smtpmail-smtp-user . "chris.cochrun@outlook.com") (smtpmail-smtp-user . "chris.cochrun@outlook.com")
(mu4e-compose-signature . "---\nChris Cochrun"))) (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun")))
(make-mu4e-context (make-mu4e-context
:name "gmail" :name "gmail"
:match-func :match-func
@ -2031,7 +2068,7 @@ If on a:
:vars '((user-mail-address . "ccochrun21@gmail.com") :vars '((user-mail-address . "ccochrun21@gmail.com")
(mu4e-sent-folder . "/gmail/[Gmail].Sent Mail/") (mu4e-sent-folder . "/gmail/[Gmail].Sent Mail/")
(smtpmail-smtp-user . "ccochrun21@gmail.com") (smtpmail-smtp-user . "ccochrun21@gmail.com")
(mu4e-compose-signature . "---\nChris Cochrun"))))) (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun")))))
;; Add the ability to send email for o365 ;; Add the ability to send email for o365
(setq message-send-mail-function 'smtpmail-send-it (setq message-send-mail-function 'smtpmail-send-it
@ -2071,7 +2108,9 @@ If on a:
:key 112))) :key 112)))
(setq mu4e-mu-binary "/usr/bin/mu" (setq mu4e-mu-binary "/usr/bin/mu"
mu4e-view-prefer-html nil) mu4e-view-prefer-html nil
shr-color-visible-luminance-min 80)
(setq mu4e-use-fancy-chars t (setq mu4e-use-fancy-chars t
mu4e-headers-draft-mark '("D" . "") mu4e-headers-draft-mark '("D" . "")
mu4e-headers-flagged-mark '("F" . "") mu4e-headers-flagged-mark '("F" . "")
@ -2417,11 +2456,13 @@ Let's use pdf-tools for a lot better interaction with pdfs.
#+begin_src emacs-lisp :tangle no #+begin_src emacs-lisp :tangle no
(use-package eaf (use-package eaf
:straight (:host github :repo "manateelazycat/emacs-application-framework" :straight (:host github :repo "emacs-eaf/emacs-application-framework"
:files ("*.el" "*.py" "core" "app")) :files ("*.el" "*.py" "core" "*.json" "app" "*"))
:defer 1 :defer 1
:config :custom
(setq eaf-browser-dark-mode t)) (eaf-browser-dark-mode t)
(eaf-browser-continue-where-left-off t)
(eaf-browser-enable-adblocker t))
#+end_src #+end_src
** Elfeed ** Elfeed
@ -2648,7 +2689,8 @@ Matrix.el is a decent enough matrix client built in emacs. Like it.
(use-package ement (use-package ement
:straight (ement :type git :host github :repo "alphapapa/ement.el") :straight (ement :type git :host github :repo "alphapapa/ement.el")
:config :config
(setq ement-room-images t) (setq ement-room-images t
ement-save-sessions t)
:general :general
(general-def 'normal ement-room-mode-map (general-def 'normal ement-room-mode-map
"q" 'bury-buffer "q" 'bury-buffer

57
init.el
View file

@ -560,8 +560,8 @@ targets."
;; Add `completion-at-point-functions', used by `completion-at-point'. ;; Add `completion-at-point-functions', used by `completion-at-point'.
(add-to-list 'completion-at-point-functions #'cape-file) (add-to-list 'completion-at-point-functions #'cape-file)
;; (add-to-list 'completion-at-point-functions #'cape-tex) ;; (add-to-list 'completion-at-point-functions #'cape-tex)
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-keyword) (add-to-list 'completion-at-point-functions #'cape-keyword)
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
;;(add-to-list 'completion-at-point-functions #'cape-sgml) ;;(add-to-list 'completion-at-point-functions #'cape-sgml)
;;(add-to-list 'completion-at-point-functions #'cape-rfc1345) ;;(add-to-list 'completion-at-point-functions #'cape-rfc1345)
;;(add-to-list 'completion-at-point-functions #'cape-abbrev) ;;(add-to-list 'completion-at-point-functions #'cape-abbrev)
@ -569,10 +569,16 @@ targets."
;;(add-to-list 'completion-at-point-functions #'cape-dict) ;;(add-to-list 'completion-at-point-functions #'cape-dict)
;; (add-to-list 'completion-at-point-functions #'cape-symbol) ;; (add-to-list 'completion-at-point-functions #'cape-symbol)
;;(add-to-list 'completion-at-point-functions #'cape-line) ;;(add-to-list 'completion-at-point-functions #'cape-line)
:config :config
(setq cape-dabbrev-min-length 2) (setq cape-dabbrev-min-length 2)
) )
(use-package devdocs
:general
(chris/leader-keys 'normal
"hd" 'devdocs-lookup))
(use-package yasnippet (use-package yasnippet
:config :config
(setq yas-snippet-dirs (list (expand-file-name "yasnippets/" user-emacs-directory))) (setq yas-snippet-dirs (list (expand-file-name "yasnippets/" user-emacs-directory)))
@ -684,7 +690,23 @@ targets."
:commands (helpful-callable helpful-variable helpful-command helpful-key) :commands (helpful-callable helpful-variable helpful-command helpful-key)
:general :general
(general-def 'normal 'helpful-mode-map (general-def 'normal 'helpful-mode-map
"q" 'chris/kill-buffer-frame)) "q" 'helpful-kill-buffers)
:config
(defun helpful--autoloaded-p (sym buf)
"Return non-nil if function SYM is autoloaded."
(-when-let (file-name (buffer-file-name buf))
(setq file-name (s-chop-suffix ".gz" file-name))
(help-fns--autoloaded-p sym)))
(defun helpful--skip-advice (docstring)
"Remove mentions of advice from DOCSTRING."
(let* ((lines (s-lines docstring))
(relevant-lines
(--take-while
(not (or (s-starts-with-p ":around advice:" it)
(s-starts-with-p "This function has :around advice:" it)))
lines)))
(s-trim (s-join "\n" relevant-lines)))))
(use-package format-all (use-package format-all
:config :config
@ -817,7 +839,8 @@ targets."
(message file) (message file)
(call-process "xdg-open" nil 0 nil file))) (call-process "xdg-open" nil 0 nil file)))
(setq dired-dwim-target t) (setq dired-dwim-target t
delete-by-moving-to-trash t)
(setq dired-listing-switches "-aoh --group-directories-first") (setq dired-listing-switches "-aoh --group-directories-first")
(setq dired-hide-details-hide-symlink-targets nil (setq dired-hide-details-hide-symlink-targets nil
@ -830,7 +853,7 @@ targets."
:keymaps 'override :keymaps 'override
"od" '(dired-jump :which-key "open dired here") "od" '(dired-jump :which-key "open dired here")
"oD" '(dired :which-key "open dired select")) "oD" '(dired :which-key "open dired select"))
(general-def 'normal dired-mode-map ('normal dired-mode-map
"q" 'kill-this-buffer "q" 'kill-this-buffer
"C-<return>" 'chris/dired-open-xdg "C-<return>" 'chris/dired-open-xdg
"C-'" 'embark-act)) "C-'" 'embark-act))
@ -959,7 +982,7 @@ targets."
:jump-to-captured t) :jump-to-captured t)
("r" "Templates for projects") ("r" "Templates for projects")
("rt" "Project-local todo" entry ("rt" "Project-local todo" entry
(file+headline +org-capture-project-todo-file "Inbox") (file+headline chris/project-todo "Inbox")
"* TODO %?\n%i\n%a" :prepend t) "* TODO %?\n%i\n%a" :prepend t)
("rn" "Project-local notes" entry ("rn" "Project-local notes" entry
(file+headline +org-capture-project-notes-file "Inbox") (file+headline +org-capture-project-notes-file "Inbox")
@ -1005,6 +1028,7 @@ targets."
"/home/chris/org/newsletter.org" "/home/chris/org/newsletter.org"
"/home/chris/org/archive.org" "/home/chris/org/archive.org"
"/home/chris/org/nvtfc_social_media.org" "/home/chris/org/nvtfc_social_media.org"
"/home/chris/dev/church-presenter/TODO.org"
"/home/chris/org/lessons/") "/home/chris/org/lessons/")
org-id-method 'ts org-id-method 'ts
org-agenda-tags-column -105) org-agenda-tags-column -105)
@ -1097,6 +1121,9 @@ targets."
(goto-char (point-min)) (goto-char (point-min))
(search-forward "PLAN"))) (search-forward "PLAN")))
(defun chris/project-todo ()
(concat (projectile-project-root) "TODO.org"))
(defun chris/org-babel-tangle-config () (defun chris/org-babel-tangle-config ()
(when (string-equal (buffer-file-name) (when (string-equal (buffer-file-name)
(expand-file-name "README.org" user-emacs-directory)) (expand-file-name "README.org" user-emacs-directory))
@ -1381,7 +1408,7 @@ If on a:
(setq mu4e-contexts (setq mu4e-contexts
(list (list
(make-mu4e-context (make-mu4e-context
:name "office" :name "work"
:match-func :match-func
(lambda (msg) (lambda (msg)
(when msg (when msg
@ -1392,9 +1419,9 @@ If on a:
(mu4e-trash-folder . "/office/Deleted Items") (mu4e-trash-folder . "/office/Deleted Items")
(mu4e-refile-folder . "/office/Archive") (mu4e-refile-folder . "/office/Archive")
(smtpmail-smtp-user . "chris@tfcconnection.org") (smtpmail-smtp-user . "chris@tfcconnection.org")
(mu4e-compose-signature . "---\nChris Cochrun"))) (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun")))
(make-mu4e-context (make-mu4e-context
:name "outlook" :name "personal"
:match-func :match-func
(lambda (msg) (lambda (msg)
(when msg (when msg
@ -1405,7 +1432,7 @@ If on a:
(mu4e-trash-folder . "/outlook/Deleted") (mu4e-trash-folder . "/outlook/Deleted")
(mu4e-refile-folder . "/outlook/Archive") (mu4e-refile-folder . "/outlook/Archive")
(smtpmail-smtp-user . "chris.cochrun@outlook.com") (smtpmail-smtp-user . "chris.cochrun@outlook.com")
(mu4e-compose-signature . "---\nChris Cochrun"))) (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun")))
(make-mu4e-context (make-mu4e-context
:name "gmail" :name "gmail"
:match-func :match-func
@ -1415,7 +1442,7 @@ If on a:
:vars '((user-mail-address . "ccochrun21@gmail.com") :vars '((user-mail-address . "ccochrun21@gmail.com")
(mu4e-sent-folder . "/gmail/[Gmail].Sent Mail/") (mu4e-sent-folder . "/gmail/[Gmail].Sent Mail/")
(smtpmail-smtp-user . "ccochrun21@gmail.com") (smtpmail-smtp-user . "ccochrun21@gmail.com")
(mu4e-compose-signature . "---\nChris Cochrun"))))) (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun")))))
;; Add the ability to send email for o365 ;; Add the ability to send email for o365
(setq message-send-mail-function 'smtpmail-send-it (setq message-send-mail-function 'smtpmail-send-it
@ -1455,7 +1482,9 @@ If on a:
:key 112))) :key 112)))
(setq mu4e-mu-binary "/usr/bin/mu" (setq mu4e-mu-binary "/usr/bin/mu"
mu4e-view-prefer-html nil) mu4e-view-prefer-html nil
shr-color-visible-luminance-min 80)
(setq mu4e-use-fancy-chars t (setq mu4e-use-fancy-chars t
mu4e-headers-draft-mark '("D" . "") mu4e-headers-draft-mark '("D" . "")
mu4e-headers-flagged-mark '("F" . "") mu4e-headers-flagged-mark '("F" . "")
@ -1942,7 +1971,8 @@ interfere with the default `bongo-playlist-buffer'."
(use-package ement (use-package ement
:straight (ement :type git :host github :repo "alphapapa/ement.el") :straight (ement :type git :host github :repo "alphapapa/ement.el")
:config :config
(setq ement-room-images t) (setq ement-room-images t
ement-save-sessions t)
:general :general
(general-def 'normal ement-room-mode-map (general-def 'normal ement-room-mode-map
"q" 'bury-buffer "q" 'bury-buffer
@ -2002,8 +2032,7 @@ interfere with the default `bongo-playlist-buffer'."
'(pdf-misc-print-program-args '("-o media=Letter" "-o fitplot") t) '(pdf-misc-print-program-args '("-o media=Letter" "-o fitplot") t)
'(safe-local-variable-values '(safe-local-variable-values
'((projectile-project-run-cmd . "./build/bin/presenter") '((projectile-project-run-cmd . "./build/bin/presenter")
(projectile-project-compilation-cmd . "cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -B build/ . && make --dir build/") (projectile-project-compilation-cmd . "cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -B build/ . && make --dir build/"))))
(eval org-odt-styles-file "/home/chris/org/tfcexpenses2020.odt"))))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.