fixing org-mode and tempel-cape stuff

This commit is contained in:
Chris Cochrun 2024-02-21 10:09:37 -06:00
parent 570d183753
commit 4edaf816d5
2 changed files with 40 additions and 4 deletions

View file

@ -850,7 +850,8 @@ Let's start by creating a self contained function of what I'd like started on ev
;; Setup better completion functions for org mode
(setq-local completion-at-point-functions
(list (cape-capf-super #'cape-elisp-block #'cape-dabbrev #'cape-dict))))
(list (cape-capf-super #'cape-elisp-block #'cape-dabbrev #'cape-dict)))
(tempel-setup-capf))
(defun chris/org-convert-csv-table (beg end)
(interactive (list (mark) (point)))
@ -2886,6 +2887,7 @@ Tempel is another templating system. Also perhaps even more powerful with it's e
(add-hook 'prog-mode-hook 'tempel-setup-capf)
(add-hook 'text-mode-hook 'tempel-setup-capf)
(add-hook 'org-mode-hook 'tempel-setup-capf)
;; Optionally make the Tempel templates available to Abbrev,
;; either locally or globally. `expand-abbrev' is bound to C-x '.
@ -3772,6 +3774,12 @@ We need a function to copy the full filename to kill-ring
(interactive)
(let* ((file (dired-get-filename)))
(clipboard-kill-ring-save nil nil file)))
(defun chris/dired-yank-fullpath ()
"get the fill file path at point and put into kill-ring"
(interactive)
(let* ((file (dired-get-filename)))
(message file)))
#+end_src
#+begin_src emacs-lisp
@ -4556,6 +4564,12 @@ With empv we can perhaps control mpv much more fine grainly and even search yout
(org-babel-read-link))))
(empv-play link)))
(defun chris/dired-empv-play-or-enqueue ()
"Play file at point in dired"
(interactive)
(let* ((file (dired-get-filename)))
(empv-play-or-enqueue file)))
:general
(chris/leader-keys
:states 'normal
@ -4575,7 +4589,11 @@ With empv we can perhaps control mpv much more fine grainly and even search yout
"RET" 'empv-youtube-results-play-or-enqueue-current
"i" 'empv-youtube-results-inspect
"d" 'chris/empv-yt-dlp
"D" 'chris/empv-yt-dlp-jellyfin))
"D" 'chris/empv-yt-dlp-jellyfin)
(chris/leader-keys
:states 'normal
:keymaps 'dired-mode-map
"vi" 'chris/dired-empv-play-or-enqueue))
#+end_src
I need to update the new normal mode pieces to this...

22
init.el
View file

@ -576,7 +576,8 @@
;; Setup better completion functions for org mode
(setq-local completion-at-point-functions
(list (cape-capf-super #'cape-elisp-block #'cape-dabbrev #'cape-dict))))
(list (cape-capf-super #'cape-elisp-block #'cape-dabbrev #'cape-dict)))
(tempel-setup-capf))
(defun chris/org-convert-csv-table (beg end)
(interactive (list (mark) (point)))
@ -2102,6 +2103,7 @@ targets."
(add-hook 'prog-mode-hook 'tempel-setup-capf)
(add-hook 'text-mode-hook 'tempel-setup-capf)
(add-hook 'org-mode-hook 'tempel-setup-capf)
;; Optionally make the Tempel templates available to Abbrev,
;; either locally or globally. `expand-abbrev' is bound to C-x '.
@ -2743,6 +2745,12 @@ targets."
(let* ((file (dired-get-filename)))
(clipboard-kill-ring-save nil nil file)))
(defun chris/dired-yank-fullpath ()
"get the fill file path at point and put into kill-ring"
(interactive)
(let* ((file (dired-get-filename)))
(message file)))
(use-package dired-sidebar
:ensure t
:commands (dired-sidebar-toggle-sidebar)
@ -3321,6 +3329,12 @@ targets."
(org-babel-read-link))))
(empv-play link)))
(defun chris/dired-empv-play-or-enqueue ()
"Play file at point in dired"
(interactive)
(let* ((file (dired-get-filename)))
(empv-play-or-enqueue file)))
:general
(chris/leader-keys
:states 'normal
@ -3340,7 +3354,11 @@ targets."
"RET" 'empv-youtube-results-play-or-enqueue-current
"i" 'empv-youtube-results-inspect
"d" 'chris/empv-yt-dlp
"D" 'chris/empv-yt-dlp-jellyfin))
"D" 'chris/empv-yt-dlp-jellyfin)
(chris/leader-keys
:states 'normal
:keymaps 'dired-mode-map
"vi" 'chris/dired-empv-play-or-enqueue))
(use-package elfeed
:commands (elfeed)