emacs: org roam customizations

This commit is contained in:
2023-01-31 19:48:41 +01:00
parent 74ddb685f1
commit 06293fe85e
2 changed files with 54 additions and 13 deletions

View File

@ -112,6 +112,30 @@
(map! :map org-mode-map :nvi "C-j" #'org-forward-element)
(map! :map org-mode-map :nvi "C-h" #'org-up-element)
(map! :map org-mode-map :nvi "C-l" #'org-down-element)
(map! :map org-mode-map :nvi "M-i" #'org-roam-node-insert)
(map! :map doom-leader-notes-map "r r" #'org-roam-node-find)
(map! :map doom-leader-notes-map "r t" #'org-roam-buffer-toggle)
(setq org-roam-preview-function #'fd-my-org-roam-preview-function)
(defun fd-my-org-roam-preview-function ()
"Return the preview content at point.
This function returns the all contents under the current
headline, up to the next headline."
(let ((beg (save-excursion
(org-roam-end-of-meta-data t)
(point)))
(end (save-excursion
(condition-case nil
(progn
(outline-forward-same-level)
(backward-char)
(point)
)
(error
(point-max))))))
(string-trim (buffer-substring-no-properties beg end))))
#+end_src
** TeX
@ -218,11 +242,23 @@ Return nil if on a link url, markup, html, or references."
** Matlab
#+begin_src emacs-lisp :tangle yes
(add-hook 'matlab-mode-hook (lambda () (add-to-list 'quickrun-file-alist '("\\.m\\'" . "octave"))))
;; (assq-delete-all "objc" quickrun-file-alist)
(quickrun-add-command "matlab"
'((:command . "octave"))
:mode #'matlab-mode
)
(quickrun-add-command "octave"
'((:command . "octave"))
:mode #'octave-mode
)
;; (autoload 'matlab-mode "matlab" "Matlab Editing Mode" t)
;; (add-to-list
;; 'auto-mode-alist
;; '("\\.m$" . matlab-mode))
(add-to-list
'auto-mode-alist
'("\\.m$" . matlab-mode))
;; (setq matlab-indent-function t)
;; (setq matlab-shell-command "/urs/local/bin/matlab")
#+end_src
@ -264,10 +300,15 @@ Return nil if on a link url, markup, html, or references."
#+begin_src emacs-lisp :tangle yes
;; Add company-quickhelp
(company-quickhelp-mode)
;; Now already included
;; (company-quickhelp-mode)
(map! :map company-active-map "TAB" nil)
(map! :map company-active-map "<tab>" nil)
;; (map! :map company-active-map "TAB" nil)
;; (map! :map company-active-map "<tab>" nil)
#+end_src
** Projectile
#+begin_src emacs-lisp :tangle yes
(map! :map 'doom-leader-project-map :desc "Repeat last command" "SPC" #'projectile-repeat-last-command)
#+end_src
** More