Skip to content

Instantly share code, notes, and snippets.

@bdarcus
bdarcus / nvimup
Last active February 11, 2023 15:23
simple shell script to update nvim on linux
#!/usr/bin/env bash
# https://m0wer.github.io/memento/computer_science/gnu_linux/neovim/
curl -sSL "https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz" | \
tar -C "${HOME}/.local" -xz --strip-components=1 -f -
# doesn't appears this updates much, and not tied to nvim releases, so maybe remove?
pip install --upgrade pynvim
@bdarcus
bdarcus / .emacs
Last active October 3, 2022 11:54 — forked from DogLooksGood/.emacs
Meow dot emacs
(require 'package)
(package-initialize)
(setq package-selected-packages
'(modus-themes
vertico
meow
corfu
consult
orderless
(defun org-ref-to-org-cite ()
"Attempt to convert org-ref citations to org-cite syntax."
; adapted from https://tecosaur.github.io/emacs-config/config.html#citation,code--4
(interactive)
(let* ((cite-conversions '(("cite" . "//b") ("Cite" . "//bc")
("nocite" . "/n")
("citep" . "") ("citep*" . "//f")
("parencite" . "") ("Parencite" . "//c")
("citeauthor" . "/a/f") ("citeauthor*" . "/a")
("citeyear" . "/na/b")
(require 'oc-biblatex)
(defcustom style-select-latex-commands t
"Whether to use latex commands for style selection."
:group 'style
:type '(boolean))
(defun style-latex-alist (&optional swap)
"Return org-cite-biblatex-styles as alist.
By default, each car is the latex command, and the cdr the
@bdarcus
bdarcus / latex-style.el
Last active April 20, 2022 12:52
experiment with an org-cite style select UI that optionally presents biblatex commands for completion instead
;; (org-cite-parse-objects "[cite:@doe]")
(require 'oc-biblatex)
(defcustom style-ui 'csl
"Style select UI; each with a preview."
:type '(choice (const :tag "CSL output" 'csl)
(const :tag "biblatex commands" 'biblatex)
(const :tag "natbib commands" 'natbib)))
(require 'citar)
(defvar bibtex-note-org-property "Key"
"The org-mode property which BibTeX keys are attached to")
(defun get-first-citar-notes-path ()
"Return 'citar-notes-paths' if it is a string, or its car
if it is a list (as 'citar' normally expects)"
(cond ((stringp citar-notes-paths) citar-notes-paths)
((listp citar-notes-paths) (car citar-notes-paths))
@bdarcus
bdarcus / csl-recipe.yaml
Last active December 6, 2021 19:12
possible csl recipe format more distributed style development?
title: The ABC Journal Style
fields: [foo, bar]
repo: foo/style
url: htps://xyz.org/jabc.csl
@bdarcus
bdarcus / citar-hydra.el
Last active December 21, 2022 15:04
how to create a hydra for use with citar, and org-cite "follow processor" that uses it
;;; citar-hydra.el --- hydra menu for citar -*- lexical-binding: t; -*-
(require 'org-element)
(require 'pretty-hydra)
(require 'oc)
(require 'citar)
(require 'citar-org)
(declare-function 'org-cite-register-processor "ext:oc")
(declare-function 'citar--library-file-action "ext:citar")
(declare-function 'citar-open-note "ext:citar")
@bdarcus
bdarcus / academic.el
Created November 29, 2021 01:13 — forked from rka97/academic.el
Configuration I use in Doom Emacs as part of my academic reading/notetaking workflow
;; The following packages are needed:
;; 1. elfeed and elfeed-score (available from the rss doom module)
;; 2. citar
;; 3. org-ref
;; 4. org-roam and org-roam-bibtex
(defconst robo/bib-libraries (list "~/bib-lib/robo-lib.bib" "~/bib-lib/robo-temp-lib.bib")) ; All of my bib databases.
(defconst robo/main-bib-library (nth 0 robo/bib-libraries)) ; The main db is always the first
(defconst robo/main-pdfs-library-paths `("~/bib-lib/pdfs/" "/home/robo/bib-lib/temp-pdfs/")) ; PDFs directories in a list
;;; citar-menu.el --- transient example for citar -*- lexical-binding: t; -*-
;;
;;; Code:
(require 'org-element)
(require 'transient)
(require 'citar)
(require 'citar-org)