diff --git a/docs/applications.html b/docs/applications.html index 506ada2..467bcaa 100644 --- a/docs/applications.html +++ b/docs/applications.html @@ -4,7 +4,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- +[Desktop Entry] -Version=1.0 -Type=Application -Name=Zathura -Comment=A minimalistic document viewer -Exec=zathura %U -Icon=/usr/share/icons/Papirus/64x64/apps/zathura.svg -Terminal=false -Categories=Office;Viewer; -Keywords=PDF;PS;PostScript;DjVU;document;presentation;viewer; --
[Desktop Entry] -Type=Application -Name=Torrent -Exec=/usr/bin/env transadd %U --
[Desktop Entry] -Type=Application -Name=RSS feed addition -Exec=/usr/bin/env rssadd %U --
[Desktop Entry] -Name=qutebrowser -GenericName=Web Browser -Comment=A keyboard-driven, vim-like browser based on PyQt5 -Icon=qutebrowser -Type=Application -Categories=Network;WebBrowser; -Exec=qutebrowser %u -Terminal=false -StartupNotify=false -MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/qute; -Keywords=Browser -Actions=new-window;preferences; --
[Desktop Entry] +Name=Emacs Client +Exec=emacsclient -c %u +Icon=emacs-icon +Type=Application +Terminal=false +MimeType=x-scheme-handler/org-protocol; +NoDisplay=true ++
Created: 2020-01-12 dim. 17:28
+Created: 2020-03-01 dim. 22:50
[[ $- != *i* ]] && return @@ -368,7 +345,7 @@ for the JavaScript code in this tag.
dircolors –print-database uses its own built-in database instead of using /etc/DIRCOLORS. Try to use the external file first to take advantage of user additions. Use internal bash globbing instead of external grep binary. @@ -409,14 +386,16 @@ dircolors –print-database uses its own built-in database instead of using fi
unset use_color safe_term match_lhs sh
-
+xhost +local:root > /dev/null 2>&1 +unset use_color safe_term match_lhs sh + +xhost +local:root > /dev/null 2>&1 complete -cf sudo @@ -445,9 +424,9 @@ dircolors –print-database uses its own built-in database instead of using
# if ! pgrep -u "$USER" ssh-agent > /dev/null; then # ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env" @@ -472,7 +451,7 @@ dircolors –print-database uses its own built-in database instead of using
alias yt="youtube-dl --add-metadata -ic" # Download video link -alias yta="yt -x -f bestaudio/best" # Download only audio --
dig
and ifbashig
-Use addr
instead
-
# alias ip="dig +short myip.opendns.com @resolver1.opendns.com" -# alias localip="ip route get 8.8.4.4 | head -1 | awk '{print $7}'" -# alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'" --
addr
instead
-To install dig
, use yay -S bind-tools
-
meteo() { if [ -n "$*" ]; then @@ -631,7 +580,6 @@ To installdig
, useyay -S bind-tools
curl "$address" else address="wttr.in/" - address+=$(ip) address+="?lang=fr" curl "$address" fi @@ -643,7 +591,7 @@ To installdig
, useyay -S bind-tools
upload() { @@ -661,19 +609,6 @@ To installdig
, useyay -S bind-tools
transfer() { -curl --progress-bar --upload-file "$1" https://transfer.sh/$(basename $1) | xclip -in -selection clipboard; -} -alias transfer=transfer --
eval "$(starship init bash)" ++
if [ -n "$DESKTOP_SESSION" ];then + eval $(gnome-keyring-daemon --start) + export SSH_AUTH_SOCK +fi ++
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket" --
Created: 2020-01-11 sam. 22:20
+Created: 2020-03-01 dim. 22:50
-rofi -p
+http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html +
+ +palette="/tmp/palette.png" + +filters="fps=15,scale=320:-1:flags=lanczos" + +ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette +ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2 ++
if [ $TMUX ]; then + tmux split -v -l 1 "cd ~/Downloads/ && youtube-dl --add-metadata -xic -f bestaudio/best $1" && tmux select-pane -U +else + cd ~/Downloads/; + setsid nohup youtube-dl --add-metadata -xic -f bestaudio/best $1 &> /dev/null & +fi ++
if [ $TMUX ]; then + tmux split -v -l 1 "cd ~/Downloads/ && youtube-dl --add-metadata -ic $1" && tmux select-pane -U +else + cd ~/Downloads/; + setsid nohup youtube-dl --add-metadata -ic $1 &> /dev/null & +fi ++
shrink () +{ +gs \ + -q -dNOPAUSE -dBATCH -dSAFER \ + -sDEVICE=pdfwrite \ + -dCompatibilityLevel=1.3 \ + -dPDFSETTINGS=/screen \ + -dEmbedAllFonts=true \ + -dSubsetFonts=true \ + -dAutoRotatePages=/None \ + -dColorImageDownsampleType=/Bicubic \ + -dColorImageResolution=$3 \ + -dGrayImageDownsampleType=/Bicubic \ + -dGrayImageResolution=$3 \ + -dMonoImageDownsampleType=/Subsample \ + -dMonoImageResolution=$3 \ + -sOutputFile="$2" \ + "$1" +} + +check_smaller () +{ +# If $1 and $2 are regular files, we can compare file sizes to +# see if we succeeded in shrinking. If not, we copy $1 over $2: +if [ ! -f "$1" -o ! -f "$2" ]; then +return 0; +fi +ISIZE="$(echo $(wc -c "$1") | cut -f1 -d\ )" +OSIZE="$(echo $(wc -c "$2") | cut -f1 -d\ )" +if [ "$ISIZE" -lt "$OSIZE" ]; then +echo "Input smaller than output, doing straight copy" >&2 +cp "$1" "$2" +fi +} + +usage () +{ +echo "Reduces PDF filesize by lossy recompressing with Ghostscript." +echo "Not guaranteed to succeed, but usually works." +echo " Usage: $1 infile [outfile] [resolution_in_dpi]" +} + +IFILE="$1" + +# Need an input file: +if [ -z "$IFILE" ]; then +usage "$0" +exit 1 +fi + +# Output filename defaults to "-" (stdout) unless given: +if [ ! -z "$2" ]; then +OFILE="$2" +else +OFILE="-" +fi + +# Output resolution defaults to 72 unless given: +if [ ! -z "$3" ]; then +res="$3" +else +res="90" +fi + +shrink "$IFILE" "$OFILE" "$res" || exit $? + +check_smaller "$IFILE" "$OFILE" ++
Created: 2020-01-28 mar. 21:32
+Created: 2020-03-01 dim. 22:50
Created: 2020-01-11 sam. 22:20
+Created: 2020-03-01 dim. 22:49
max-cache-ttl 60480000 -default-cache-ttl 60480000 +default-cache-ttl 60480000 +max-cache-ttl 60480000
Created: 2020-01-28 mar. 21:32
+Created: 2020-03-01 dim. 22:50
Created: 2020-01-11 sam. 22:19
+Created: 2020-03-01 dim. 22:50
:ignore:
tagstartblock
when opening org-mode filesinit.el
init.el
ATTACHpackages.el
@@ -823,6 +812,26 @@ Documentation: +
;; Make movement keys work like they should +(define-key evil-normal-state-map (kbd "<remap> <evil-next-line>") 'evil-next-visual-line) +(define-key evil-normal-state-map (kbd "<remap> <evil-previous-line>") 'evil-previous-visual-line) +(define-key evil-motion-state-map (kbd "<remap> <evil-next-line>") 'evil-next-visual-line) +(define-key evil-motion-state-map (kbd "<remap> <evil-previous-line>") 'evil-previous-visual-line) ++
; Make horizontal movement cross lines +(setq-default evil-cross-lines t) ++
(after! which-key (setq which-key-idle-delay 0.5 @@ -833,9 +842,9 @@ Documentation:
(setq alert-default-style 'libnotify) +(setq alert-default-style 'libnotify)
(global-hl-line-mode -1) -(add-hook 'org-mode-hook -(lambda() - (hl-line-mode -1) - (global-hl-line-mode -1)) -'t -) +(after! org + (add-hook 'org-mode-hook + (lambda() + (hl-line-mode -1) + (global-hl-line-mode -1)) + 't + ))
(require 'org) --
(setq org-directory "~/Cloud/org/") +(after! org + (setq org-directory "~/Cloud/org/") -(setq org-default-notes-file "~/Cloud/org/refile.org") + ;; Replace the content marker, “⋯”, with a nice unicode arrow. + (setq org-ellipsis " ⤵") -;; Highligh latex parts in org mode -(setq org-highlight-latex-and-related '(native)) + (setq org-default-notes-file "~/Cloud/org/refile.org") -;; The following setting hides blank lines between headings which keeps folded view nice and compact. -(setq org-cycle-separator-lines 0) + ;; Avoid accidentally editing folded regions, say by adding text after an Org “⋯”. + (setq org-catch-invisible-edits 'show) -;; Indent according to the outline structure -(setq org-startup-indented t) + ;; Highligh latex parts in org mode + (setq org-highlight-latex-and-related '(native)) -;; Record the information of when the task was marked as DONE -(setq org-log-done 'time) + ;; The following setting hides blank lines between headings which keeps folded view nice and compact. + (setq org-cycle-separator-lines 0) + + ;; Indent according to the outline structure + (setq org-startup-indented t) + + ;; Record the information of when the task was marked as DONE + (setq org-log-done 'time) + + ;; begining of line on heading behavior + (setq org-special-ctrl-a/e nil) +)
(defvar tdh/org-latex-fragment-last nil +(defvar tdh-org-latex-fragment-last nil "Holds last fragment/environment you were on.") -(defun tdh/org-in-latex-fragment-p () +(defun tdh-org-in-latex-fragment-p () "Return the point where the latex fragment begins, if inside a latex fragment. Else return false" (let* ((el (org-element-context)) @@ -989,28 +1001,28 @@ This cause the orgmode tables not to be well aligned. (and (or (eq 'latex-fragment el-type) (eq 'latex-environment el-type)) (org-element-property :begin el)))) -(defun tdh/org-latex-fragment-toggle () +(defun tdh-org-latex-fragment-toggle () "Toggle a latex fragment image " (and (eq 'org-mode major-mode) - (let ((begin (tdh/org-in-latex-fragment-p))) + (let ((begin (tdh-org-in-latex-fragment-p))) (cond ;; were on a fragment and now on a new fragment ((and ;; fragment we were on - tdh/org-latex-fragment-last + tdh-org-latex-fragment-last ;; and are on a fragment now begin ;; but not on the last one this is a little tricky. as you edit the ;; fragment, it is not equal to the last one. We use the begin ;; property which is less likely to change for the comparison. - (not (and tdh/org-latex-fragment-last + (not (and tdh-org-latex-fragment-last (= begin - tdh/org-latex-fragment-last)))) + tdh-org-latex-fragment-last)))) ;; go back to last one and put image back, provided there is still a fragment there (save-excursion - (goto-char tdh/org-latex-fragment-last) - (when (tdh/org-in-latex-fragment-p) (org-preview-latex-fragment)) + (goto-char tdh-org-latex-fragment-last) + (when (tdh-org-in-latex-fragment-p) (org-preview-latex-fragment)) ;; now remove current image (goto-char begin) @@ -1023,26 +1035,26 @@ This cause the orgmode tables not to be well aligned. (when ov (delete-overlay ov))) ;; and save new fragment - (setq tdh/org-latex-fragment-last begin))) + (setq tdh-org-latex-fragment-last begin))) ;; were on a fragment and now are not on a fragment ((and ;; not on a fragment now (not begin) ;; but we were on one - tdh/org-latex-fragment-last) + tdh-org-latex-fragment-last) ;; put image back on, provided that there is still a fragment here. (save-excursion - (goto-char tdh/org-latex-fragment-last) - (when (tdh/org-in-latex-fragment-p) (org-preview-latex-fragment))) + (goto-char tdh-org-latex-fragment-last) + (when (tdh-org-in-latex-fragment-p) (org-preview-latex-fragment))) ;; unset last fragment - (setq tdh/org-latex-fragment-last nil)) + (setq tdh-org-latex-fragment-last nil)) ;; were not on a fragment, and now are ((and ;; we were not one one - (not tdh/org-latex-fragment-last) + (not tdh-org-latex-fragment-last) ;; but now we are begin) ;; remove image @@ -1056,7 +1068,7 @@ This cause the orgmode tables not to be well aligned. return ov))) (when ov (delete-overlay ov)))) - (setq tdh/org-latex-fragment-last begin)))))) + (setq tdh-org-latex-fragment-last begin))))))
(map! :map org-mode-map "C-c l" 'org-store-link) +(after! org + (map! :map org-mode-map "C-c l" 'org-store-link) + + (setq org-link-abbrev-alist + '(("bib" . "~/Cloud/thesis/ressources/references.bib::%s") + ("notes" . "~/Cloud/thesis/ressources/notes/notes.org::#%s") + ("papers" . "~/Cloud/thesis/ressources/pdfs/%s.pdf"))) + )
;; Align Tags and flush right -(setq org-tags-column -78) -;; Tags with fast selection keys -(setq org-tag-alist (quote (("@home" . ?h) - ("@work" . ?w) - ("@christophe" . ?c) - ("@veijo" . ?v)))) +(after! org + ;; Align Tags and flush right + (setq org-tags-column -78) + ;; Tags with fast selection keys + (setq org-tag-alist (quote (("@home" . ?h) + ("@work" . ?w) + ("@christophe" . ?c) + ("@veijo" . ?v)))) + )
(setq org-refile-targets '((org-agenda-files . (:maxlevel . 6)))) +(after! org + (setq org-refile-targets '((org-agenda-files . (:maxlevel . 6)))) + )
;; Tags with fast selection keys -(setq org-todo-keywords '( - (sequence "TODO(t)" "NEXT(n)" "MAIL(m)" "|" "DONE(d)") - (sequence "READ(r)" "BKMK(b)" "EXER(x)" "|" "DONE(d)") - (sequence "WAIT(w@/!)" "SDAY(s)" "|" "CANC(c@/!)") - (sequence "QUES(q)" "|" "ANSW(a)") - (sequence "EXAM(e)" "IDEA(i)" "|") - )) +(after! org + ;; Tags with fast selection keys + (setq org-todo-keywords '( + (sequence "TODO(t)" "NEXT(n)" "MAIL(m)" "|" "DONE(d)") + (sequence "READ(r)" "BKMK(b)" "EXER(x)" "|" "DONE(d)") + (sequence "WAIT(w@/!)" "SDAY(s)" "|" "CANC(c@/!)") + (sequence "QUES(q)" "|" "ANSW(a)") + (sequence "EXAM(e)" "IDEA(i)" "|") + )) -;; Display of the keywords -(setq org-todo-keyword-faces - '(("TODO" . (:foreground "#cc241d" :weight bold)) ;; red - ("EXER" . (:foreground "#cc241d" :weight bold)) ;; red - ("NEXT" . (:foreground "#cc241d" :weight bold)) ;; red - ("MAIL" . (:foreground "#cc241d" :weight bold)) ;; red - ("READ" . (:foreground "#cc241d" :weight bold)) ;; red - ("ANSW" . (:foreground "#689d6a" :weight bold)) ;; aqua - ("DONE" . (:foreground "#689d6a" :weight bold)) ;; aqua - ("WAIT" . (:foreground "#d65d0e" :weight bold)) ;; orange - ("QUES" . (:foreground "#d79921" :weight bold)) ;; yellow - ("CANC" . (:foreground "#a89984" :weight bold)) ;; grey - ("SDAY" . (:foreground "#98971a" :weight bold)) ;; green - ("BKMK" . (:foreground "#98971a" :weight bold)) ;; green - ("IDEA" . (:foreground "#98971a" :weight bold)) ;; green - ("EXAM" . (:foreground "#98971a" :weight bold)))) ;; green + ;; Display of the keywords + (setq org-todo-keyword-faces + '(("TODO" . (:foreground "#cc241d" :weight bold)) ;; red + ("EXER" . (:foreground "#cc241d" :weight bold)) ;; red + ("NEXT" . (:foreground "#cc241d" :weight bold)) ;; red + ("MAIL" . (:foreground "#cc241d" :weight bold)) ;; red + ("READ" . (:foreground "#cc241d" :weight bold)) ;; red + ("ANSW" . (:foreground "#689d6a" :weight bold)) ;; aqua + ("DONE" . (:foreground "#689d6a" :weight bold)) ;; aqua + ("WAIT" . (:foreground "#d65d0e" :weight bold)) ;; orange + ("QUES" . (:foreground "#d79921" :weight bold)) ;; yellow + ("CANC" . (:foreground "#a89984" :weight bold)) ;; grey + ("SDAY" . (:foreground "#98971a" :weight bold)) ;; green + ("BKMK" . (:foreground "#98971a" :weight bold)) ;; green + ("IDEA" . (:foreground "#98971a" :weight bold)) ;; green + ("EXAM" . (:foreground "#98971a" :weight bold)))) ;; green + )
(defadvice org-archive-subtree (around fix-hierarchy activate) - (let* ((fix-archive-p (and (not current-prefix-arg) - (not (use-region-p)))) - (location (org-archive--compute-location org-archive-location)) - (afile (car location)) - (offset (if (= 0 (length (cdr location))) - 1 - (1+ (string-match "[^*]" (cdr location))))) - (buffer (or (find-buffer-visiting afile) (find-file-noselect afile)))) - ad-do-it - (when fix-archive-p - (with-current-buffer buffer - (goto-char (point-max)) - (while (> (org-current-level) offset) (org-up-heading-safe)) - (let* ((olpath (org-entry-get (point) "ARCHIVE_OLPATH")) - (path (and olpath (split-string olpath "/"))) - (level offset) - tree-text) - (when olpath - (org-mark-subtree) - (setq tree-text (buffer-substring (region-beginning) (region-end))) - (let (this-command) (org-cut-subtree)) - (goto-char (point-min)) - (save-restriction - (widen) - (-each path - (lambda (heading) - (if (re-search-forward - (rx-to-string - `(: bol (repeat ,level "*") (1+ " ") ,heading)) nil t) - (org-narrow-to-subtree) - (goto-char (point-max)) - (unless (looking-at "^") - (insert "\n")) - (insert (make-string level ?*) - " " - heading - "\n")) - (cl-incf level))) - (widen) - (org-end-of-subtree t t) - (org-paste-subtree level tree-text)))))))) +(after! org + (defadvice org-archive-subtree (around fix-hierarchy activate) + (let* ((fix-archive-p (and (not current-prefix-arg) + (not (use-region-p)))) + (location (org-archive--compute-location org-archive-location)) + (afile (car location)) + (offset (if (= 0 (length (cdr location))) + 1 + (1+ (string-match "[^*]" (cdr location))))) + (buffer (or (find-buffer-visiting afile) (find-file-noselect afile)))) + ad-do-it + (when fix-archive-p + (with-current-buffer buffer + (goto-char (point-max)) + (while (> (org-current-level) offset) (org-up-heading-safe)) + (let* ((olpath (org-entry-get (point) "ARCHIVE_OLPATH")) + (path (and olpath (split-string olpath "/"))) + (level offset) + tree-text) + (when olpath + (org-mark-subtree) + (setq tree-text (buffer-substring (region-beginning) (region-end))) + (let (this-command) (org-cut-subtree)) + (goto-char (point-min)) + (save-restriction + (widen) + (-each path + (lambda (heading) + (if (re-search-forward + (rx-to-string + `(: bol (repeat ,level "*") (1+ " ") ,heading)) nil t) + (org-narrow-to-subtree) + (goto-char (point-max)) + (unless (looking-at "^") + (insert "\n")) + (insert (make-string level ?*) + " " + heading + "\n")) + (cl-incf level))) + (widen) + (org-end-of-subtree t t) + (org-paste-subtree level tree-text)))))))) +)
(map! :map org-mode-map "C-c a" 'org-agenda) +(after! org + (map! :map org-mode-map "C-c a" 'org-agenda) -;; File to save todo items -(setq org-agenda-files (list "~/Cloud/org/")) + ;; File to save todo items + (setq org-agenda-files (list "~/Cloud/org/")) -;; Include archived files -(setq org-agenda-archives-mode t) + ;; Include archived files + (setq org-agenda-archives-mode t) -;; Set priority range from A to C with default A -(setq org-highest-priority ?A) -(setq org-lowest-priority ?C) -(setq org-default-priority ?C) + ;; Set priority range from A to C with default A + (setq org-highest-priority ?A) + (setq org-lowest-priority ?C) + (setq org-default-priority ?C) -;; Set colours for priorities -(setq org-priority-faces '((?A . (:foreground "#CC241D")) - (?B . (:foreground "#D65D0E")) - (?C . (:foreground "#D79921")))) + ;; Set colours for priorities + (setq org-priority-faces '((?A . (:foreground "#FB4934")) + (?B . (:foreground "#FABD2F")) + (?C . (:foreground "#98971A")))) -;; Open agenda in current window -(setq org-agenda-window-setup 'current-window) + ;; Open agenda in current window + (setq org-agenda-window-setup 'current-window) -(setq org-agenda-prefix-format - '((agenda . " %-12:c %?-12t% s") - (todo . "") ;; Don't show the filename for reading agenda - (tags . " %-12:c") - (search . " %-12:c")) + (setq org-agenda-prefix-format + '((agenda . " %-12:c %?-12t% s") + (todo . "") ;; Don't show the filename for reading agenda + (tags . " %-12:c") + (search . " %-12:c")) + ) )
(map! :map org-mode-map "C-c a" 'org-agenda) - -;; File to save todo items -(setq org-agenda-files (list "~/Cloud/org/")) - -;; Include archived files -(setq org-agenda-archives-mode t) - -;; Set priority range from A to C with default A -(setq org-highest-priority ?A) -(setq org-lowest-priority ?C) -(setq org-default-priority ?C) - -;; Set colours for priorities -(setq org-priority-faces '((?A . (:foreground "#CC241D")) - (?B . (:foreground "#D65D0E")) - (?C . (:foreground "#D79921")))) - -;; Open agenda in current window -(setq org-agenda-window-setup 'current-window) - -(setq org-agenda-prefix-format - '((agenda . " %-12:c %?-12t% s") - (todo . "") ;; Don't show the filename for reading agenda - (tags . " %-12:c") - (search . " %-12:c"))) --
(defun tdh/org-agenda-skip-scheduled () - (org-agenda-skip-entry-if 'scheduled 'deadline 'regexp "\n]+>")) +(after! org-agenda + (defun tdh-org-agenda-skip-scheduled () + (org-agenda-skip-entry-if 'scheduled 'deadline 'regexp "\n]+>")) -(setq org-agenda-custom-commands - '(("w" "Work" tags-todo "@work") ;; All todos related to work - ("h" "Home" tags-todo "@home") ;; All todos not related to work - ("q" . "Questions to ask") - ("qc" "Questions to Cristophe" tags "@christophe/QUES" ((org-agenda-overriding-header "Questions to Christophe"))) - ("qm" "Questions to Muriel" tags "@muriel/QUES" ((org-agenda-overriding-header "Questions to Muriel"))) - ("qo" "Questions to Olivier" tags "@olivier/QUES" ((org-agenda-overriding-header "Questions to Olivier"))) - ("qq" "All questions" tags "/QUES" ((org-agenda-overriding-header "Other questions"))) - ("n" "Next things to do" - ((tags "+PRIORITY+\"A\"" - ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) - (org-agenda-overriding-header "High-priority unfinished tasks:"))) - (agenda "") - (todo "NEXT" ((org-agenda-skip-function 'tdh/org-agenda-skip-scheduled)(org-agenda-overriding-header "Next thing to do that are not scheduled"))) - (todo "MAIL" ((org-agenda-overriding-header "Email to write/reply"))) - (todo "WAIT" ((org-agenda-overriding-header "Things Waiting"))))) - ("u" "Unscheduled tasks" todo "TODO" - ((org-agenda-skip-function 'tdh/org-agenda-skip-scheduled) - (org-agenda-overriding-header "Unscheduled TODO entries: "))) - ("r" "Things to read" - ((todo "READ" ((org-agenda-overriding-header "Things to read")))) - ((org-agenda-files '("~/Cloud/thesis/ressources/notes/"))))) - ) + (setq org-agenda-custom-commands + '(("w" "Work" tags-todo "@work") ;; All todos related to work + ("h" "Home" tags-todo "@home") ;; All todos not related to work + ("q" . "Questions to ask") + ("qc" "Questions to Cristophe" tags "@christophe/QUES" ((org-agenda-overriding-header "Questions to Christophe"))) + ("qm" "Questions to Muriel" tags "@muriel/QUES" ((org-agenda-overriding-header "Questions to Muriel"))) + ("qo" "Questions to Olivier" tags "@olivier/QUES" ((org-agenda-overriding-header "Questions to Olivier"))) + ("qq" "All questions" tags "/QUES" ((org-agenda-overriding-header "Other questions"))) + ("n" "Next things to do" + ((tags "+PRIORITY+\"A\"" + ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) + (org-agenda-overriding-header "High-priority unfinished tasks:"))) + (agenda "") + (todo "NEXT" ((org-agenda-skip-function 'tdh-org-agenda-skip-scheduled)(org-agenda-overriding-header "Next thing to do that are not scheduled"))) + (todo "MAIL" ((org-agenda-overriding-header "Email to write/reply"))) + (todo "WAIT" ((org-agenda-overriding-header "Things Waiting"))))) + ("u" "Unscheduled tasks" todo "TODO" + ((org-agenda-skip-function 'tdh-org-agenda-skip-scheduled) + (org-agenda-overriding-header "Unscheduled TODO entries: "))) + ("R" "Already read Articles and Books" + ((org-ql-block '(and (todo "DONE") + (level 1) + (tags "article" "inproceedings" "techreport" "inbook")) + ((org-ql-block-header "Articles"))) + (org-ql-block '(and (todo "DONE") + (level 1) + (tags "book")) + ((org-ql-block-header "Books"))) + (org-ql-block '(and (todo "DONE") + (level 1) + (tags "phdthesis")) + ((org-ql-block-header "Phd Thesis"))) + (org-ql-block '(and (todo "DONE") + (level 1) + (not (tags "article" "inproceedings" "techreport" "inbook" "book" "phdthesis"))) + ((org-ql-block-header "Other Things")))) + ((org-agenda-files '("~/Cloud/thesis/ressources/notes/")))) + ("r" "Custom: Agenda and Emacs SOMEDAY [#A] items" + ((org-ql-block '(and (todo "READ") + (level 1) + (tags "article" "inproceedings" "techreport" "inbook")) + ((org-ql-block-header "Article to Read"))) + (org-ql-block '(and (todo "READ") + (level 1) + (tags "book")) + ((org-ql-block-header "Books to Read"))) + (org-ql-block '(and (todo "READ") + (level 1) + (tags "phdthesis")) + ((org-ql-block-header "Phd Thesis to Read"))) + (org-ql-block '(and (todo "READ") + (level 1) + (not (tags "article" "inproceedings" "techreport" "inbook" "book" "phdthesis"))) + ((org-ql-block-header "Other Things to Read")))) + ((org-agenda-files '("~/Cloud/thesis/ressources/notes/"))))) + ) + )
(use-package! org-fancy-priorities ; priority icons + :hook (org-mode . org-fancy-priorities-mode) + :config (setq org-fancy-priorities-list '("■" "■" "■"))) ++
(setq appt-message-warning-time 5) -(defun my-org-agenda-to-appt () - (interactive) - (setq appt-time-msg-list nil) - (org-agenda-to-appt)) +(after! org-agenda + (setq appt-message-warning-time 5) + (defun tdh-org-agenda-to-appt () + (interactive) + (setq appt-time-msg-list nil) + (org-agenda-to-appt)) -(my-org-agenda-to-appt) -; Display appointments as a window manager notification -(setq appt-disp-window-function 'my-appt-display) -(setq appt-delete-window-function (lambda () t)) + (tdh-org-agenda-to-appt) + ; Display appointments as a window manager notification + (setq appt-disp-window-function 'tdh-appt-display) + (setq appt-delete-window-function (lambda () t)) -(setq my-appt-notification-app (concat (getenv "HOME") "/bin/appt-notification")) -(defun my-appt-display (min-to-app new-time msg) - (if (atom min-to-app) - (start-process "my-appt-notification-app" nil my-appt-notification-app min-to-app msg) - (dolist (i (number-sequence 0 (1- (length min-to-app)))) - (start-process "my-appt-notification-app" nil my-appt-notification-app (nth i min-to-app) (nth i msg))))) + (setq tdh-appt-notification-app (concat (getenv "HOME") "/bin/appt-notification")) + (defun tdh-appt-display (min-to-app new-time msg) + (if (atom min-to-app) + (start-process "tdh-appt-notification-app" nil tdh-appt-notification-app min-to-app msg) + (dolist (i (number-sequence 0 (1- (length min-to-app)))) + (start-process "tdh-appt-notification-app" nil tdh-appt-notification-app (nth i min-to-app) (nth i msg))))) + )
(setq org-structure-template-alist - '(("c" . "center") - ("C" . "comment") - ("i" . "important") - ("e" . "example") - ("q" . "quote") - ("s" . "src")) +(after! org + (setq org-structure-template-alist + '(("c" . "center") + ("C" . "comment") + ("m" . "src matlab\n") + ("l" . "src emacs-lisp\n") + ("i" . "important") + ("e" . "example") + ("q" . "quote") + ("s" . "src"))) )
(map! :map org-mode-map "C-c c" 'org-capture) +(after! org + (map! :map org-mode-map "C-c c" 'org-capture))
(setq org-capture-templates - (quote (("t" ; key - "todo" ; name - entry ; type - (file+headline "~/Cloud/org/work-notebook.org" "Inbox") ; target - "** TODO %?\n%U\n" ; template - ) - ("M" ; key - "Meeting" ; name - entry ; type - (file+headline "~/Cloud/org/work-notebook.org" "Meetings") ; target - "** %?\n%(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n" ; template - ) - ("m" ; key - "mail" ; name - entry ; type - (file+headline "~/Cloud/org/work-notebook.org" "Mails") ; target - "** TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n" ; template - ) - ("pm" - "Org-Protocol Mail" - entry - (file+headline "~/Cloud/org/work-notebook.org" "Mails") - "* MAIL %:description [[message:%:link][link]]\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n\n" - :immediate-finish t - ) - ("pu" - "Org-Protocol Url" - entry - (file+headline "~/Cloud/org/work-notebook.org" "Inbox") - "* [[%:link][%:description]]\nCaptured On: %U\n\n" - :immediate-finish t - ) - ("pt" - "Org-Protocol text" - entry - (file+headline "~/Cloud/org/work-notebook.org" "Inbox") - "* %:description\nSource: %:link\nCaptured On: %U\n\n#+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n" - :immediate-finish t - ) - ))) +(after! org + (setq org-capture-templates + (quote (("t" ; key + "todo" ; name + entry ; type + (file+headline "~/Cloud/org/work-notebook.org" "Inbox") ; target + "** TODO %?\n%U\n" ; template + ) + ("M" ; key + "Meeting" ; name + entry ; type + (file+headline "~/Cloud/org/work-notebook.org" "Meetings") ; target + "** %?\n%(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n" ; template + ) + ("m" ; key + "mail" ; name + entry ; type + (file+headline "~/Cloud/org/work-notebook.org" "Mails") ; target + "** TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n" ; template + ) + ("pm" + "Org-Protocol Mail" + entry + (file+headline "~/Cloud/org/work-notebook.org" "Mails") + "* MAIL %:description [[message:%:link][link]]\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n\n" + :immediate-finish t + ) + ("pu" + "Org-Protocol Url" + entry + (file+headline "~/Cloud/org/work-notebook.org" "Inbox") + "* [[%:link][%:description]]\nCaptured On: %U\n\n" + :immediate-finish t + ) + ("pt" + "Org-Protocol text" + entry + (file+headline "~/Cloud/org/work-notebook.org" "Inbox") + "* %:description\nSource: %:link\nCaptured On: %U\n\n#+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n" + :immediate-finish t + ) + ))) +)
;; How many levels of headline to export -(setq org-export-headline-levels 4) +(after! org + ;; How many levels of headline to export + (setq org-export-headline-levels 4) -;; Authorize BIND to set local variables -(setq org-export-allow-bind-keywords t) + ;; Authorize BIND to set local variables + (setq org-export-allow-bind-keywords t) -(setq org-odt-preferred-output-format "doc") + (setq org-odt-preferred-output-format "doc") + ) ++
:ignore:
tag;; Used to not export headings with :ignore: tag +(after! org + (require 'ox-extra) + (ox-extras-activate '(ignore-headlines)))
(use-package! ox-latex-subfigure - :config (require 'ox-latex-subfigure)) +;; (use-package! ox-latex-subfigure +;; :config (require 'ox-latex-subfigure))
(defun org/get-headline-string-element (headline backend info) - (let ((prop-point (next-property-change 0 headline))) - (if prop-point (plist-get (text-properties-at prop-point headline) :parent)))) +(after! org + (defun org/get-headline-string-element (headline backend info) + (let ((prop-point (next-property-change 0 headline))) + (if prop-point (plist-get (text-properties-at prop-point headline) :parent)))) -(defun org/ensure-latex-clearpage (headline backend info) - (when (org-export-derived-backend-p backend 'latex) - (let ((elmnt (org/get-headline-string-element headline backend info))) - (when (and elmnt (org-element-property :CLEARPAGE elmnt)) - (concat "\\clearpage\n" headline))))) + (defun org/ensure-latex-clearpage (headline backend info) + (when (org-export-derived-backend-p backend 'latex) + (let ((elmnt (org/get-headline-string-element headline backend info))) + (when (and elmnt (org-element-property :CLEARPAGE elmnt)) + (concat "\\clearpage\n" headline))))) -(add-to-list 'org-export-filter-headline-functions - 'org/ensure-latex-clearpage) + (add-to-list 'org-export-filter-headline-functions + 'org/ensure-latex-clearpage) + )
(setq org-html-mathjax-template - "<script type=\"text/x-mathjax-config\"> - MathJax.Hub.Config({ - displayAlign: \"%ALIGN\", - displayIndent: \"%INDENT\", +(after! org + (setq org-html-mathjax-template + "<script> + MathJax = { + tex: { macros: { + bm: [\"\\\\boldsymbol{#1}\",1], + } + } + }; + </script> + <script type=\"text/javascript\" + src=\"%PATH\"></script>") +) ++
(after! org + (setq org-html-mathjax-options + '((path "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js") + (scale "100") + (align "center") + (font "TeX") + (linebreaks "false") + (autonumber "AMS") + (indent "0em") + (multlinewidth "85%") + (tagindent ".8em") + (tagside "right"))) +)
(setq org-html-htmlize-output-type 'css) +(after! org + (setq org-html-htmlize-output-type 'css))
(setq org-html-html5-fancy t) -(setq org-html-doctype "xhtml-strict") +(after! org + (setq org-html-html5-fancy t) + (setq org-html-doctype "xhtml-strict") +) ++
[ ]
https://github.com/alhassy/emacs.d[ ]
https://github.com/alphapapa/unpackaged.el#export-to-html-with-useful-anchors+This is not working +
+ +(define-minor-mode unpackaged/org-export-html-with-useful-ids-mode + "Attempt to export Org as HTML with useful link IDs. +Instead of random IDs like \"#orga1b2c3\", use heading titles, +made unique when necessary." + :global t + (if unpackaged/org-export-html-with-useful-ids-mode + (advice-add #'org-export-get-reference :override #'unpackaged/org-export-get-reference) + (advice-remove #'org-export-get-reference #'unpackaged/org-export-get-reference))) + +(defun unpackaged/org-export-get-reference (datum info) + "Like `org-export-get-reference', except uses heading titles instead of random numbers." + (let ((cache (plist-get info :internal-references))) + (or (car (rassq datum cache)) + (let* ((crossrefs (plist-get info :crossrefs)) + (cells (org-export-search-cells datum)) + ;; Preserve any pre-existing association between + ;; a search cell and a reference, i.e., when some + ;; previously published document referenced a location + ;; within current file (see + ;; `org-publish-resolve-external-link'). + ;; + ;; However, there is no guarantee that search cells are + ;; unique, e.g., there might be duplicate custom ID or + ;; two headings with the same title in the file. + ;; + ;; As a consequence, before re-using any reference to + ;; an element or object, we check that it doesn't refer + ;; to a previous element or object. + (new (or (cl-some + (lambda (cell) + (let ((stored (cdr (assoc cell crossrefs)))) + (when stored + (let ((old (org-export-format-reference stored))) + (and (not (assoc old cache)) stored))))) + cells) + (when (org-element-property :raw-value datum) + ;; Heading with a title + (unpackaged/org-export-new-title-reference datum cache)) + ;; NOTE: This probably breaks some Org Export + ;; feature, but if it does what I need, fine. + (org-export-format-reference + (org-export-new-reference cache)))) + (reference-string new)) + ;; Cache contains both data already associated to + ;; a reference and in-use internal references, so as to make + ;; unique references. + (dolist (cell cells) (push (cons cell new) cache)) + ;; Retain a direct association between reference string and + ;; DATUM since (1) not every object or element can be given + ;; a search cell (2) it permits quick lookup. + (push (cons reference-string datum) cache) + (plist-put info :internal-references cache) + reference-string)))) + +(defun unpackaged/org-export-new-title-reference (datum cache) + "Return new reference for DATUM that is unique in CACHE." + (cl-macrolet ((inc-suffixf (place) + `(progn + (string-match (rx bos + (minimal-match (group (1+ anything))) + (optional "--" (group (1+ digit))) + eos) + ,place) + ;; HACK: `s1' instead of a gensym. + (-let* (((s1 suffix) (list (match-string 1 ,place) + (match-string 2 ,place))) + (suffix (if suffix + (string-to-number suffix) + 0))) + (setf ,place (format "%s--%s" s1 (cl-incf suffix))))))) + (let* ((title (org-element-property :raw-value datum)) + (ref (url-hexify-string (substring-no-properties title))) + (parent (org-element-property :parent datum))) + (while (--any (equal ref (car it)) + cache) + ;; Title not unique: make it so. + (if parent + ;; Append ancestor title. + (setf title (concat (org-element-property :raw-value parent) + "--" title) + ref (url-hexify-string (substring-no-properties title)) + parent (org-element-property :parent parent)) + ;; No more ancestors: add and increment a number. + (inc-suffixf ref))) + ref))) ++
+Adapt this from https://github.com/alhassy/emacs.d to do something similar for source blocks. +
+(defun my/org-drawer-format (name contents) + "Export to HTML the drawers named with prefix ‘fold_’, ignoring case. + +The resulting drawer is a ‘code-details’ and so appears folded; +the user clicks it to see the information therein. +Henceforth, these are called ‘fold drawers’. + +Drawers without such a prefix may be nonetheless exported if their +body contains ‘:export: t’ ---this switch does not appear in the output. +Thus, we are biased to generally not exporting non-fold drawers. + +One may suspend export of fold drawers by having ‘:export: nil’ +in their body definition. + +Fold drawers naturally come with a title. +Either it is specfied in the drawer body by ‘:title: ⋯’, +or otherwise the drawer's name is used with all underscores replaced +by spaces. +" + (let* ((contents′ (replace-regexp-in-string ":export:.*\n?" "" contents)) + (fold? (s-prefix? "fold_" name 'ignore-case)) + (export? (string-match ":export:\s+t" contents)) + (not-export? (string-match ":export:\s+nil" contents)) + (title′ (and (string-match ":title:\\(.*\\)\n" contents) + (match-string 1 contents)))) + + ;; Ensure we have a title. + (unless title′ (setq title′ (s-join " " (cdr (s-split "_" name))))) + + ;; Output + (cond + ((and export? (not fold?)) contents′) + (not-export? nil) + (fold? + (thread-last contents′ + (replace-regexp-in-string ":title:.*\n" "") + (format "<details class=\"code-details\"> <summary> <strong> + <font face=\"Courier\" size=\"3\" color=\"green\"> %s + </font> </strong> </summary> %s </details>" title′)))))) + +(setq org-html-format-drawer-function 'my/org-drawer-format)
-https://orgmode.org/manual/CDLaTeX-mode.html#CDLaTeX-mode -
-(push "~/.config/doom/local/" load-path) -(require 'cdlatex) -(add-hook 'org-mode-hook 'turn-on-org-cdlatex) --
;; Custom classes to use when exporting to latex -(add-to-list 'org-latex-classes - `("beamer" - ,(concat "\\documentclass[presentation]{beamer}\n" +(after! org +;; Custom classes to use when exporting to latex +(add-to-list 'org-latex-classes + `("beamer" + ,(concat "\\documentclass[presentation]{beamer}\n" "[DEFAULT-PACKAGES]" "[PACKAGES]" - "[EXTRA]\n") - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) -(add-to-list 'org-latex-classes - '("clean-cheatsheet" + "[EXTRA]\n") + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) +(add-to-list 'org-latex-classes + '("clean-cheatsheet" "\\documentclass{clean-cheatsheet}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) - ) -(add-to-list 'org-latex-classes - '("clean-beamer" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ) +(add-to-list 'org-latex-classes + '("clean-beamer" "\\documentclass{clean-beamer}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) - ) -(add-to-list 'org-latex-classes - '("cleanreport" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ) +(add-to-list 'org-latex-classes + '("cleanreport" "\\documentclass{cleanreport}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) - ) -(add-to-list 'org-latex-classes - '("scrreprt" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ) +(add-to-list 'org-latex-classes + '("scrreprt" "\\documentclass{scrreprt}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) - ) -(add-to-list 'org-latex-classes - '("biblioreport" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ) +(add-to-list 'org-latex-classes + '("biblioreport" "\\documentclass{biblioreport}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) - ) + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ) +)
;; Add packages by default -(add-to-list 'org-latex-packages-alist '("" "siunitx" t)) -(add-to-list 'org-latex-packages-alist '("" "array" t)) -(add-to-list 'org-latex-packages-alist '("" "tabularx" t)) -(add-to-list 'org-latex-packages-alist '("" "booktabs" t)) -(add-to-list 'org-latex-packages-alist '("" "bm" t)) -(add-to-list 'org-latex-packages-alist '("most" "tcolorbox" t)) +(after! org + ;; Add packages by default + (add-to-list 'org-latex-packages-alist '("" "siunitx" t)) + (add-to-list 'org-latex-packages-alist '("" "array" t)) + (add-to-list 'org-latex-packages-alist '("" "tabularx" t)) + (add-to-list 'org-latex-packages-alist '("" "booktabs" t)) + (add-to-list 'org-latex-packages-alist '("" "bm" t)) + (add-to-list 'org-latex-packages-alist '("most" "tcolorbox" t)) +) ++
(after! org + ;; Setup default option for image size when exporting to LaTeX + (setq org-latex-image-default-option "scale=1") + (setq org-latex-image-default-width nil) -;; Use define labels instead of automatic generated ones -(setq org-latex-prefer-user-labels t) + ;; Use define labels instead of automatic generated ones + (setq org-latex-prefer-user-labels t) -;; Captions above the table -(setq org-latex-caption-above '(table)) + ;; Captions above the table + (setq org-latex-caption-above '(table)) -;; Settings to export code with `minted' instead of `verbatim'. -(setq org-latex-listings 'minted) + ;; Settings to export code with `minted' instead of `verbatim'. + (setq org-latex-listings 'minted) -;; Command used when exporting to pdf -(setq org-latex-pdf-process - '("latexmk -cd -pdflatex=\"pdflatex -synctex=1 -shell-escape -interaction nonstopmode -output-directory %o\" -pdf -bibtex -f %f")) + ;; Command used when exporting to pdf + (setq org-latex-pdf-process + '("latexmk -cd -pdflatex=\"pdflatex -synctex=1 -shell-escape -interaction nonstopmode -output-directory %o\" -pdf -bibtex -f %f")) +)
(defun tdh/my-beamer-bold (contents backend info) - (when (eq backend 'beamer) - (replace-regexp-in-string - (concat "\\`\\\\" "[A-Za-z0-9]+") ;; If not, orgmode is crazy... - "\\\\textbf" - contents))) +(after! org + (defun tdh-my-beamer-bold (contents backend info) + (when (eq backend 'beamer) + (replace-regexp-in-string + (concat "\\`\\\\" "[A-Za-z0-9]+") ;; If not, orgmode is crazy... + "\\\\textbf" + contents))) -(add-to-list 'org-export-filter-bold-functions 'tdh/my-beamer-bold) + (add-to-list 'org-export-filter-bold-functions 'tdh-my-beamer-bold) +)
[ ]
Make some comment those special environments(add-to-list 'org-beamer-environments-extra - '("cbox" ;; Name of environment +(after! org +(add-to-list 'org-beamer-environments-extra + '("cbox" ;; Name of environment "m" ;; Selection key "\\onslide%a{\\begin{cbox}[%h]%O" - "\\end{cbox}}\\vspace{0.5em}")) -(add-to-list 'org-beamer-environments-extra - '("csubbox" ;; Name of environment + "\\end{cbox}}\\vspace{0.5em}")) +(add-to-list 'org-beamer-environments-extra + '("csubbox" ;; Name of environment "M" ;; Selection key "\\onslide%a{\\tcbsubtitle{%h}" - "}")) + "}")) +)
(map! :map org-mode-map +(after! org + (map! :map org-mode-map ;; Activate Automatic LaTeX fragment - :n ",ol" '(lambda () (interactive) (add-hook 'post-command-hook 'tdh/org-latex-fragment-toggle t)) + :n ",ol" '(lambda () (interactive) (add-hook 'post-command-hook 'tdh-org-latex-fragment-toggle t)) ;; ;; Disable Automatic LaTeX fragment - :n ",oL" '(lambda () (interactive) (remove-hook 'post-command-hook 'tdh/org-latex-fragment-toggle))) + :n ",oL" '(lambda () (interactive) (remove-hook 'post-command-hook 'tdh-org-latex-fragment-toggle))) -;; Use F9 to globally generate all the latex fragments - (map! :map org-mode-map :n "<f9>" (lambda () (interactive) (org-preview-latex-fragment 16))) + ;; Use F9 to globally generate all the latex fragments + (map! :map org-mode-map :n "<f9>" (lambda () (interactive) (org-preview-latex-fragment 16))) ;; Put all the preview images in some directory - (setq org-preview-latex-image-directory "~/.ltximg/") + (setq org-preview-latex-image-directory "~/.ltximg/") ;; Define backends to preview LaTeX fragments - (setq org-preview-latex-process-alist '((imagemagick - :programs ("pdflatex" "convert") + (setq org-preview-latex-process-alist '((imagemagick + :programs ("pdflatex" "convert") :description "pdf > png" :message "you need to install the programs: pdflatex and imagemagick." :image-input-type "pdf" :image-output-type "png" - :image-size-adjust (0.6 . 0.6) - :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f") - :image-converter ("convert -density %D -trim -antialias %f -quality 100 %O")) - (dvipng - :programs ("latex" "dvipng") + :image-size-adjust (0.6 . 0.6) + :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f") + :image-converter ("convert -density %D -trim -antialias %f -quality 100 %O")) + (dvipng + :programs ("latex" "dvipng") :description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" - :image-size-adjust (0.5 . 0.5) - :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") - :image-converter ("dvipng -D %D -T tight -o %O %f")) - (dvisvgm - :programs ("pdflatex" "dvisvgm") + :image-size-adjust (0.5 . 0.5) + :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") + :image-converter ("dvipng -D %D -T tight -o %O %f")) + (dvisvgm + :programs ("pdflatex" "dvisvgm") :description "dvi > svg" :message "you need to install the programs: latex and dvisvgm." :image-input-type "dvi" :image-output-type "svg" - :image-size-adjust (0.7 . 0.7) - :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") - :image-converter ("dvisvgm %f -n -b min -c %S -o %O")) - )) + :image-size-adjust (0.7 . 0.7) + :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") + :image-converter ("dvisvgm %f -n -b min -c %S -o %O")) + )) ;; Use imagemagick/dvisvgm to generate png from pdf - (setq org-preview-latex-default-process 'dvipng) + (setq org-preview-latex-default-process 'dvipng) +)
(defcustom tdh/org-property-mapping - '((latex ("CUSTOM_PAGE" . tdh/insert-org-page-latex) - ("CUSTOM_LABEL" . tdh/insert-org-label-latex))) +(defcustom tdh-org-property-mapping + '((latex ("CUSTOM_PAGE" . tdh-insert-org-page-latex) + ("CUSTOM_LABEL" . tdh-insert-org-label-latex))) "List of mappings from org property to arbitrary strings. Each element is a list: (BACKEND (PROPERTY1 . FUNCTION1) (PROPERTY2 . FUNCTION2) ...) @@ -1781,13 +2017,13 @@ Special Environments
(defun tdh/replace-org-property (backend) - "Convert org properties using `tdh/org-property-mapping'. -Lookup BACKEND in `tdh/org-property-mapping' for a list of +(defun tdh-replace-org-property (backend) + "Convert org properties using `tdh-org-property-mapping'. +Lookup BACKEND in `tdh-org-property-mapping' for a list of (PROPERTY REPLACEMENT). For each healine being exported, if it has a PROPERTY listed insert a string immediately after the healine given by (format REPLACEMENT PROPERTY-VALUE)" - (let ((map (cdr (assoc backend tdh/org-property-mapping))) + (let ((map (cdr (assoc backend tdh-org-property-mapping))) value replacement) (when map (org-map-entries @@ -1797,17 +2033,17 @@ Special Environments (when (setq value (org-entry-get (point) (car it))) (funcall (cdr it) value))))))))) -(add-hook 'org-export-before-processing-hook #'tdh/replace-org-property) +(add-hook 'org-export-before-processing-hook #'tdh-replace-org-property)
(defun tdh/insert-org-label-latex (label) +(defun tdh-insert-org-label-latex (label) "Insert \"\\\\label{LABEL}\\n\" after the :PROPERTY: drawer." (search-forward-regexp org-property-end-re) (forward-char 1) (insert (format "\\label{%s}\n" label))) -(defun tdh/insert-org-page-latex (page) +(defun tdh-insert-org-page-latex (page) "Insert \"\\\\page{PAGE}\\n\" after the :PROPERTY: drawer." (search-forward-regexp org-property-end-re) (forward-char 1) @@ -1836,48 +2072,50 @@ Special EnvironmentsNumber Equations
@@ -1888,7 +2126,7 @@ Special Environments-(defun org-renumber-environment (orig-func &rest args) - "A function to inject numbers in LaTeX fragment previews." - (let ((results '()) - (counter -1) - (numberp)) +(after! org + (defun org-renumber-environment (orig-func &rest args) + "A function to inject numbers in LaTeX fragment previews." + (let ((results '()) + (counter -1) + (numberp)) - (setq results (loop for (begin . env) in - (org-element-map (org-element-parse-buffer) 'latex-environment - (lambda (env) - (cons - (org-element-property :begin env) - (org-element-property :value env)))) - collect - (cond - ((and (string-match "\\\\begin{equation}" env) - (not (string-match "\\\\tag{" env))) - (incf counter) - (cons begin counter)) - ((string-match "\\\\begin{align}" env) - (prog2 - (incf counter) - (cons begin counter) - (with-temp-buffer - (insert env) - (goto-char (point-min)) - ;; \\ is used for a new line. Each one leads to a number - (incf counter (count-matches "\\\\$")) - ;; unless there are nonumbers. - (goto-char (point-min)) - (decf counter (count-matches "\\nonumber"))))) - (t - (cons begin nil))))) + (setq results (loop for (begin . env) in + (org-element-map (org-element-parse-buffer) 'latex-environment + (lambda (env) + (cons + (org-element-property :begin env) + (org-element-property :value env)))) + collect + (cond + ((and (string-match "\\\\begin{equation}" env) + (not (string-match "\\\\tag{" env))) + (incf counter) + (cons begin counter)) + ((string-match "\\\\begin{align}" env) + (prog2 + (incf counter) + (cons begin counter) + (with-temp-buffer + (insert env) + (goto-char (point-min)) + ;; \\ is used for a new line. Each one leads to a number + (incf counter (count-matches "\\\\$")) + ;; unless there are nonumbers. + (goto-char (point-min)) + (decf counter (count-matches "\\nonumber"))))) + (t + (cons begin nil))))) - (when (setq numberp (cdr (assoc (point) results))) - (setf (car args) - (concat - (format "\\setcounter{equation}{%s}\n" numberp) - (car args))))) + (when (setq numberp (cdr (assoc (point) results))) + (setf (car args) + (concat + (format "\\setcounter{equation}{%s}\n" numberp) + (car args))))) - (apply orig-func args)) + (apply orig-func args)) -(advice-add 'org-create-formula-image :around #'org-renumber-environment) + (advice-add 'org-create-formula-image :around #'org-renumber-environment) +)TODO View PDF in org mode
-@@ -1938,13 +2176,13 @@ Special Environments(defun tdh/org-include-img-from-pdf (&rest _) +(defun tdh-org-include-img-from-pdf (&rest _) "Convert pdf files to image files in org-mode bracket links. # ()convertfrompdf:t # This is a special comment; tells that the upcoming # link points to the to-be-converted-to file. @@ -1925,7 +2163,7 @@ Special Environments (shell-command cmd) (message "%s" cmd))))))) (user-error "`convert' executable (part of Imagemagick) is not found"))) - (add-hook 'org-export-before-processing-hook #'tdh/org-include-img-from-pdf) + (add-hook 'org-export-before-processing-hook #'tdh-org-include-img-from-pdf)-@@ -2022,13 +2260,13 @@ Let’s try the first solution.(defun my-latex-filter-nobreaks (text backend info) +(defun tdh-latex-filter-nobreaks (text backend info) "Ensure \" \" are properly handled in LaTeX export." (when (org-export-derived-backend-p backend 'latex) (replace-regexp-in-string " " "~" text))) (add-to-list 'org-export-filter-plain-text-functions - 'my-latex-filter-nobreaks) + 'tdh-latex-filter-nobreaks)-@@ -2076,32 +2314,32 @@ Ressources:(defun tdh/change-png-to-pdf (text backend info) +(defun tdh-change-png-to-pdf (text backend info) "Change png images to pdf images when existing" (when (org-export-derived-backend-p backend 'latex) (let ((text (replace-regexp-in-string "[^\\w]\\(:\\)[^\n\t\r]+\\(:\\)[^\\w]" "<mark>" text nil nil 1 nil))) (replace-regexp-in-string "[^\\w]\\(<mark>\\)[^\n\t\r]+\\(:\\)[^\\w]" "</mark>" text nil nil 2 nil)))) -(add-to-list 'org-export-filter-plain-text-fucntions 'my-html-mark-tag) +(add-to-list 'org-export-filter-plain-text-fucntions 'tdh-html-mark-tag)(use-package! org-ref - :after org - :config - ;; Folder where the notes files are located (or file if just one Note file) - (setq org-ref-notes-directory "~/Cloud/thesis/ressources/notes") - (setq org-ref-bibliography-notes "~/Cloud/thesis/ressources/notes") + :after org + :init + :config + ;; Folder where the notes files are located (or file if just one Note file) + (setq org-ref-notes-directory "~/Cloud/thesis/ressources/notes") + (setq org-ref-bibliography-notes "~/Cloud/thesis/ressources/notes") - ;; Bibliography File - (setq reftex-default-bibliography '("~/Cloud/thesis/ressources/references.bib")) - (setq org-ref-default-bibliography '("~/Cloud/thesis/ressources/references.bib")) + ;; Bibliography File + (setq reftex-default-bibliography '("~/Cloud/thesis/ressources/references.bib")) + (setq org-ref-default-bibliography '("~/Cloud/thesis/ressources/references.bib")) - ;; Folder where all the pdf are located - (setq org-ref-pdf-directory "~/Cloud/thesis/ressources/pdfs") + ;; Folder where all the pdf are located + (setq org-ref-pdf-directory "~/Cloud/thesis/ressources/pdfs") - ;; Tell org-ref to let helm-bibtex find notes for it - (setq org-ref-notes-function - (lambda (thekey) - (let ((bibtex-completion-bibliography (org-ref-find-bibliography))) - (bibtex-completion-edit-notes - (list (car (org-ref-get-bibtex-key-and-file thekey))))))) + ;; Tell org-ref to let helm-bibtex find notes for it + (setq org-ref-notes-function + (lambda (thekey) + (let ((bibtex-completion-bibliography (org-ref-find-bibliography))) + (bibtex-completion-edit-notes + (list (car (org-ref-get-bibtex-key-and-file thekey))))))) - ;; Problem with speed: don't display broken links - (setq org-ref-show-broken-links t) - ;; Display information on the citation - (setq org-ref-show-citation-on-enter t) - (bibtex-set-dialect 'BibTeX) - ) + ;; Problem with speed: don't display broken links + (setq org-ref-show-broken-links t) + ;; Display information on the citation + (setq org-ref-show-citation-on-enter t) +)
(setq org-noter-always-create-frame nil) -(setq org-noter-kill-frame-at-session-end nil) -;; Fraction of the frame that the document window will occupy when split -(setq org-noter-doc-split-fraction '(0.6 . 0.6)) -;; Save the last visited location automatically; when starting a new session, go to that location -(setq org-noter-auto-save-last-location t) -;; Add an empty line between each note's heading and content -(setq org-noter-separate-notes-from-heading t) -;; List of paths to check (non recursively) when searching for a notes file -(setq org-noter-notes-search-path "~/Cloud/thesis/ressources/notes") +(use-package! org-noter + :after org + :init + :config + (setq org-noter-always-create-frame nil) + (setq org-noter-kill-frame-at-session-end nil) + ;; Fraction of the frame that the document window will occupy when split + (setq org-noter-doc-split-fraction '(0.6 . 0.6)) + ;; Save the last visited location automatically; when starting a new session, go to that location + (setq org-noter-auto-save-last-location t) + ;; Add an empty line between each note's heading and content + (setq org-noter-separate-notes-from-heading t) + ;; List of paths to check (non recursively) when searching for a notes file + (setq org-noter-notes-search-path "~/Cloud/thesis/ressources/notes") +)
-Export to LaTeX -
+(map! :map org-mode-map :n ",l" 'org-latex-export-to-latex) +(defun tdh-insert-paper-org-link (paper) + "Insert an org link to some paper, choosing the file with completion" + (interactive + (list (read-file-name "Paper: " "~/Cloud/thesis/ressources/pdfs/" nil t))) + (insert (format "[[papers:%s]]" (file-name-base paper)))) + +(after! org + (map! :map org-mode-map :n ",ip" 'tdh-insert-paper-org-link))
-Open pdf externally. -
(defun tdh/open-org-pdf-externally () +(defun tdh-insert-note-org-link (note) + "Insert an org link to some note, choosing the file with completion" + (interactive + (list (read-file-name "Note: " "~/Cloud/thesis/ressources/pdfs/" nil t))) + (insert (format "[[notes:%s]]" (file-name-base note)))) + +(after! org + (map! :map org-mode-map :n ",in" 'tdh-insert-note-org-link)) ++
(defun tdh-insert-image-org-link (img) + "Insert an org image link, choosing the file with completion +and starting from `my-default-image-directory'." + (interactive + (list (file-relative-name (read-file-name "Image: " (concat default-directory "figs/")) default-directory))) + (insert (format "[[file:%s]]" img))) + +(after! org + (map! :map org-mode-map :n ",if" 'tdh-insert-image-org-link)) ++
(defun tdh-latex/watch () + "Watch LaTeX file using latexmk" + (interactive) + (start-process-shell-command "latexmk-watch" "*latexmk-watch-output*" + "latexmk" (format "-pdflatex=\"xelatex -synctex=1 -shell-escape -interaction nonstopmode -output-directory='%s'\" -pdf -pvc -bibtex -f %s.tex" + (file-name-directory buffer-file-name) + (file-name-base buffer-file-name)))) +(defun tdh-latex/watch/kill () + "Kill the currently running TeX job." + (interactive) + (delete-process "latexmk-watch") + ) + +(after! org + (map! :map org-mode-map + :n ",ow" 'tdh-latex/watch + :n ",ok" 'tdh-latex/watch/kill)) ++
(after! org + (map! :map org-mode-map + :n ",ob" 'helm-bibtex + :n ",of" 'helm-bibtex-favorites + :n ",or" 'helm-resume)) ++
(defun tdh-open-terminal-in-workdir () + (interactive) + (call-process-shell-command + (concat "termite --directory=" default-directory) nil 0)) + +(after! org + (map! :map org-mode-map :n ",ot" 'tdh-open-terminal-in-workdir)) ++
(defun tdh-open-ranger-in-workdir () + (interactive) + (call-process-shell-command + (concat "termite --directory=" default-directory " --exec=ranger") nil 0)) + +(after! org + (map! :map org-mode-map :n ",oo" 'tdh-open-ranger-in-workdir)) ++
(after! org + (map! :map org-mode-map :n ",l" 'org-latex-export-to-latex)) ++
(defun tdh-open-org-pdf-externally () (interactive) (call-process "xdg-open" nil 0 nil (concat (file-name-sans-extension (buffer-file-name)) ".pdf")) ) -(map! :map org-mode-map :n ",vp" 'tdh/open-org-pdf-externally) +(after! org + (map! :map org-mode-map :n ",vp" 'tdh-open-org-pdf-externally))
-Open HTML externally. +
(defun tdh-open-org-html-externally () + (interactive) + (call-process "xdg-open" nil 0 nil (concat (file-name-sans-extension (buffer-file-name)) ".html")) + ) + +(after! org + (map! :map org-mode-map :n ",vh" 'tdh-open-org-html-externally)) ++
screenshot_name
maim -s figs/screenshot_name.png
to take a screenshot with selection+Then insert the following to the buffer
(defun tdh/open-org-html-externally () +#+name: sreenshot_name +[[file:figs/screenshot_name.png]] ++
+Then it would be nice to automatically prefix the CUSTOM_ID
property (until the first _
).
+
(defun tdh-insert-screenshot-org-link () +"Capture screenshot and insert the resulting file. +The screenshot tool is determined by `org-download-screenshot-method'." (interactive) - (call-process "xdg-open" nil 0 nil (concat (file-name-sans-extension (buffer-file-name)) ".html")) + (defvar filename (concat "./figs/" (read-string "Enter file name:") ".png")) + (shell-command (concat "maim -s " filename)) + (insert (format "[[file:%s]]" filename)) ) -(map! :map org-mode-map :n ",vh" 'tdh/open-org-html-externally) +(after! org + (map! :map org-mode-map :n ",is" 'tdh-insert-screenshot-org-link))
(setq org-contacts-files (list "~/Cloud/org/contacts.org")) --
(setq org-wunderlist-client-id "6799d9caeb2f5d8bd641" - org-wunderlist-token "fd5965cde436c2587850a7c517d366561d8a1cbf7b6d96ab62f3fc8c9930" - org-wunderlist-file "~/Cloud/thesis/todos/wunderlist.org" - org-wunderlist-dir "~/.emacs.d/org-wunderlist/") --
startblock
when opening org-mode files(defun tdh/eval-startblock () - (if (member "startblock" (org-babel-src-block-names)) - (save-excursion - (org-babel-goto-named-src-block "startblock") - (org-babel-execute-src-block)) - nil - ) - ) +(after! org + (defun tdh-eval-startblock () + (if (member "startblock" (org-babel-src-block-names)) + (save-excursion + (org-babel-goto-named-src-block "startblock") + (org-babel-execute-src-block)) + nil + ) + ) -(add-hook 'org-mode-hook 'tdh/eval-startblock) + (add-hook 'org-mode-hook 'tdh-eval-startblock) +)
(defun my-render-org-table-at-point () - (interactive) - (save-excursion - (beginning-of-line) - ;; removes the overlay is already there - (if (overlays-at (point)) - (delete-overlay (car (overlays-at (point)))) +(after! org + (defun tdh-render-org-table-at-point () + (interactive) + (save-excursion + (beginning-of-line) + ;; removes the overlay is already there + (if (overlays-at (point)) + (delete-overlay (car (overlays-at (point)))) - (let* ((element-type (org-element-type (org-element-at-point)))) - (if (and (not (eq element-type 'table)) - (not (eq element-type 'table-row))) - (error "not at an org table") + (let* ((element-type (org-element-type (org-element-at-point)))) + (if (and (not (eq element-type 'table)) + (not (eq element-type 'table-row))) + (error "not at an org table") - (while (not (eq 'table (org-element-type (org-element-at-point)))) - (forward-line -1)) - (my-render-org-table (org-element-at-point)) - ))))) + (while (not (eq 'table (org-element-type (org-element-at-point)))) + (forward-line -1)) + (tdh-render-org-table (org-element-at-point)) + ))))) -(defun my-render-org-table (table) - (interactive) - (let* ((begin (org-element-property :begin table)) - (end (let ((pos (org-element-property :end table))) - (goto-char pos) - (beginning-of-line) - ;; skip possible space after table - (while (not (looking-at " *[|#]")) - (setq pos (point)) - (forward-line -1)) - pos)) - (tabletxt (buffer-substring-no-properties begin end)) - (img (with-temp-buffer - (insert tabletxt) - (mark-whole-buffer) - (org-latex-convert-region-to-latex) - (org-latex-preview) - (goto-char (point-min)) - (overlay-get (car (overlays-at (point))) 'display))) - (overlay (make-overlay begin end))) - (overlay-put overlay 'display img) - (forward-line -1)) - ) + (defun tdh-render-org-table (table) + (interactive) + (let* ((begin (org-element-property :begin table)) + (end (let ((pos (org-element-property :end table))) + (goto-char pos) + (beginning-of-line) + ;; skip possible space after table + (while (not (looking-at " *[|#]")) + (setq pos (point)) + (forward-line -1)) + pos)) + (tabletxt (buffer-substring-no-properties begin end)) + (img (with-temp-buffer + (insert tabletxt) + (mark-whole-buffer) + (org-latex-convert-region-to-latex) + (org-latex-preview) + (goto-char (point-min)) + (overlay-get (car (overlays-at (point))) 'display))) + (overlay (make-overlay begin end))) + (overlay-put overlay 'display img) + (forward-line -1)) + ) -(defun my-render-org-tables-in-buffer () - (save-excursion - (org-element-map (org-element-parse-buffer) 'table 'my-render-org-table))) + (defun tdh-render-org-tables-in-buffer () + (save-excursion + (org-element-map (org-element-parse-buffer) 'table 'tdh-render-org-table))) ;; Use F9 to globally generate tables - (map! :map org-mode-map :n "<f8>" (lambda () (interactive) (my-render-org-table-at-point))) + (map! :map org-mode-map :n "<f8>" (lambda () (interactive) (tdh-render-org-table-at-point))) +) ++
(setq org-gcal-client-id "396102378658-dcmbcmrnthbe925519otsjbd921otq0v.apps.googleusercontent.com" - org-gcal-client-secret "4M5PWrbhQjwYEMXGK85lDYX9" - org-gcal-file-alist '(("dehaeze.thomas@gmail.com" . "~/Cloud/org/gcal.org") - ("8kjmhe2ar0abnm054ill1fb0gc@group.calendar.google.com" . "~/Cloud/org/gcal_phd.org"))) -;; Automatic fetch of the new events -(add-hook 'org-agenda-mode-hook (lambda () (org-gcal-fetch) )) +(use-package! org-gcal + :after org + :init + :config + (setq org-gcal-client-id "396102378658-dcmbcmrnthbe925519otsjbd921otq0v.apps.googleusercontent.com" + org-gcal-client-secret "4M5PWrbhQjwYEMXGK85lDYX9" + org-gcal-file-alist '(("dehaeze.thomas@gmail.com" . "~/Cloud/org/gcal.org") + ("8kjmhe2ar0abnm054ill1fb0gc@group.calendar.google.com" . "~/Cloud/org/gcal_phd.org"))) + ;; Automatic fetch of the new events + ;; (add-hook 'org-agenda-mode-hook (lambda () (org-gcal-fetch) )) +)
+Don’t ask for confirmation when evaluating following blocs +
;; Don't ask for confirmation when evalutating latex blocs -(defun my-org-confirm-babel-evaluate (lang body) - (not (member lang '("emacs-lisp" "latex" "matlab" "sh")))) -(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate) +(defun tdh-org-confirm-babel-evaluate (lang body) + (not (member lang '("emacs-lisp" "latex" "matlab" "sh")))) + +(after! org + (setq org-confirm-babel-evaluate 'tdh-org-confirm-babel-evaluate))
+Use the current window for C-c ’ source editing +
;; Use the current window for C-c ' source editing -(setq org-src-window-setup 'current-window) +(after! org + (setq org-src-window-setup 'current-window))
(defun tdh-org-prettify-symbols () + (mapc (apply-partially 'add-to-list 'prettify-symbols-alist) + (cl-reduce 'append + (mapcar (lambda (x) (list x (cons (upcase (car x)) (cdr x)))) + `(("#+begin_src" . ?✎) + ("#+end_src" . ?□) + ("#+begin_quote" . ?») + ("#+end_quote" . ?«))))) + (turn-on-prettify-symbols-mode)) +(add-hook 'org-mode-hook #'tdh-org-prettify-symbols) ++
+Add all named source blocks to org-babel-library-of-babel
.
+
(after! org + (org-babel-lob-ingest "~/Cloud/thesis/org-mode/org-babel-tutorial/org-babel-library.org")) ++
(defun tdh/ctrl-ret () - (interactive) - (defun in-src-block-p () - "Returns t when the point is inside a source code block" - (string= "src" (org-in-block-p '("src")))) +(defun tdh-ctrl-ret () + (interactive) + (defun in-src-block-p () + "Returns t when the point is inside a source code block" + (string= "src" (org-in-block-p '("src")))) - (defun in-src-block-function () - "Function to do when inside the src block" - (progn - (org-babel-execute-src-block) - (org-babel-next-src-block))) + (defun in-src-block-function () + "Function to do when inside the src block" + (progn + (org-babel-execute-src-block) + (org-babel-next-src-block))) - (if (in-src-block-p) - (in-src-block-function) - (+org--insert-item 'below))) + (if (in-src-block-p) + (in-src-block-function) + (+org--insert-item 'below))) - (map! :map evil-org-mode-map - :n "<C-return>" #'tdh/ctrl-ret) +(map! :after evil-org + :map evil-org-mode-map + :n "<C-return>" #'tdh-ctrl-ret)
;; (evil-define-minor-mode-key 'normal 'org-src-mode "q" 'org-edit-src-exit) +(defun tdh-ctrl-shit-ret () + (interactive) + (defun in-src-block-p () + "Returns t when the point is inside a source code block" + (string= "src" (org-in-block-p '("src")))) + + (if (in-src-block-p) + (tdh-org-babel-execute-goto-next) + (+org/insert-item-above))) + +(map! :after evil-org + :map evil-org-mode-map + :n "<C-S-return>" #'tdh-ctrl-shit-ret)
C-c C-c
:
https://emacs.stackexchange.com/questions/22430/rebind-org-babel-execute-src-block-maybe-to-c-c-c-c/22530#22530
-
-(defun tdh/ctrl-shit-ret () - (interactive) - (defun in-src-block-p () - "Returns t when the point is inside a source code block" - (string= "src" (org-in-block-p '("src")))) - - (if (in-src-block-p) - (tdh/org-babel-execute-goto-next) - (+org/insert-item-above))) - - (map! :map evil-org-mode-map - :n "<C-S-return>" #'tdh/ctrl-shit-ret) --
-Add all named source blocks to org-babel-library-of-babel
.
-
(after! org-babel - (org-babel-lob-ingest "~/Cloud/thesis/org-mode/org-babel-tutorial/org-babel-library.org") - ) --
org-babel-library-of-babel
.
(setq org-babel-matlab-shell-command "/home/thomas/bin/matlab -nodesktop -nosplash") +(after! org + (setq org-babel-matlab-shell-command "/home/thomas/bin/matlab -nodesktop -nosplash") -(setq org-babel-matlab-emacs-link-wrapper-method - "%s - if ischar(ans); - echo('test'); - fid = fopen('%s', 'w'); - fprintf(fid, '%s', ans); - fclose(fid); - else; - save -ascii %s ans; - end - delete('%s'); - ") + (setq org-babel-matlab-emacs-link-wrapper-method + "%s + if ischar(ans); + echo('test'); + fid = fopen('%s', 'w'); + fprintf(fid, '%s', ans); + fclose(fid); + else; + save -ascii %s ans; + end + delete('%s'); + ") + )
org-babel-library-of-babel
.
(setq org-babel-default-header-args:matlab - '((:results . "none") - (:session . "*MATLAB*") - (:comments . "org") - (:exports . "both") - (:cache . "no") - (:noweb . "no") - (:hlines . "no") - (:tangle . "no") - (:mkdir . "yes") - (:eval . "no-export"))) --
;; (push "~/.emacs.d/private/ob-session-async/lisp/" load-path) -;; (require 'ob-session-async) --
;; (with-eval-after-load "ob" -;; (require 'org-babel-eval-in-repl)) --
;; (with-eval-after-load "eval-in-repl" -;; (setq eir-jump-after-eval nil)) +(after! org + (setq org-babel-default-header-args:matlab + '((:results . "none") + (:session . "*MATLAB*") + (:comments . "org") + (:exports . "both") + (:cache . "no") + (:noweb . "no") + (:hlines . "no") + (:tangle . "no") + (:mkdir . "yes") + (:eval . "no-export"))) + )
org-babel-library-of-babel
.
(setq org-edit-src-content-indentation 2 - org-src-tab-acts-natively nil - org-src-preserve-indentation nil) +(after! org + (setq org-edit-src-content-indentation 2 + org-src-tab-acts-natively nil + org-src-preserve-indentation nil) + )
org-babel-library-of-babel
.
whos
matlab function(defun tdh/matlab-whos (&optional start end) +(defun tdh-matlab-whos (&optional start end) "Get what is in the Matlab workspace" (interactive) (if (use-region-p) @@ -2581,7 +2991,7 @@ Add all named source blocks toorg-babel-library-of-babel
.
help
matlab function-(defun tdh/matlab-help (start end) +(defun tdh-matlab-help (start end) "Get help on the selected function" (interactive "r") (let ((regionp (buffer-substring start end))) @@ -2595,7 +3005,7 @@ Add all named source blocks toorg-babel-library-of-babel
.Execute selected text
-(defun tdh/matlab-execute-selected (start end) +(defun tdh-matlab-execute-selected (start end) "Execute selected text in the *MATLAB* buffer" (interactive "r") (let ((regionp (buffer-substring start end))) @@ -2609,7 +3019,7 @@ Add all named source blocks toorg-babel-library-of-babel
.Specify a Matlab command to run
-(defun tdh/matlab-run-command () +(defun tdh-matlab-run-command () "Prompt user to enter a matlab command" (interactive) (process-send-string "*MATLAB*" (concat (read-string "Matlab Command: ") "\n"))) @@ -2622,7 +3032,7 @@ Add all named source blocks toorg-babel-library-of-babel
.Execute the current source block with no output
-(defun tdh/org-babel-execute (&optional arg info params) +(defun tdh-org-babel-execute (&optional arg info params) (interactive) (let* ((org-babel-current-src-block-location (or org-babel-current-src-block-location @@ -2691,9 +3101,9 @@ Add all named source blocks toorg-babel-library-of-babel
.Execute the source block and go to the next one
-@@ -2758,7 +3164,7 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign(defun tdh/org-babel-execute-goto-next (&optional arg info params) +(defun tdh-org-babel-execute-goto-next (&optional arg info params) (interactive) - (tdh/org-babel-execute arg info params) + (tdh-org-babel-execute arg info params) (org-babel-next-src-block) )@@ -2705,7 +3115,7 @@ Add all named source blocks toorg-babel-library-of-babel
.Org-Babel Tangle Subtree
@@ -2731,7 +3139,7 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign--(defun tdh/org-babel-tangle-subtree () +(defun tdh-org-babel-tangle-subtree () "Tangle the current subtree" (interactive) (progn @@ -2713,11 +3123,9 @@ Add all named source blocks to-org-babel-library-of-babel
. (org-babel-tangle) (widen)) ) --(map! :map org-mode-map :n ",bT" 'tdh/org-babel-tangle-subtree) +(after! org + (map! :map org-mode-map :n ",bT" 'tdh-org-babel-tangle-subtree))--(defun tdh/org-babel-jump-to-tangle-file () +(defun tdh-org-babel-jump-to-tangle-file () "Jump to tangle file for the source block at point." (interactive) (let (file org-babel-pre-tangle-hook org-babel-post-tangle-hook) @@ -2744,11 +3152,9 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign (if (file-readable-p file) (find-file file) (error "Cannot open tangle file %S" file))))) ---(map! :map org-mode-map :n ",bF" 'tdh/org-babel-jump-to-tangle-file) + (after! org + (map! :map org-mode-map :n ",bF" 'tdh-org-babel-jump-to-tangle-file))Org-Babel Tangle File and Execute
--(defun tdh/org-babel-execute-tangle-file () +(defun tdh-org-babel-execute-tangle-file () "Jump to tangle file for the source block at point." (interactive) (let (file org-babel-pre-tangle-hook org-babel-post-tangle-hook) @@ -2778,9 +3184,9 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign-LaTeX
-++-LaTeX
+
- https://tex.stackexchange.com/questions/52179/what-is-your-favorite-emacs-and-or-auctex-command-trick
- https://tex.stackexchange.com/questions/20843/useful-shortcuts-or-key-bindings-or-predefined-commands-for-emacsauctex
@@ -2819,9 +3225,9 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign-Pdf Viewer
-+-++ +PDF Viewer
+(setq TeX-view-program-selection '((output-pdf "Zathura"))) (setq TeX-source-correlate-mode t) @@ -2833,81 +3239,125 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign+Bibtex
+++++(use-package! bibtex + :config + (bibtex-set-dialect 'BibTeX)) ++-Helm-Bibtex
-++-Helm-Bibtex
+General Config
@@ -2917,13 +3367,9 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign-;; Use "tags" field when looking for bib entries -(setq helm-bibtex-additional-search-fields '(tags)) +(use-package! helm-bibtex + :init + :config + ;; Bibliography file + (setq bibtex-completion-bibliography "~/Cloud/thesis/ressources/references.bib") -;; Display of bibtex entries with helm -(setq bibtex-completion-display-formats - '((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}"))) + ;; Directory with all the pdfs + (setq bibtex-completion-library-path "~/Cloud/thesis/ressources/pdfs") -;; Special symbols for notes and pdf -(setq bibtex-completion-pdf-symbol "⌘") -(setq bibtex-completion-notes-symbol "✎") + ;; Directory with notes files + (setq bibtex-completion-notes-path "~/Cloud/thesis/ressources/notes/notes.org") -;; Bibliography file -(setq bibtex-completion-bibliography "~/Cloud/thesis/ressources/references.bib") + (setq bibtex-completion-notes-extension ".org") -;; Directory with all the pdfs -(setq bibtex-completion-library-path "~/Cloud/thesis/ressources/pdfs") + (setq bibtex-completion-pdf-extension '(".pdf" ".djvu")) -;; Directory with notes files -(setq bibtex-completion-notes-path "~/Cloud/thesis/ressources/notes") + ;; Use "tags" field when looking for bib entries + (setq helm-bibtex-additional-search-fields '(tags)) -;; Template used when creating new Note file -(setq bibtex-completion-notes-template-multiple-files (concat "#+TITLE: ${title}\n" - ":DRAWER:\n" - "#+LATEX_CLASS: biblioreport\n" - "\n" - "#+OPTIONS: toc:nil title:nil\n" - "#+OPTIONS: ':t -:t\n" - "\n" - "#+LATEX_HEADER: \\newcommand{\\refType}{${=type=}}\n" - "#+LATEX_HEADER: \\newcommand{\\refKey}{${=key=}}\n" - "#+LATEX_HEADER: \\newcommand{\\refTitle}{${title}}\n" - "#+LATEX_HEADER: \\newcommand{\\refAuthor}{${author-or-editor}}\n" - "#+LATEX_HEADER: \\newcommand{\\refJournal}{${journal}}\n" - "#+LATEX_HEADER: \\newcommand{\\refYear}{${year}}\n" - "#+LATEX_HEADER: \\newcommand{\\refDoi}{${DOI}}\n" - "#+LATEX_HEADER: \\newcommand{\\refUrl}{${url}}\n" - "#+LATEX_HEADER: \\newcommand{\\refKeywords}{${tags}}\n" - "#+LATEX_HEADER: \\input{config.tex}\n" - "#+LATEX_HEADER: \\graphicspath{{./figs/${=key=}/}}\n" - "# #+TOC: headlines 2\n" - ":END:\n" - "\n" - "#+BEGIN_abstract\n" - "\n" - "#+END_abstract\n" - "\n" - "* ${title} :ignore:\n" - ":PROPERTIES:\n" - ":CUSTOM_ID: ${=key=}\n" - ":AUTHOR: ${author}\n" - ":TYPE: ${=type=}\n" - ":JOURNAL: ${journal}\n" - ":YEAR: ${year}\n" - ":VOLUME: ${volume}\n" - ":PAGES: ${pages}\n" - ":DOI: ${DOI}\n" - ":URL: ${url}\n" - ":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n" - ":END:\n" - "\n")) + (setq helm-bibtex-full-frame nil) -;; Make "Edit notes" the default action -(after! helm-bibtex + (setq org-noter-auto-save-last-location nil) + + ;; Display of bibtex entries with helm + (setq bibtex-completion-display-formats + '((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}"))) + + ;; Special symbols for notes and pdf + (setq bibtex-completion-pdf-symbol "⌘") + (setq bibtex-completion-notes-symbol "✎") + + ;; Template used when creating new Note file + (setq bibtex-completion-notes-template-multiple-files (concat "#+TITLE: ${title}\n" + ":DRAWER:\n" + "#+LATEX_CLASS: biblioreport\n" + "\n" + "#+OPTIONS: toc:nil title:nil\n" + "#+OPTIONS: ':t -:t\n" + "\n" + "#+LATEX_HEADER: \\newcommand{\\refType}{${=type=}}\n" + "#+LATEX_HEADER: \\newcommand{\\refKey}{${=key=}}\n" + "#+LATEX_HEADER: \\newcommand{\\refTitle}{${title}}\n" + "#+LATEX_HEADER: \\newcommand{\\refAuthor}{${author-or-editor}}\n" + "#+LATEX_HEADER: \\newcommand{\\refJournal}{${journal}}\n" + "#+LATEX_HEADER: \\newcommand{\\refYear}{${year}}\n" + "#+LATEX_HEADER: \\newcommand{\\refDoi}{${DOI}}\n" + "#+LATEX_HEADER: \\newcommand{\\refUrl}{${url}}\n" + "#+LATEX_HEADER: \\newcommand{\\refKeywords}{${tags}}\n" + "#+LATEX_HEADER: \\input{config.tex}\n" + "#+LATEX_HEADER: \\graphicspath{{./figs/${=key=}/}}\n" + "# #+TOC: headlines 2\n" + ":END:\n" + "\n" + "#+BEGIN_abstract\n" + "\n" + "#+END_abstract\n" + "\n" + "* ${title} :${=type=}:ignore:\n" + ":PROPERTIES:\n" + ":CUSTOM_ID: ${=key=}\n" + ":AUTHOR: ${author}\n" + ":TYPE: ${=type=}\n" + ":JOURNAL: ${journal}\n" + ":YEAR: ${year}\n" + ":VOLUME: ${volume}\n" + ":PAGES: ${pages}\n" + ":DOI: ${DOI}\n" + ":URL: ${url}\n" + ":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n" + ":END:\n" + "\n")) + + (setq bibtex-completion-notes-template-one-file (concat "\n" + "* ${author-abbrev} (${year}): ${title} :${=type=}:ignore:\n" + ":PROPERTIES:\n" + ":CUSTOM_ID: ${=key=}\n" + ":EXPORT_FILE_NAME: ${=key=}\n" + ":EXPORT_TITLE: ${title}\n" + ":AUTHOR: ${author}\n" + ":TYPE: ${=type=}\n" + ":JOURNAL: ${journal}\n" + ":YEAR: ${year}\n" + ":VOLUME: ${volume}\n" + ":PAGES: ${pages}\n" + ":DOI: ${DOI}\n" + ":URL: ${url}\n" + ":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n" + ":END:\n" + "\n")) + + ;; Make "Edit notes" the default action (helm-delete-action-from-source "Edit notes" helm-source-bibtex) - (helm-add-action-to-source "Edit notes" 'helm-bibtex-edit-notes helm-source-bibtex 0)) + (helm-add-action-to-source "Edit notes" 'helm-bibtex-edit-notes helm-source-bibtex 0) + + (helm-delete-action-from-source "Open PDF Externally" helm-source-bibtex) + (helm-add-action-to-source "Open PDF Externally" 'tdehaeze/open-pdf-externally helm-source-bibtex 1) +)Open pdf externally
@@ -2970,9 +3416,9 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign-(defun tdehaeze/open-pdf-externally (key) +;; Action to open the pdf with Zathura +(defun tdehaeze/open-pdf-externally (key) (call-process "zathura" nil 0 nil (nth 0 (-cons-to-list (bibtex-completion-find-pdf key))))) - -;; Action to open the pdf with Zathura -(after! helm-bibtex - (helm-delete-action-from-source "Open PDF Externally" helm-source-bibtex) - (helm-add-action-to-source "Open PDF Externally" 'tdehaeze/open-pdf-externally helm-source-bibtex 1))-TODO Matlab
-+++TODO Matlab
+@@ -3031,6 +3477,16 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign
- https://github.com/yuhonglin/matlab-mode
- https://github.com/pronobis/matlab-mode
@@ -3007,7 +3453,7 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign (add-to-list 'flycheck-checkers 'matlab-mlint) ;; Automatic startup of flycheck for matlab -(add-hook 'matlab-mode-hook 'flycheck-mode) +(add-hook 'matlab-mode-hook 'flycheck-mode)++Completion in the Matlab Shell
+++++(map! :map matlab-shell-mode-map :i "<tab>" 'matlab-shell-tab) ++TODO Beautify code
@@ -3069,7 +3525,7 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign-- -(map! :map matlab-mode-map +(map! :map matlab-mode-map :n ",g" 'matlab-go-to-file-directory :n ",da" 'matlab-add-breakpoint :n ",dr" 'matlab-remove-breakpoint @@ -3088,20 +3544,20 @@ Actually this tangle the file and then go to the file. Maybe I would like to ignWrong highlight of comments
@@ -3462,85 +3918,15 @@ Check here.-(add-hook 'matlab-mode-hook - ;; `highlight-numbers-mode' breaks MATLAB comment coloring -- - ;; `highlight-numbers-mode' is mostly redundant with - ;; `rainbow-identifiers-mode' anyway - (lambda () - (highlight-numbers-mode -1)) - ;; We must append the above *after* `spacemacs/run-prog-mode-hooks' - ;; in `matlab-mode-hook', since the former hook enables - ;; `highlight-numbers-mode'. Note that - ;; `spacemacs/run-prog-mode-hooks' is manually added to - ;; `matlab-mode-hook' by Spacemacs since the upstream `matlab-mode' - ;; package does not derive `matlab-mode' from `prog-mode' (oddly -- - ;; IIRC the author refused to do so for compatibility with XEmacs). - 'append) +(add-hook 'matlab-mode-hook + ;; `highlight-numbers-mode' breaks MATLAB comment coloring -- + ;; `highlight-numbers-mode' is mostly redundant with + ;; `rainbow-identifiers-mode' anyway + (lambda () + (highlight-numbers-mode -1)) + ;; We must append the above *after* `spacemacs/run-prog-mode-hooks' + ;; in `matlab-mode-hook', since the former hook enables + ;; `highlight-numbers-mode'. Note that + ;; `spacemacs/run-prog-mode-hooks' is manually added to + ;; `matlab-mode-hook' by Spacemacs since the upstream `matlab-mode' + ;; package does not derive `matlab-mode' from `prog-mode' (oddly -- + ;; IIRC the author refused to do so for compatibility with XEmacs). + 'append)PDF-Tools
---(add-hook 'pdf-view-mode-hook (lambda() (linum-mode -1))) ----Custom command and leader keys
-----Watch LaTeX file using latexmk
---(defun tdh/latex/watch () - "Watch LaTeX file using latexmk" - (interactive) - (start-process-shell-command "latexmk-watch" "*latexmk-watch-output*" - "latexmk" (format "-pdflatex=\"xelatex -synctex=1 -shell-escape -interaction nonstopmode -output-directory='%s'\" -pdf -pvc -bibtex -f %s.tex" - (file-name-directory buffer-file-name) - (file-name-base buffer-file-name)))) -(defun tdh/latex/watch/kill () - "Kill the currently running TeX job." - (interactive) - (delete-process "latexmk-watch") +(use-package! pdf-tools + :config + (add-hook 'pdf-view-mode-hook (lambda() (linum-mode -1))) ) - -(map! :map org-mode-map - :n ",ow" 'tdh/latex/watch - :n ",ok" 'tdh/latex/watch/kill)-- -Helm-Bibtex
-----(map! :map org-mode-map - :n ",ob" 'helm-bibtex - :n ",of" 'helm-bibtex-favorites - :n ",or" 'helm-resume) ---- -Open terminal in current directory
-----(defun tdh/open-terminal-in-workdir () - (interactive) - (call-process-shell-command - (concat "termite --directory=" default-directory) nil 0)) - -(map! :map org-mode-map :n ",ot" 'tdh/open-terminal-in-workdir) ----Open ranger in current directory
-----(defun tdh/open-ranger-in-workdir () - (interactive) - (call-process-shell-command - (concat "termite --directory=" default-directory " --exec=ranger") nil 0)) - -(map! :map org-mode-map :n ",oo" 'tdh/open-ranger-in-workdir) ---Yassnippets
@@ -3565,32 +3951,6 @@ Check here.--TODO Slack
----- -(slack-register-team - :name "emacs-slack" - :default t - :client-id "299050134212.316863429523" - :client-secret "7168a660375090e517fe812ea2d136e5" - :token "xoxp-299050134212-299063259042-715794254097-7c319fdd63315620e86f1fad42c126a2" - :subscribed-channels '()) ---- -(advice-add 'slack-counts-update :override #'ignore) ----(setq slack-prefer-current-team t) --@@ -3681,16 +4041,21 @@ they are implemented.TODO Neomutt connection
@@ -3603,7 +3963,7 @@ Check here. ;; Call this function, which spawns neomutt, whenever org-mode ;; tries to open a link of the form mutt:message-id+goes_here@mail.gmail.com -(defun tdh/mutt-open-message (message-id) +(defun tdh-mutt-open-message (message-id) "In neomutt, open the email with the the given Message-ID" (let* ((message-id (replace-regexp-in-string "^/*" "" message-id)) @@ -3625,7 +3985,7 @@ Check here. (concat "neomutt -R -f " mail-dir " -e \"" (format "push '%s a l'\"" mutt-keystrokes))))) ;; Hook up `message:...` style URLs -(org-add-link-type "message" 'tdh/mutt-open-message) +(org-add-link-type "message" 'tdh-mutt-open-message)-Doom
+init.el
Doom
init.el
ATTACH@@ -3786,9 +4154,9 @@ they are implemented.-(doom! :completion +(when noninteractive + (after! undo-tree + (global-undo-tree-mode -1))) + +(doom! :completion company ; the ultimate code completion backend helm ; the *other* search engine for love and life ivy ; a search engine for love and life :ui doom ; what makes DOOM look the way it does + doom-dashboard ; a nifty splash screen for Emacs hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW hydra modeline ; snazzy, Atom-inspired modeline, plus API @@ -3722,7 +4087,7 @@ they are implemented. eshell ; a consistent, cross-platform shell (WIP) :tools - debugger ; FIXME stepping through code, to help you add bugs + debugger ; Stepping through code, to help you add bugs (eval +overlay) ; run code, run (also, repls) (lookup ; helps you navigate your code and documentation +docsets) ; ...or in Dash docsets locally @@ -3738,12 +4103,13 @@ they are implemented. :lang data ; config/data formats emacs-lisp ; drown in parentheses - latex ; writing papers in Emacs has never been so fun + latex ; writing papers in Emacs has never been so fun markdown ; writing docs for people to ignore (org ; organize your plain life in plain text +dragndrop ; drag & drop files/images into org buffers +hugo ; use Emacs for hugo blogging +journal ; + +pomodoro ; +present) ; using org-mode for presentations ;;python ; beautiful is better than ugly sh ; she sells {ba,z,fi}sh shells on the C xor @@ -3752,7 +4118,7 @@ they are implemented. ;;(mu4e +gmail) :app - ;;calendar + calendar ;;(rss +org) ; emacs as an RSS reader ;;write ; emacs for writers (fiction, notes, papers, etc.) @@ -3777,6 +4143,8 @@ they are implemented. (package! matlab-mode :recipe (:host github :repo "matlab-mode/mirror")) (package! org-ref) +(package! org-ql) +(package! org-fancy-priorities)Snippets
--LaTeX
-++-LaTeX
+Coordinate
@@ -3847,9 +4215,9 @@ $0-Matlab
-++-Matlab
+Clear
@@ -3907,9 +4275,9 @@ if exist('opts_param','-Org Mode
-+-+Org Mode
+@@ -4510,7 +4878,7 @@ $0Begin
@@ -4192,13 +4560,13 @@ $0#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com> #name :Matlab-Figure # -- -#+HEADER: :tangle no :exports results :results none :noweb yes +#+header: :tangle no :exports results :results none :noweb yes #+begin_src matlab :var filepath="${2:figs}/$1.pdf" :var figsize="${3:full-tall}" :post pdf2svg(file=*this*, ext="png") <<plt-matlab>>$0 #+end_src -#+NAME: fig:$1 -#+CAPTION: ${4:caption}${5: ([[./figs/$1.png][png]], [[./figs/$1.pdf][pdf]])} +#+name: fig:$1 +#+caption: ${4:caption}${5: ([[./figs/$1.png][png]], [[./figs/$1.pdf][pdf]])} [[file:$2/$1.png]]diff --git a/docs/i3.html b/docs/i3.html index 491926b..996ecf3 100644 --- a/docs/i3.html +++ b/docs/i3.html @@ -4,7 +4,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + -Created: 2020-01-28 mar. 21:32
+Created: 2020-03-01 dim. 22:50
I3 Configuration @@ -201,50 +201,28 @@ @@ -258,14 +236,13 @@ for the JavaScript code in this tag.Table of Contents
-
-- Basic configuration -
-
- Colors
- Mod Key
- Border Style
- Font for window titles
-- Color palette used for the terminal ( ~/.Xresources file )
+- Colors Variables
- Theme colors
+- Various Config
+- Border
- Settings for i3-gaps
- Workspace names
- Use Mouse+$mod to drag floating windows
@@ -277,49 +254,19 @@ for the JavaScript code in this tag.- Scratchpad
-- Run Polybar and SXHKD
-Basic configuration
-----Colors
----set $bg #32302f -set $bg1 #3c3836 -set $bg2 #504945 -set $bg3 #665c54 -set $bg4 #7c6f64 - -set $fg #ebdbb2 -set $fg1 #ebdbb2 -set $fg2 #d5c4a1 -set $fg3 #bdae93 -set $fg4 #a89984 - -set $gray #a89984 -set $red #cc241d -set $green #98971a -set $yellow #d79921 -set $blue #458588 -set $purple #b16286 -set $aqua #689d6a -set $orange #d65d0e +# i3 config file (v4)-Mod Key
-++-Mod Key
+Set mod key (Mod1=<Alt>, Mod4=<Super>)
@@ -330,24 +277,29 @@ Set mod key (Mod1=<Alt>, Mod4=<Super>)-Border Style
-++-Border Style
+--# Hide borders -hide_edge_borders smart +# Configure border style <normal|1pixel|pixel xx|none|pixel> +# Use custom colors for black new_window pixel 1 new_float normal +++Hide borders +
++hide_edge_borders smart-Font for window titles
-++Font for window titles
+-font Hack Nerd Font 11
@@ -355,120 +307,94 @@ hide_edge_borders smart-Color palette used for the terminal ( ~/.Xresources file )
---Colors are gathered based on the documentation https://i3wm.org/docs/userguide.html#xresources. -
- ++-Colors Variables
+-set_from_resource $darkred color1 #000000 -set_from_resource $red color9 #000000 -set_from_resource $darkgreen color2 #000000 -set_from_resource $green color10 #000000 -set_from_resource $darkyellow color3 #000000 -set_from_resource $yellow color11 #000000 -set_from_resource $darkblue color4 #000000 -set_from_resource $blue color12 #000000 -set_from_resource $darkmagenta color5 #000000 -set_from_resource $magenta color13 #000000 -set_from_resource $darkcyan color6 #000000 -set_from_resource $cyan color14 #000000 -set_from_resource $darkwhite color7 #000000 -set_from_resource $white color15 #000000 - -# Use custom colors for black -set $black #282828 -set $darkblack #1d2021 -set $transparent #00000000 +set_from_resource $bg color0 #000000 +set_from_resource $darkred color1 #000000 +set_from_resource $darkgreen color2 #000000 +set_from_resource $darkyellow color3 #000000 +set_from_resource $darkblue color4 #000000 +set_from_resource $darkpurple color5 #000000 +set_from_resource $darkaqua color6 #000000 +set_from_resource $darkgray color7 #000000 +set_from_resource $gray color8 #000000 +set_from_resource $red color9 #000000 +set_from_resource $green color10 #000000 +set_from_resource $yellow color11 #000000 +set_from_resource $blue color12 #000000 +set_from_resource $purple color13 #000000 +set_from_resource $aqua color14 #000000 +set_from_resource $fg color15 #000000-Theme colors
-++-Theme colors
+# class border backgr. text indic. child_border -client.focused $blue $blue $fg $blue -client.focused_inactive $bg $bg $fg $bg -client.urgent $bg $bg $fg $bg -client.unfocused $bg $bg $fg $bg -client.placeholder $bg $bg $fg $bg +client.focused $darkaqua $darkaqua $fg $bg +client.focused_inactive $bg $bg $fg $bg +client.unfocused $bg $bg $fg $bg +client.urgent $bg $bg $fg $bg -client.background #32302F +client.background $bg-Settings for i3-gaps
-++-Various Config
+++Layout mode for new containers +
--# Additionally, you can issue commands with the following syntax. This is useful to bind keys to changing the gap size. -# gaps inner|outer current|all set|plus|minus <px> -# gaps inner all set 10 -# gaps outer all plus 5 - -# Smart gaps (gaps used if only more than one container on the workspace) -# smart_gaps on - -# Smart borders (draw borders around container only if it is not the only container on this workspace) -# on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0) -# smart_borders on - -# Press $mod+Shift+g to enter the gap mode. Choose o or i for modifying outer/inner gaps. Press one of + / - (in-/decrement for current workspace) or 0 (remove gaps for current workspace). If you also press Shift with these keys, the change will be global for all workspaces. -set $mode_gaps Gaps: (o) outer, (i) inner -set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) -set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) -bindsym $mod+Shift+g mode "$mode_gaps" - -mode "$mode_gaps" { - bindsym o mode "$mode_gaps_outer" - bindsym i mode "$mode_gaps_inner" - bindsym Return mode "default" - bindsym Escape mode "default" -} -mode "$mode_gaps_inner" { - bindsym plus gaps inner current plus 5 - bindsym minus gaps inner current minus 5 - - bindsym 0 gaps inner current set 0 - - bindsym Shift+plus gaps inner all plus 5 - bindsym Shift+minus gaps inner all minus 5 - bindsym Shift+0 gaps inner all set 0 - - bindsym Return mode "default" - bindsym Escape mode "default" -} -mode "$mode_gaps_outer" { - bindsym plus gaps outer current plus 5 - bindsym minus gaps outer current minus 5 - bindsym 0 gaps outer current set 0 - - bindsym Shift+plus gaps outer all plus 5 - bindsym Shift+minus gaps outer all minus 5 - bindsym Shift+0 gaps outer all set 0 - - bindsym Return mode "default" - bindsym Escape mode "default" -} +# Set inner/outer gaps -gaps inner 10 -gaps outer -2 +workspace_layout default +++focus_follows_mouse yes-Workspace names
-+++ +Border
+++++default_border pixel 1 +
+++ +Settings for i3-gaps
+++++ +# for_window [class=".*"] border pixel 0 ++++gaps inner 10 +gaps outer 2 +++-Workspace names
+To display names or symbols instead of plain workspace numbers you can use something like:
@@ -487,9 +413,9 @@ set $ws8 8set $ws1 1:mail
andset $ws2 2:
.-Use Mouse+$mod to drag floating windows
-++Use Mouse+$mod to drag floating windows
+-floating_modifier $mod@@ -497,9 +423,9 @@ set $ws8 8-Back and Forth
-++Back and Forth
+-workspace_auto_back_and_forth yes@@ -507,16 +433,15 @@ set $ws8 8-Application Specific
-++Application Specific
+--Open applications on specific workspaces
-++Open applications on specific workspaces
+--# Matlab Figures -assign[title="^Fig"] $ws6 +assign[title="^Fig"] $ws6 # Matlab Figures for_window [title="^Fig"] layout tabbed assign[title="^HG_Peer"] $ws6 # Name of window when export figure with matlab@@ -524,24 +449,17 @@ set $ws8 8-Open specific applications in floating mode
-++Open specific applications in floating mode
+-for_window [title="File Transfer*"] floating enable for_window [class="GParted"] floating enable border normal -for_window [title="i3_help"] floating enable sticky enable border normal for_window [class="Lightdm-settings"] floating enable for_window [class="Lxappearance"] floating enable sticky enable border normal -for_window [class="Manjaro Settings Manager"] floating enable border normal -for_window [class="Pamac-manager"] floating enable for_window [class="Pavucontrol"] floating enable -for_window [class="qt5ct"] floating enable sticky enable border normal -for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal for_window [class="Simple-scan"] floating enable border normal for_window [class="(?i)System-config-printer.py"] floating enable border normal -for_window [class="Timeset-gui"] floating enable border normal -for_window [class="(?i)virtualbox"] floating enable border normal for_window [class="Xfburn"] floating enable for_window [title="^Documentation -"] floating enable border normal for_window [class="Yad"] floating enable @@ -553,18 +471,24 @@ set $ws8 8--Scratchpad
-++@@ -573,8 +497,8 @@ bindsym $mod+BackSpace scratchpad showScratchpad
+++Move the currently focused window to the scratchpad +
-+ +# move the currently focused window to the scratchpad -bindsym $mod+Shift+BackSpace move scratchpad - -# Show the next scratchpad window or hide the focused scratchpad window. -# If there are multiple scratchpad windows, this command cycles through them. -bindsym $mod+BackSpace scratchpad show +bindsym $mod+Shift+BackSpace move scratchpad+Show the next scratchpad window or hide the focused scratchpad window. +If there are multiple scratchpad windows, this command cycles through them. +
++bindsym $mod+BackSpace scratchpad show +Run Polybar and SXHKD
@@ -582,7 +506,7 @@ exec_always --no-startup-id sxhkd -m-exec_always --no-startup-id $HOME/.config/polybar/scripts/launch.sh -exec_always --no-startup-id sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.i3 +exec --no-startup-id sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.i3 +exec --no-startup-id $HOME/.config/polybar/scripts/launch.sh
diff --git a/docs/index.html b/docs/index.html index 68ce24b..4d55452 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + -Created: 2020-01-12 dim. 17:28
+Created: 2020-03-01 dim. 22:50
Dotfiles - Manjaro Linux @@ -201,50 +201,28 @@ @@ -261,18 +239,18 @@ for the JavaScript code in this tag.- Links to literate configs
- Package Manager: yay
- Git Setup
-
- Installation
-- Configuration
+- Installation
+- Configuration
- Diff-So-Fancy
- Credential Helper setup with Pass
@@ -282,36 +260,36 @@ for the JavaScript code in this tag.- Shell: Bash and ZSH
- Terminal Multiplexer: Tmux
- Fonts @@ -320,14 +298,14 @@ for the JavaScript code in this tag.
- Neovim
- Emacs
@@ -345,11 +323,12 @@ for the JavaScript code in this tag.- Install the gnupg package:
- Create a key pair
- Configure the gpg-agent to cache the passphrase
+- Gnome-Keyring and automatic GnuPG key unlocking
- Launcher - Rofi @@ -358,18 +337,18 @@ for the JavaScript code in this tag.
- Install the pass package
- Initialize the password store as a git repository
-- Gui Manager
-- Integration with Rofi +
- Gui Manager
+- Integration with Rofi
- Integration with Browsers
- Integration with Git
- Integration with other programs
@@ -378,28 +357,28 @@ for the JavaScript code in this tag.- Bookmark Manager: Buku
- Browser: qutebrowser
-
@@ -440,14 +419,14 @@ for the JavaScript code in this tag.- Installation
+- Installation
- View Pdf inside qutebrowser with pdfjs
- Integration with Pass: the password manager
@@ -414,7 +393,7 @@ for the JavaScript code in this tag.- Sound Server - Pulse Audio
- Audio Server - MPD @@ -422,16 +401,16 @@ for the JavaScript code in this tag.
- Audio Server with Spotify - Mopidy
- MPD Client - ncmpcpp
- Library Manager - beets
- Media Player - MPV
- Chromecast with CATT @@ -463,17 +442,17 @@ for the JavaScript code in this tag.
- Connect with Phone
- Chat Application - Weechat
-
- Installation
+- Installation
- Enable mouse support
- Scripts
- Theme
-- Configuration
+- Configuration
- Multi-line messages
- Send message using
-$EDITOR
- CheatSheet
+- CheatSheet
- Slack Integration
@@ -487,8 +466,8 @@ for the JavaScript code in this tag.
- Synchronize Mailboxes - Mbsync
--
- Installation
-- Configuration
+- Installation
+- Configuration
- Automation using systemd
- Retreive New mails
@@ -499,17 +478,17 @@ for the JavaScript code in this tag.- Send Mails - Msmtp
- Mail Index, Search and Tagging - Mu
- Mail Client - NeoMutt
- Notification system
@@ -519,8 +498,8 @@ for the JavaScript code in this tag.
- Ranger
@@ -531,9 +510,9 @@ for the JavaScript code in this tag. @@ -541,27 +520,27 @@ for the JavaScript code in this tag.- HotKeyManager - SXHKD
- Windows Manager - i3
- Polybar
- Compositor - Picom
- Notification Manager - Dunst
- Office Suite @@ -574,7 +553,7 @@ for the JavaScript code in this tag.
- GTK Themes
@@ -595,11 +574,11 @@ for the JavaScript code in this tag.- LaTeX @@ -608,19 +587,19 @@ for the JavaScript code in this tag.
- Insect
- Matlab
- SageMath
@@ -630,8 +609,8 @@ for the JavaScript code in this tag.
- Torrent Client - deluge
@@ -659,14 +638,14 @@ for the JavaScript code in this tag.
- Vdirsyncer - Sync calendars
- Calendar Client - Khal
@@ -676,9 +655,9 @@ for the JavaScript code in this tag. @@ -688,28 +667,28 @@ for the JavaScript code in this tag.- OrgMode and Emacs
- Wunderline
- Background manager: nitrogen
- PDF Reader: Zathura @@ -728,13 +707,13 @@ for the JavaScript code in this tag.
- Graphical Editor
- VPN Setup with NordVPN
-- Others +
- Others
- Reddit on terminal: rtv
- Interact with API
@@ -758,7 +737,7 @@ for the JavaScript code in this tag.- Google translate from the command line
-- Others
+- Others
- Archive and Extract
- Hardware
- Network
@@ -769,8 +748,8 @@ for the JavaScript code in this tag.- For loop
- Some notes
-- Ressources +
- Some notes - Systemd
+- Ressources
- Dotfiles
- Linux Softwares
@@ -879,9 +858,9 @@ Others:-Installation
-++Installation
+-sudo pacman -S yay
@@ -889,9 +868,9 @@ Others:-CheatSheet
-++CheatSheet
+