# Unset some variables
-unset use_color safe_term match_lhs sh
+
# Unset some variables
+ unset use_color safe_term match_lhs sh
-# Allow local processes with root privileges to connect to the locally running X server
-xhost +local:root > /dev/null 2>&1
+ # Allow local processes with root privileges to connect to the locally running X server
+ xhost +local:root > /dev/null 2>&1
-# Autocomplete sudo commands
-complete -cf sudo
+ # Autocomplete sudo commands
+ complete -cf sudo
-# Line wrap on window resize
-shopt -s checkwinsize
+ # Line wrap on window resize
+ shopt -s checkwinsize
-# Expand Aliases
-shopt -s expand_aliases
+ # Enable history expansion with space
+ # E.g. typing !!<space> will replace the !! with your last command
+ bind Space:magic-space
-# Auto "cd" when entering just a path
-shopt -s autocd
+ # Expand Aliases
+ shopt -s expand_aliases
-# Enable history appending instead of overwriting
-shopt -s histappend
+ # Auto "cd" when entering just a path
+ shopt -s autocd
+
+ # Enable history appending instead of overwriting
+ shopt -s histappend
+
+ # Save multi-line commands as one command
+ shopt -s cmdhist
@@ -547,45 +547,45 @@ After that, restart Emacs with spc q r.
Doom Config
-
(setqdoom-font(font-spec:family"Hack Nerd Font Mono":size12:weight'semi-light)
- doom-variable-pitch-font(font-spec:family"Hack Nerd Font Mono")
- doom-unicode-font(font-spec:family"Hack Nerd Font Mono":size12)
- doom-big-font(font-spec:family"Hack Nerd Font Mono":size19))
+
(setqdoom-font(font-spec:family"Hack Nerd Font Mono":size12:weight'semi-light)
+ doom-variable-pitch-font(font-spec:family"Hack Nerd Font Mono")
+ doom-unicode-font(font-spec:family"Hack Nerd Font Mono":size12)
+ doom-big-font(font-spec:family"Hack Nerd Font Mono":size19))
@@ -615,7 +615,7 @@ Make movement keys work like they should
Make horizontal movement cross lines
-
(setq-defaultevil-cross-lines t)
+
(setq-defaultevil-cross-lines t)
@@ -623,20 +623,20 @@ Make horizontal movement cross lines
Evil Surround (not working):
-
;; this macro was copied from here: https://stackoverflow.com/a/22418983/4921402
-(defmacrodefine-and-bind-quoted-text-object(name key start-regex end-regex)
- (let((inner-name (make-symbol(concat"evil-inner-" name)))
- (outer-name (make-symbol(concat"evil-a-" name))))
- `(progn
- (evil-define-text-object ,inner-name (count&optional beg end type)
- (evil-select-paren ,start-regex ,end-regex beg end type count nil))
- (evil-define-text-object ,outer-name (count&optional beg end type)
- (evil-select-paren ,start-regex ,end-regex beg end type count t))
- (define-keyevil-inner-text-objects-map ,key #',inner-name)
- (define-keyevil-outer-text-objects-map ,key #',outer-name))))
+
;; this macro was copied from here: https://stackoverflow.com/a/22418983/4921402
+ (defmacrodefine-and-bind-quoted-text-object(name key start-regex end-regex)
+ (let((inner-name (make-symbol(concat"evil-inner-" name)))
+ (outer-name (make-symbol(concat"evil-a-" name))))
+ `(progn
+ (evil-define-text-object ,inner-name (count&optional beg end type)
+ (evil-select-paren ,start-regex ,end-regex beg end type count nil))
+ (evil-define-text-object ,outer-name (count&optional beg end type)
+ (evil-select-paren ,start-regex ,end-regex beg end type count t))
+ (define-keyevil-inner-text-objects-map ,key #',inner-name)
+ (define-keyevil-outer-text-objects-map ,key #',outer-name))))
-;; Add dollar as a surround object
-(define-and-bind-quoted-text-object "dollar""$""\\$""\\$")
+ ;; Add dollar as a surround object
+ (define-and-bind-quoted-text-object "dollar""$""\\$""\\$")
@@ -830,17 +830,17 @@ This works also with C-x C-q
Ox-Hugo
-
(defuntdh-export-everything-to-hugo()
- "Export all the .org files in the specified directory to markdown using Hugo"
- (interactive)
- (setq org-files (directory-files(read-directory-name"Directory:""/home/thomas/Cloud/brain/") t "org$" t))
+
(defuntdh-export-everything-to-hugo()
+ "Export all the .org files in the specified directory to markdown using Hugo"
+ (interactive)
+ (setq org-files (directory-files(read-directory-name"Directory:""/home/thomas/Cloud/brain/") t "org$" t))
- (while org-files
- (setq current-org-file (car org-files))
- (message"Exporting %s" current-org-file)
- (find-file current-org-file)
- (org-hugo-export-to-md)
- (setq org-files (cdr org-files))))
+ (while org-files
+ (setq current-org-file (car org-files))
+ (message"Exporting %s" current-org-file)
+ (find-file current-org-file)
+ (org-hugo-export-to-md)
+ (setq org-files (cdr org-files))))
@@ -850,7 +850,7 @@ This works also with C-x C-q
Others
-
(setqauto-save-default t)
+
(setqauto-save-default t)
@@ -871,31 +871,31 @@ This works also with C-x C-q
(setqorg-directory"~/Cloud/org/")
+ (after! org
+ (setqorg-directory"~/Cloud/org/")
- ;; Replace the content marker, “⋯”, with a nice unicode arrow.
- (setqorg-ellipsis" ⤵")
+ ;; Replace the content marker, “⋯”, with a nice unicode arrow.
+ (setqorg-ellipsis" ⤵")
- (setqorg-default-notes-file"~/Cloud/org/refile.org")
+ (setqorg-default-notes-file"~/Cloud/org/refile.org")
- ;; Avoid accidentally editing folded regions, say by adding text after an Org “⋯”.
- (setqorg-catch-invisible-edits'show)
+ ;; Avoid accidentally editing folded regions, say by adding text after an Org “⋯”.
+ (setqorg-catch-invisible-edits'show)
- ;; The following setting hides blank lines between headings which keeps folded view nice and compact.
- (setqorg-cycle-separator-lines0)
+ ;; The following setting hides blank lines between headings which keeps folded view nice and compact.
+ (setqorg-cycle-separator-lines0)
- ;; Indent according to the outline structure
- (setqorg-startup-indented t)
- (setqorg-startup-folded t)
+ ;; Indent according to the outline structure
+ (setqorg-startup-indented t)
+ (setqorg-startup-folded t)
- ;; Record the information of when the task was marked as DONE
- (setqorg-log-done'time)
+ ;; Record the information of when the task was marked as DONE
+ (setqorg-log-done'time)
- ;; begining of line on heading behavior
- (setqorg-special-ctrl-a/e nil)
-)
+ ;; begining of line on heading behavior
+ (setqorg-special-ctrl-a/e nil)
+ )
@@ -903,8 +903,8 @@ This works also with C-x C-q
TAB was changed to toggle only the visibility state of the current subtree, rather than cycle through it recursively. This can be reversed with:
@@ -917,34 +917,34 @@ TAB was changed to toggle only the visibility state of the current subtree, rath
Display the real size of images and not the one set with attr_latex: :width \linewidth for instance.
(after! org
- ;; How many levels of headline to export
- (setqorg-export-headline-levels4)
+
(after! org
+ ;; How many levels of headline to export
+ (setqorg-export-headline-levels4)
- ;; Authorize BIND to set local variables
- (setqorg-export-allow-bind-keywords t)
+ ;; Authorize BIND to set local variables
+ (setqorg-export-allow-bind-keywords t)
- ;; Use doc instead of odt
- (setqorg-odt-preferred-output-format"doc")
- )
+ ;; Use doc instead of odt
+ (setqorg-odt-preferred-output-format"doc")
+ )
@@ -1381,15 +1381,15 @@ Basic configuration:
Some defaults:
(define-minor-modeunpackaged/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)))
+
(define-minor-modeunpackaged/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)))
-(defununpackaged/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))))
+ (defununpackaged/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))))
-(defununpackaged/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-string1 ,place)
- (match-string2 ,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)))
+ (defununpackaged/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-string1 ,place)
+ (match-string2 ,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)))
@@ -1601,47 +1601,47 @@ This is not working
Adapt this from https://github.com/alhassy/emacs.d to do something similar for source blocks.
-
(defunmy/org-drawer-format(name contents)
- "Export to HTML the drawers named with prefix ‘fold_’, ignoring case.
+
(defunmy/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’.
+ 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.
+ 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.
+ 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-string1 contents))))
+ 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-string1 contents))))
- ;; Ensure we have a title.
- (unless title′ (setq title′ (s-join" "(cdr(s-split"_" name)))))
+ ;; 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′))))))
+ ;; 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′))))))
-(setqorg-html-format-drawer-function'my/org-drawer-format)
+ (setqorg-html-format-drawer-function'my/org-drawer-format)
(use-package! org-noter
+ :defer t
+ :after(:any org pdf-view)
+ :config
+ (setqorg-noter-always-create-frame nil)
- (setqorg-noter-kill-frame-at-session-end nil)
+ (setqorg-noter-kill-frame-at-session-end nil)
- ;; Fraction of the frame that the document window will occupy when split
- (setqorg-noter-doc-split-fraction'(0.6 . 0.6))
+ ;; Fraction of the frame that the document window will occupy when split
+ (setqorg-noter-doc-split-fraction'(0.6 . 0.6))
- ;; Save the last visited location automatically; when starting a new session, go to that location
- (setqorg-noter-auto-save-last-location nil)
+ ;; Save the last visited location automatically; when starting a new session, go to that location
+ (setqorg-noter-auto-save-last-location nil)
- ;; Add an empty line between each note's heading and content
- (setqorg-noter-separate-notes-from-heading t)
+ ;; Add an empty line between each note's heading and content
+ (setqorg-noter-separate-notes-from-heading t)
- ;; List of paths to check (non recursively) when searching for a notes file
- (setqorg-noter-notes-search-path"~/Cloud/brain")
+ ;; List of paths to check (non recursively) when searching for a notes file
+ (setqorg-noter-notes-search-path"~/Cloud/brain")
- (defunorg-noter-init-pdf-view()
- (pdf-view-fit-page-to-window)
- (pdf-view-auto-slice-minor-mode)
- (run-at-time"0.5 sec" nil #'org-noter))
- (add-hook'pdf-view-mode-hook'org-noter-init-pdf-view)
+ (defunorg-noter-init-pdf-view()
+ (pdf-view-fit-page-to-window)
+ (pdf-view-auto-slice-minor-mode)
+ (run-at-time"0.5 sec" nil #'org-noter))
+ (add-hook'pdf-view-mode-hook'org-noter-init-pdf-view)
- (map!
- :mappdf-view-mode-map
- (:desc"Insert Note"
- :n"i"#'org-noter-insert-note))
- )
+ (map!
+ :mappdf-view-mode-map
+ (:desc"Insert Note"
+ :n"i"#'org-noter-insert-note))
+ )
(use-package! helm-bibtex
+ :after-call helm-bibtex
+ :init
+ :config
+ ;; Bibliography file
+ (setqbibtex-completion-bibliography'("~/Cloud/brain/biblio/references.bib"
+ "~/Cloud/acoustic/resources/acoustics.bib"))
- ;; Directory with all the pdfs
- (setqbibtex-completion-library-path"~/Cloud/pdfs/")
+ ;; Directory with all the pdfs
+ (setqbibtex-completion-library-path'("~/Cloud/pdfs/"
+ "~/Cloud/acoustic/resources/pdfs/"))
- ;; Directory with notes files
- (setqbibtex-completion-notes-path"~/Cloud/brain/")
+ ;; Directory with notes files
+ (setqbibtex-completion-notes-path"~/Cloud/brain/")
+ (setqbibtex-completion-notes-extension".org")
+ (setqbibtex-completion-pdf-extension'(".pdf"".djvu"))
- (setqbibtex-completion-notes-extension".org")
+ (setqbibtex-completion-additional-search-fields'(keywords))
- (setqbibtex-completion-pdf-extension'(".pdf"".djvu"))
+ ;; Use "keywords" field when looking for bib entries
+ (setqhelm-bibtex-additional-search-fields'(keywords))
- (setqbibtex-completion-additional-search-fields'(keywords))
+ (setqhelm-bibtex-full-frame nil)
- ;; Use "keywords" field when looking for bib entries
- (setqhelm-bibtex-additional-search-fields'(keywords))
+ ;; Display of bibtex entries with helm
+ (setqbibtex-completion-display-formats
+ '((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}")))
- (setqhelm-bibtex-full-frame nil)
+ ;; Special symbols for notes and pdf
+ (setqbibtex-completion-pdf-symbol"⌘")
+ (setqbibtex-completion-notes-symbol"✎")
- ;; Display of bibtex entries with helm
- (setqbibtex-completion-display-formats
- '((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}")))
+ ;; Template used when creating new Note file
+ (setqbibtex-completion-notes-template-multiple-files(concat"#+TITLE: ${title}\n"
+ "#+SETUPFILE: ./setup/org-setup-file.org\n"
+ "#+HUGO_SECTION: ${=type=}\n"
+ "#+ROAM_KEY: ${=key=}\n"
+ "\n"
+ "- Tags ::\n"
+ "- Reference :: cite:${=key=}\n"
+ "- Author(s) :: ${author}\n"
+ "- Year :: ${year}\n"
+ "\n"
+ "* ${author-abbrev} (${year}): ${title} :${=type=}:ignore:\n"
+ ":PROPERTIES:\n"
+ ":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n"
+ ":END:\n"
+ "\n"
+ "* Bibliography :ignore:\n"
+ "bibliography:./biblio/references.bib"
+ ))
- ;; Special symbols for notes and pdf
- (setqbibtex-completion-pdf-symbol"⌘")
- (setqbibtex-completion-notes-symbol"✎")
+ ;; 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-noteshelm-source-bibtex0)
- ;; Template used when creating new Note file
- (setqbibtex-completion-notes-template-multiple-files(concat"#+TITLE: ${title}\n"
- "#+SETUPFILE: ./setup/org-setup-file.org\n"
- "#+HUGO_SECTION: ${=type=}\n"
- "#+ROAM_KEY: ${=key=}\n"
- "\n"
- "- Tags ::\n"
- "- Reference :: cite:${=key=}\n"
- "- Author(s) :: ${author}\n"
- "- Year :: ${year}\n"
- "\n"
- "* ${author-abbrev} (${year}): ${title} :${=type=}:ignore:\n"
- ":PROPERTIES:\n"
- ":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n"
- ":END:\n"
- "\n"
- "* Bibliography :ignore:\n"
- "bibliography:./biblio/references.bib"
- ))
+ (helm-delete-action-from-source"Open PDF Externally"helm-source-bibtex)
+ (helm-add-action-to-source"Open PDF Externally"'tdh-open-pdf-externallyhelm-source-bibtex1)
- ;; 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-noteshelm-source-bibtex0)
+ (helm-add-action-to-source"Insert Link to Note"'tdh-insert-link-to-notehelm-source-bibtex2)
- (helm-delete-action-from-source"Open PDF Externally"helm-source-bibtex)
- (helm-add-action-to-source"Open PDF Externally"'tdh-open-pdf-externallyhelm-source-bibtex1)
-
- (helm-add-action-to-source"Insert Link to Note"'tdh-insert-link-to-notehelm-source-bibtex2)
-
- (helm-add-action-to-source"Insert E-Reader Link"'tdh-insert-link-to-pdf-entryhelm-source-bibtex3)
- )
+ (helm-add-action-to-source"Insert E-Reader Link"'tdh-insert-link-to-pdf-entryhelm-source-bibtex3)
+ )
-
(defuntdh-insert-link-to-pdf-entry(key)
- "Insert a link to a pdf associated with the bibtex entry."
- (let*
- ((entry (bibtex-completion-get-entry key))
- (title (bibtex-completion-get-value"title" entry)))
- (insert(concat"[[file:Download/" key ".pdf][" title "]] (cite:" key ")"))
- )
- )
+
(defuntdh-insert-link-to-pdf-entry(key)
+ "Insert a link to a pdf associated with the bibtex entry."
+ (let*
+ ((entry (bibtex-completion-get-entry key))
+ (title (bibtex-completion-get-value"title" entry)))
+ (insert(concat"[[file:Download/" key ".pdf][" title "]] (cite:" key ")"))
+ )
+ )
-
(defuntdh-insert-link-to-note(key)
- "Insert a link to a note associated with the bibtex entry."
- (if(andbibtex-completion-notes-path
- (f-directory?bibtex-completion-notes-path))
- (let*((path (f-joinbibtex-completion-notes-path
- (s-concat key bibtex-completion-notes-extension))))
- (if(file-exists-p path)
- (insert(concat"[[file:"(file-relative-name path)"][Notes]]"))
- (message"No note file associated"))
- )))
+
(defuntdh-insert-link-to-note(key)
+ "Insert a link to a note associated with the bibtex entry."
+ (if(andbibtex-completion-notes-path
+ (f-directory?bibtex-completion-notes-path))
+ (let*((path (f-joinbibtex-completion-notes-path
+ (s-concat key bibtex-completion-notes-extension))))
+ (if(file-exists-p path)
+ (insert(concat"[[file:"(file-relative-name path)"][Notes]]"))
+ (message"No note file associated"))
+ )))
@@ -3970,18 +3970,18 @@ Provides nice functions such as:
Beautify code
-
(defuntdh-matlab-beautify-buffer()
- "Beautify Current Matlab Buffer"
- (interactive)
- ;; First verifies is the current file is a Matlab file
- (if(string=(file-name-extension(buffer-file-name))"m")
- (progn
- (save-buffer)
- (matlab-shell-run-command(concat"MBeautify.formatFileNoEditor(\""(buffer-file-name)"\", \""(buffer-file-name)"\")"))
- (revert-buffer:ignore-auto:noconfirm))
- (message"Current buffer is not a matlab file")
- )
- )
+
(defuntdh-matlab-beautify-buffer()
+ "Beautify Current Matlab Buffer"
+ (interactive)
+ ;; First verifies is the current file is a Matlab file
+ (if(string=(file-name-extension(buffer-file-name))"m")
+ (progn
+ (save-buffer)
+ (matlab-shell-run-command (concat"MBeautify.formatFileNoEditor(\""(buffer-file-name)"\", \""(buffer-file-name)"\")"))
+ (revert-buffer:ignore-auto:noconfirm))
+ (message"Current buffer is not a matlab file")
+ )
+ )
@@ -3991,51 +3991,51 @@ Provides nice functions such as:
Key Bindings
-
(defuntdh-matlab-add-breakpoint()
- (interactive)
- (matlab-shell-run-command(concat"dbstop in "(buffer-name)" at "(number-to-string(line-number-at-pos nil)))))
+
(defuntdh-matlab-add-breakpoint()
+ (interactive)
+ (matlab-shell-run-command (concat"dbstop in "(buffer-name)" at "(number-to-string(line-number-at-pos nil)))))
-(defuntdh-matlab-remove-breakpoint()
- (interactive)
- (matlab-shell-run-command(concat"dbclear in "(buffer-name)" at "(number-to-string(line-number-at-pos nil)))))
+ (defuntdh-matlab-remove-breakpoint()
+ (interactive)
+ (matlab-shell-run-command (concat"dbclear in "(buffer-name)" at "(number-to-string(line-number-at-pos nil)))))
-(defuntdh-matlab-list-breakpoints()
- (interactive)
- (matlab-shell-run-command(concat"dbstatus "(buffer-name))))
+ (defuntdh-matlab-list-breakpoints()
+ (interactive)
+ (matlab-shell-run-command (concat"dbstatus "(buffer-name))))
-(defuntdh-matlab-clear-breakpoints()
- (interactive)
- (matlab-shell-run-command(concat"dbclear in "(buffer-name))))
+ (defuntdh-matlab-clear-breakpoints()
+ (interactive)
+ (matlab-shell-run-command (concat"dbclear in "(buffer-name))))
-(defuntdh-matlab-no-debug-on-error()
- (interactive)
- (matlab-shell-run-command(concat"dbclear if error")))
+ (defuntdh-matlab-no-debug-on-error()
+ (interactive)
+ (matlab-shell-run-command (concat"dbclear if error")))
-(defuntdh-matlab-debug-on-error()
- (interactive)
- (matlab-shell-run-command(concat"dbstop if error")))
+ (defuntdh-matlab-debug-on-error()
+ (interactive)
+ (matlab-shell-run-command (concat"dbstop if error")))
-(defuntdh-matlab-go-to-file-directory()
- (interactive)
- (matlab-shell-run-command(concat"cd "(file-name-directorybuffer-file-name))))
+ (defuntdh-matlab-go-to-file-directory()
+ (interactive)
+ (matlab-shell-run-command (concat"cd "(file-name-directorybuffer-file-name))))
@@ -4129,14 +4129,14 @@ Send math and source code:
This is a helper to help determine which account context I am in based on the folder in my maildir the email (eg. ~/.mail/nine27) is located in.
-
(defunmu4e-message-maildir-matches(msg rx)
- (when rx
- (if(listp rx)
- ;; If rx is a list, try each one for a match
- (or(mu4e-message-maildir-matches msg (car rx))
- (mu4e-message-maildir-matches msg (cdr rx)))
- ;; Not a list, check rx
- (string-match rx (mu4e-message-field msg :maildir)))))
+
(defunmu4e-message-maildir-matches(msg rx)
+ (when rx
+ (if(listp rx)
+ ;; If rx is a list, try each one for a match
+ (or(mu4e-message-maildir-matches msg (car rx))
+ (mu4e-message-maildir-matches msg (cdr rx)))
+ ;; Not a list, check rx
+ (string-match rx (mu4e-message-field msg :maildir)))))
@@ -4144,44 +4144,44 @@ This is a helper to help determine which account context I am in based on the fo
Choose account label to feed msmtp -a option based on From header in Message buffer; This function must be added to message-send-mail-hook for on-the-fly change of From address before sending message since message-send-mail-hook is processed right before sending message.
(use-package! mu4e
- :config
- (setqmail-user-agent'mu4e-user-agent
- mu4e-mu-binary"/usr/bin/mu"
- mu4e-maildir "~/.mail"
- mu4e-compose-format-flowed t
- mu4e-compose-in-new-frame nil
- mu4e-view-show-images t
- mu4e-html2text-command"w3m -dump -T text/html"
- mu4e-use-fancy-chars t
- mu4e-headers-include-related t
- mu4e-attachment-dir"~/Downloads"
- message-kill-buffer-on-exit t
- mu4e-compose-signature-auto-include t
- mu4e-view-show-images t
- mu4e-view-show-addresses t)
- )
+
(use-package! mu4e
+ :config
+ (setqmail-user-agent'mu4e-user-agent
+ mu4e-mu-binary"/usr/bin/mu"
+ mu4e-maildir "~/.mail"
+ mu4e-compose-format-flowed t
+ mu4e-compose-in-new-frame nil
+ mu4e-view-show-images t
+ mu4e-html2text-command"w3m -dump -T text/html"
+ mu4e-use-fancy-chars t
+ mu4e-headers-include-related t
+ mu4e-attachment-dir"~/Downloads"
+ message-kill-buffer-on-exit t
+ mu4e-compose-signature-auto-include t
+ mu4e-view-show-images t
+ mu4e-view-show-addresses t)
+ )
@@ -4191,26 +4191,26 @@ Choose account label to feed msmtp -a option based on From header in Message buf
Additional config
-
(use-package! mu4e
- :config
- ;; Use imagemagick, if available.
- (when(fboundp'imagemagick-register-types)
- (imagemagick-register-types))
+
(use-package! mu4e
+ :config
+ ;; Use imagemagick, if available.
+ (when(fboundp'imagemagick-register-types)
+ (imagemagick-register-types))
- ;; Sometimes html email is just not readable in a text based client, this lets me open the
- ;; email in my browser.
- (add-to-list'mu4e-view-actions'("View in browser" . mu4e-action-view-in-browser) t)
+ ;; Sometimes html email is just not readable in a text based client, this lets me open the
+ ;; email in my browser.
+ (add-to-list'mu4e-view-actions'("View in browser" . mu4e-action-view-in-browser) t)
- ;; Spell checking ftw.
- (add-hook'mu4e-compose-mode-hook'flyspell-mode)
+ ;; Spell checking ftw.
+ (add-hook'mu4e-compose-mode-hook'flyspell-mode)
- ;; Use Helm to select mailboxes
- (setqmu4e-completing-read-function'completing-read)
- ;; Don't ask for a 'context' upon opening mu4e
- (setqmu4e-context-policy'pick-first)
- ;; Don't ask to quit... why is this the default?
- (setqmu4e-confirm-quit nil)
- )
+ ;; Use Helm to select mailboxes
+ (setqmu4e-completing-read-function'completing-read)
+ ;; Don't ask for a 'context' upon opening mu4e
+ (setqmu4e-context-policy'pick-first)
+ ;; Don't ask to quit... why is this the default?
+ (setqmu4e-confirm-quit nil)
+ )
@@ -4220,17 +4220,17 @@ Choose account label to feed msmtp -a option based on From header in Message buf
(use-package! mu4e
+ :config
+ (setqmessage-send-mail-function'message-send-mail-with-sendmail
+ sendmail-program"/usr/bin/msmtp"
+ user-full-name"Thomas Dehaeze")
- ;; This prevents saving the email to the Sent folder since gmail will do this for us on their end.
- (setqmu4e-sent-messages-behavior'delete)
+ ;; This prevents saving the email to the Sent folder since gmail will do this for us on their end.
+ (setqmu4e-sent-messages-behavior'delete)
- ;; Use the correct account context when sending mail based on the from header.
- (setqmessage-sendmail-envelope-from'header)
- (add-hook'message-send-mail-hook'choose-msmtp-account)
- )
+ ;; Use the correct account context when sending mail based on the from header.
+ (setqmessage-sendmail-envelope-from'header)
+ (add-hook'message-send-mail-hook'choose-msmtp-account)
+ )
@@ -4321,16 +4321,16 @@ Choose account label to feed msmtp -a option based on From header in Message buf
(whennoninteractive
+ (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
+ (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
- deft
- hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
- hydra
- modeline
- ophints ; highlight the region an operation acts on
- (popup ; tame sudden yet inevitable temporary windows
- +all ; catch all popups that start with an asterix
- +defaults); default popup rules
- unicode ; extended unicode support for various languages
- vc-gutter ; vcs diff in the fringe
- vi-tilde-fringe ; fringe tildes to mark beyond EOB
- workspaces ; tab emulation, persistence & separate workspaces
- (emoji +unicode)
+ :ui
+ doom ; what makes DOOM look the way it does
+ deft
+ hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
+ hydra
+ modeline
+ ophints ; highlight the region an operation acts on
+ (popup ; tame sudden yet inevitable temporary windows
+ +all ; catch all popups that start with an asterix
+ +defaults); default popup rules
+ unicode ; extended unicode support for various languages
+ vc-gutter ; vcs diff in the fringe
+ vi-tilde-fringe ; fringe tildes to mark beyond EOB
+ workspaces ; tab emulation, persistence & separate workspaces
+ (emoji +unicode)
- :editor
- (evil +everywhere); come to the dark side, we have cookies
- fold ; (nigh) universal code folding
- rotate-text ; cycle region at point between text candidates
- snippets ; my elves. They type so I don't have to
- word-wrap; soft wrapping with language-aware indent
+ :editor
+ (evil +everywhere); come to the dark side, we have cookies
+ fold ; (nigh) universal code folding
+ rotate-text ; cycle region at point between text candidates
+ snippets ; my elves. They type so I don't have to
+ word-wrap; soft wrapping with language-aware indent
- :emacs
- (dired +icons); making dired pretty [functional]
- electric ; smarter, keyword-based electric-indent
- (ibuffer +icons); interactive buffer management
- vc ; version-control and Emacs, sitting in a tree
- undo
+ :emacs
+ (dired +icons); making dired pretty [functional]
+ electric ; smarter, keyword-based electric-indent
+ (ibuffer +icons); interactive buffer management
+ vc ; version-control and Emacs, sitting in a tree
+ undo
- :term
- eshell ; a consistent, cross-platform shell (WIP)
- vterm
+ :term
+ eshell ; a consistent, cross-platform shell (WIP)
+ vterm
- :tools
- 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
- lsp
- magit ; a git porcelain for Emacs
- docker
- ;;pass ; password manager for nerds
- pdf ; pdf enhancements
- eval
- biblio
- (lookup +dictionary)
+ :tools
+ 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
+ lsp
+ magit ; a git porcelain for Emacs
+ docker
+ ;;pass ; password manager for nerds
+ pdf ; pdf enhancements
+ eval
+ biblio
+ (lookup +dictionary)
- :checkers
- syntax ; tasing you for every semicolon you forget
- spell ; tasing you for misspelling mispelling
+ :checkers
+ syntax ; tasing you for every semicolon you forget
+ spell ; tasing you for misspelling mispelling
- :lang
- data ; config/data formats
- emacs-lisp ; drown in parentheses
- go
- (javascript
- +lsp)
- (latex
- +latexmk
- +lsp)
- ;; 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
- +roam ;
- +present); using org-mode for presentations
- python ; beautiful is better than ugly
- (sh ; she sells {ba,z,fi}sh shells on the C xor
- +lsp)
- (web
- +lsp)
- yaml
+ :lang
+ data ; config/data formats
+ emacs-lisp ; drown in parentheses
+ go
+ (javascript
+ +lsp)
+ (latex
+ +latexmk
+ +lsp)
+ ;; 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
+ +roam ;
+ +present); using org-mode for presentations
+ python ; beautiful is better than ugly
+ (sh ; she sells {ba,z,fi}sh shells on the C xor
+ +lsp)
+ (web
+ +lsp)
+ yaml
- :email
- (mu4e +gmail)
+ :email
+ (mu4e +gmail)
- :app
- calendar
- ;;(rss +org) ; emacs as an RSS reader
- ;;write ; emacs for writers (fiction, notes, papers, etc.)
+ :app
+ calendar
+ ;;(rss +org) ; emacs as an RSS reader
+ ;;write ; emacs for writers (fiction, notes, papers, etc.)
- :config
- literate
- (default +bindings)
- )
+ :config
+ literate
+ (default +bindings)
+ )
@@ -4445,103 +4445,103 @@ Choose account label to feed msmtp -a option based on From header in Message buf
Doom packages.el
-
;; Vimrc
-(package! vimrc-mode)
+
;; Vimrc
+ (package! vimrc-mode)
-
;; Automatic toggling of LaTeX fragments
-(package! org-fragtog)
+
;; Automatic toggling of LaTeX fragments
+ (package! org-fragtog)
-
;; custom blocks and links for org-mode
-(package! org-special-block-extras)
+
;; custom blocks and links for org-mode
+ (package! org-special-block-extras)
-Note: GNOME users, and by extension any gnome-keyring user may have to follow the instructions at the end of the previous section on enabling autologin.
-
-Use sudo -A, that will open a rofi prompt to ask for the password.
+To be able to run sudo commands with rofi (github issue), the command sudo -A can be used: it opens a rofi prompt to ask for the password.
For that to work, we need to add the following code to ~/.profile:
-
exportSUDO_ASKPASS=~/.local/bin/askpass-rofi
+
exportSUDO_ASKPASS=~/.local/bin/askpass-rofi
@@ -1211,130 +843,68 @@ For that to work, we need to add the following code to ~/.profile:
The askpass script is:
-
#!/bin/sh
+
#!/bin/sh
-# Take password prompt from STDIN, print password to STDOUT
-# the sed piece just removes the colon from the provided
-# prompt: rofi -p already gives us a colon
-rofi -dmenu \
- -password \
- -no-fixed-num-lines \
- -p "$(printf "$1" | sed s/://)"
+ rofi -dmenu \
+ -password \
+ -no-fixed-num-lines \
+ -p "$(printf "$1" | sed s/://)"
First, add the relation between repository addresses and entries in pass. This is done in the following config file .config/pass-git-helper/git-pass-mapping.ini:
@@ -1354,8 +924,6 @@ Then, add the credential helper on the git configuration file ~/.gitconfig
username = tdehaeze
-
-
Integration with other programs
@@ -1383,53 +951,53 @@ Integrate pass in other programs is usually very easy, here are few examples:
Bitwarden https://github.com/bitwarden/cli
The main config is located here: ~/.ncmpcpp/config.
The key bindings can be configured here: ~/.ncmpcpp/bindings.
@@ -1875,61 +1385,25 @@ The key bindings can be configured here: ~/.ncmpcpp/bindings.
/set plugins.var.perl.multiline.magic_paste_only on
-/key bind meta-ctrl-M /input insert \x0a
+
/set plugins.var.perl.multiline.magic_paste_only on
+ /key bind meta-ctrl-M /input insert \x0a
@@ -2377,7 +1805,7 @@ Then alt-enter is bound to insert a new line:
And enter is bound to magic_enter that directly sends the message if its one line, and if its multiple line, waits a little bit and then sends the message:
mkdir -p ~/.weechat/python/autoload
+ cd ~/.weechat/python/autoload
+ wget https://raw.githubusercontent.com/keith/edit-weechat/master/edit.py
@@ -2402,9 +1830,9 @@ Then, on weechat, type /edit.
-
-
CheatSheet
-
+
+
CheatSheet
+
@@ -2452,19 +1880,19 @@ Then, on weechat, type /edit.
-
-
Installation
-
+
+
Installation
+
-
yay -S python2-websocket-client
+
yay -S python2-websocket-client
-
cd ~/.weechat/python
-wget https://raw.githubusercontent.com/wee-slack/wee-slack/master/wee_slack.py
-ln -s ../wee_slack.py autoload
+
cd ~/.weechat/python
+ wget https://raw.githubusercontent.com/wee-slack/wee-slack/master/wee_slack.py
+ ln -s ../wee_slack.py autoload
@@ -2477,7 +1905,7 @@ wget https://raw.githubusercontent.com/wee-slack/wee-slack/master/wee_slack.py
Log in to Slack:
-
/slack register
+
/slack register
@@ -2485,7 +1913,7 @@ This command prints a link you should open in your browser to authorize WeeChat
-
/slack register [CODE_FROM_URL]
+
/slack register [CODE_FROM_URL]
@@ -2493,7 +1921,7 @@ This command prints a link you should open in your browser to authorize WeeChat
Your Slack team is now added, and you can complete setup by restarting the wee-slack script.
-
/python reload slack
+
/python reload slack
@@ -2501,9 +1929,9 @@ Your Slack team is now added, and you can complete setup by restarting the wee-s
If you don’t want to store your API token in plaintext you can use the secure features of weechat:
-
/secure passphrase this is a super secret password
-/secure set slack_token [YOUR_SLACK_TOKEN]
-/set plugins.var.python.slack.slack_api_token ${sec.data.slack_token}
+
/secure passphrase this is a super secret password
+ /secure set slack_token [YOUR_SLACK_TOKEN]
+ /set plugins.var.python.slack.slack_api_token ${sec.data.slack_token}
@@ -2539,15 +1967,15 @@ It runs weechat inside tmux.
-Gtk2 themes are managed using the file ~/.gtkrc-2.0 while Gtk3 themes are managed using ~/.config/gtk-3.0/settings.ini.
+Bluetooth manager: https://github.com/blueman-project/blueman
-
-
-
-
Gui Manager
-
-
-To customize the look of the system using GUI application, run lxappearance.
-
-
-
-Installation:
-
-
-
yay -S lxappearance
-
-
-
-
-
-
-
Icons and themes
-
-
-
yay -S zukitwo-themes faenza-icon-theme
-
-
-
yay -S arc-gtk-theme
-
-
-
-
-
-
-
-
QT Themes
-
-
-Run qt5ct to manage QT Themes.
-
-
-
-
-
-
XFT Themes
-
-
-Some configuration are located in ~/.Xresources.
-