added orgalist and fixed markdown hooks

This commit is contained in:
2023-05-09 09:30:06 +02:00
parent 7dd3454ab2
commit 093ddcc57e
6 changed files with 32 additions and 12 deletions

View File

@@ -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 ()
(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) (modify-syntax-entry ?\" "\"" markdown-mode-syntax-table)
(when (fboundb 'orgtbl-mode) ;; (defun tvd-markdown-hooks ()
(add-hook 'markdown-mode-hook 'orgtbl-mode))) ;; (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))
:hook tvd-markdown-hooks ;; (modify-syntax-entry ?\" "\"" markdown-mode-syntax-table)
;; (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
View File

@@ -0,0 +1,2 @@
;; https://elpa.gnu.org/packages/orgalist.html
(use-package orgalist)

View File

@@ -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
View File

@@ -0,0 +1 @@
../conf-lisp/orgalist.el

1
init/70-kubernetes.el Symbolic link
View File

@@ -0,0 +1 @@
../conf-lisp/kubernetes.el