mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2025-12-17 12:30:59 +01:00
added orgalist and fixed markdown hooks
This commit is contained in:
@@ -8,8 +8,7 @@
|
|||||||
(defun tvd-cleanup-org-tables ()
|
(defun tvd-cleanup-org-tables ()
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(while (search-forward "-+-" nil t) (replace-match "-|-"))
|
(while (search-forward "-+-" nil t) (replace-match "-|-"))))
|
||||||
))
|
|
||||||
|
|
||||||
(defun tvd-markdown-todo ()
|
(defun tvd-markdown-todo ()
|
||||||
"Create dynamically highlighted TODO list of MD list"
|
"Create dynamically highlighted TODO list of MD list"
|
||||||
@@ -18,23 +17,39 @@
|
|||||||
(highlight-regexp "^- .*ok" "hi-green")
|
(highlight-regexp "^- .*ok" "hi-green")
|
||||||
(highlight-regexp "^- .*fail" "hi-pink"))
|
(highlight-regexp "^- .*fail" "hi-pink"))
|
||||||
|
|
||||||
|
(defun tvd-markdown-cleanup()
|
||||||
|
"Convert org table into markdown table if in markdown-mode and
|
||||||
|
save the buffer [again], also check if parens are balanced"
|
||||||
|
(when (equal major-mode 'markdown-mode)
|
||||||
|
(when (check-parens)
|
||||||
|
(tvd-cleanup-org-tables)
|
||||||
|
(save-buffer))))
|
||||||
|
|
||||||
(use-package markdown-mode
|
(use-package markdown-mode
|
||||||
:mode "\\.text\\'"
|
:mode "\\.text\\'"
|
||||||
:mode "\\.markdown\\'"
|
:mode "\\.markdown\\'"
|
||||||
:mode "\\.md\\'"
|
:mode "\\.md\\'"
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(defun tvd-markdown-hooks ()
|
(modify-syntax-entry ?\" "\"" markdown-mode-syntax-table)
|
||||||
(when buffer-file-name
|
|
||||||
(add-hook 'after-save-hook
|
|
||||||
'check-parens
|
|
||||||
nil t)
|
|
||||||
(add-hook 'after-save-hook 'tvd-cleanup-org-tables nil 'make-it-local))
|
|
||||||
|
|
||||||
(modify-syntax-entry ?\" "\"" markdown-mode-syntax-table)
|
;; (defun tvd-markdown-hooks ()
|
||||||
|
;; (when buffer-file-name
|
||||||
|
;; (add-hook 'after-save-hook
|
||||||
|
;; 'check-parens
|
||||||
|
;; nil t)
|
||||||
|
;; (add-hook 'after-save-hook 'tvd-cleanup-org-tables nil 'make-it-local))
|
||||||
|
|
||||||
(when (fboundb 'orgtbl-mode)
|
;; (modify-syntax-entry ?\" "\"" markdown-mode-syntax-table)
|
||||||
(add-hook 'markdown-mode-hook 'orgtbl-mode)))
|
|
||||||
|
|
||||||
:hook tvd-markdown-hooks
|
;; (when (fboundb 'orgtbl-mode)
|
||||||
|
;; (add-hook 'markdown-mode-hook 'orgtbl-mode))
|
||||||
|
|
||||||
|
;; ;; (when (fboundb 'orgalist))
|
||||||
|
;; (add-hook 'markdown-mode-hook 'orgalist-mode))
|
||||||
|
|
||||||
|
:hook ;; tvd-markdown-hooks
|
||||||
|
(markdown-mode . orgalist-mode)
|
||||||
|
(markdown-mode . orgtbl-mode)
|
||||||
|
(after-save . tvd-markdown-cleanup-orgtables)
|
||||||
)
|
)
|
||||||
|
|||||||
2
conf-lisp/orgalist.el
Normal file
2
conf-lisp/orgalist.el
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
;; https://elpa.gnu.org/packages/orgalist.html
|
||||||
|
(use-package orgalist)
|
||||||
1
init.el
1
init.el
@@ -163,6 +163,7 @@
|
|||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
'(custom-safe-themes
|
'(custom-safe-themes
|
||||||
'("7f1d414afda803f3244c6fb4c2c64bea44dac040ed3731ec9d75275b9e831fe5" default))
|
'("7f1d414afda803f3244c6fb4c2c64bea44dac040ed3731ec9d75275b9e831fe5" default))
|
||||||
|
'(magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'")
|
||||||
'(package-selected-packages
|
'(package-selected-packages
|
||||||
'(blamer howm tiny tramp dictcc beacon which-key goto-last-change browse-kill-ring fringe-current-line swiper smex undo-tree fic-mode cmake-mode yaml-mode windresize web-mode use-package tablist solarized-theme smartparens rust-mode projectile persistent-scratch org-bullets markdown-mode magit iedit ibuffer-vc ibuffer-tramp hydra htmlize highlight-indentation go-mode eyebrowse elmacro dumb-jump dired-ranger dired-k dired-filter default-text-scale change-inner buffer-move))
|
'(blamer howm tiny tramp dictcc beacon which-key goto-last-change browse-kill-ring fringe-current-line swiper smex undo-tree fic-mode cmake-mode yaml-mode windresize web-mode use-package tablist solarized-theme smartparens rust-mode projectile persistent-scratch org-bullets markdown-mode magit iedit ibuffer-vc ibuffer-tramp hydra htmlize highlight-indentation go-mode eyebrowse elmacro dumb-jump dired-ranger dired-k dired-filter default-text-scale change-inner buffer-move))
|
||||||
'(safe-local-variable-values '((ruby-indent-level 4)))
|
'(safe-local-variable-values '((ruby-indent-level 4)))
|
||||||
|
|||||||
1
init/46-orgalist.el
Symbolic link
1
init/46-orgalist.el
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../conf-lisp/orgalist.el
|
||||||
1
init/70-kubernetes.el
Symbolic link
1
init/70-kubernetes.el
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../conf-lisp/kubernetes.el
|
||||||
Reference in New Issue
Block a user