feat[lsp,org,cite]: Added better citation icons

I added some snazzy icons to citar.
Corrected several org-latex classes to avoid hyperlink highlights.
Added (potentially) better LSP settings with syntax flags
This commit is contained in:
Judah Sotomayor 2023-10-30 13:07:22 -04:00
parent 0073afd67f
commit f5caccd7f7
Signed by: judahsotomayor
SSH Key Fingerprint: SHA256:9Dq4ppxhfAjbX+7HLXEt+ROMiIojI6kqQgUyFUJb9lI
3 changed files with 121 additions and 31 deletions

View File

@ -15,10 +15,6 @@
(setq fancy-splash-image (concat doom-private-dir "emacs.png"))
(map! :desc "Switch to normal mode" :i "C-c" #'evil-normal-state)
(use-package! noCtrlC
:after org-mode)
(setq org-pretty-entities 0)
(defun bash ()
(interactive)
@ -579,8 +575,6 @@ If nil it defaults to `split-string-default-separators', normally
(citar-file-note-extensions '(".org"))
(org-cite-global-bibliography '("~/org/references.bib"))
(org-cite-csl-styles-dir
(expand-file-name "~/Zotero/styles/"))
(org-cite-export-processors
@ -589,15 +583,61 @@ If nil it defaults to `split-string-default-separators', normally
:hook
(LaTeX-mode . citar-capf-setup)
(org-mode . citar-capf-setup))
(after! org-mode
(org-cite-global-bibliography '("~/org/references.bib"))
)
(citar-org-roam-mode)
(after! citar
(setq citar-indicator-files-icons
(citar-indicator-create
:symbol (nerd-icons-faicon
"nf-fa-file_o"
:face 'nerd-icons-green
:v-adjust -0.1)
:function #'citar-has-files
:padding " " ; need this because the default padding is too low for these icons
:tag "has:files"))
(setq citar-indicator-links-icons
(citar-indicator-create
:symbol (nerd-icons-faicon
"nf-fa-link"
:face 'nerd-icons-orange
:v-adjust 0.01)
:function #'citar-has-links
:padding " "
:tag "has:links"))
(setq citar-indicator-notes-icons
(citar-indicator-create
:symbol (nerd-icons-codicon
"nf-cod-note"
:face 'nerd-icons-blue
:v-adjust -0.3)
:function #'citar-has-notes
:padding " "
:tag "has:notes"))
(setq citar-indicator-cited-icons
(citar-indicator-create
:symbol (nerd-icons-faicon
"nf-fa-circle_o"
:face 'nerd-icon-green)
:function #'citar-is-cited
:padding " "
:tag "is:cited"))
(setq citar-indicators
(list citar-indicator-files-icons
citar-indicator-links-icons
citar-indicator-notes-icons
citar-indicator-cited-icons)))
(add-to-list 'org-latex-classes
'("student-apa7"
"\\documentclass[stu]{apa7}"
"\\documentclass[stu]{apa7}
\\hypersetup{hidelinks}
\\usepackage{times}
[NO-DEFAULT-PACKAGES]
[NO-PACKAGES]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
@ -618,7 +658,9 @@ If nil it defaults to `split-string-default-separators', normally
(add-to-list 'org-latex-classes
'("student-mla"
"\\documentclass[stu]{mla}"
"\\documentclass[stu]{mla}
\\hypersetup{hidelinks}
\\usepackage{times} "
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")

View File

@ -45,13 +45,8 @@ Set a sweet splash image
I want a non-ESC way to get back to normal mode:
#+BEGIN_SRC emacs-lisp
(map! :desc "Switch to normal mode" :i "C-c" #'evil-normal-state)
(use-package! noCtrlC
:after org-mode)
#+END_SRC
#+BEGIN_SRC emacs-lisp
(setq org-pretty-entities 0)
#+END_SRC
* Terminal setup
I like to just use bash:
#+BEGIN_SRC emacs-lisp
@ -785,8 +780,11 @@ We'll want a handy shortcut for this.
: /home/user/.config/doom/
** Automatic Citations with *citar* and *org-cite*
Citar is a sweet little package for managing citations. Right here we'll set it up
We want a general bibliography file, a styles directory, and a default set of styles.
Citar is a sweet little package for managing citations.
We want a general [[file:~/org/references.bib][bibliography file]], a [[file:~/Zotero/styles/][styles directory]],
and a default set of styles.
*** Citar setup
First of all, we must configure citar.
#+BEGIN_SRC emacs-lisp
(use-package! citar
:ensure t
@ -796,8 +794,6 @@ We want a general bibliography file, a styles directory, and a default set of st
(citar-file-note-extensions '(".org"))
(org-cite-global-bibliography '("~/org/references.bib"))
(org-cite-csl-styles-dir
(expand-file-name "~/Zotero/styles/"))
(org-cite-export-processors
@ -806,20 +802,70 @@ We want a general bibliography file, a styles directory, and a default set of st
:hook
(LaTeX-mode . citar-capf-setup)
(org-mode . citar-capf-setup))
(after! org-mode
(org-cite-global-bibliography '("~/org/references.bib"))
)
(citar-org-roam-mode)
#+END_SRC
*** Icons for some prettification
#+BEGIN_SRC emacs-lisp
(after! citar
(setq citar-indicator-files-icons
(citar-indicator-create
:symbol (nerd-icons-faicon
"nf-fa-file_o"
:face 'nerd-icons-green
:v-adjust -0.1)
:function #'citar-has-files
:padding " " ; need this because the default padding is too low for these icons
:tag "has:files"))
(setq citar-indicator-links-icons
(citar-indicator-create
:symbol (nerd-icons-faicon
"nf-fa-link"
:face 'nerd-icons-orange
:v-adjust 0.01)
:function #'citar-has-links
:padding " "
:tag "has:links"))
(setq citar-indicator-notes-icons
(citar-indicator-create
:symbol (nerd-icons-codicon
"nf-cod-note"
:face 'nerd-icons-blue
:v-adjust -0.3)
:function #'citar-has-notes
:padding " "
:tag "has:notes"))
(setq citar-indicator-cited-icons
(citar-indicator-create
:symbol (nerd-icons-faicon
"nf-fa-circle_o"
:face 'nerd-icon-green)
:function #'citar-is-cited
:padding " "
:tag "is:cited"))
(setq citar-indicators
(list citar-indicator-files-icons
citar-indicator-links-icons
citar-indicator-notes-icons
citar-indicator-cited-icons)))
#+END_SRC
** Scholarly Writing Environment with Org-mode
I like to keep formatting simple.
Let's use a package or two to set a decent document class:
#+BEGIN_SRC emacs-lisp
(add-to-list 'org-latex-classes
'("student-apa7"
"\\documentclass[stu]{apa7}"
"\\documentclass[stu]{apa7}
\\hypersetup{hidelinks}
\\usepackage{times}
[NO-DEFAULT-PACKAGES]
[NO-PACKAGES]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
@ -840,7 +886,9 @@ Let's use a package or two to set a decent document class:
(add-to-list 'org-latex-classes
'("student-mla"
"\\documentclass[stu]{mla}"
"\\documentclass[stu]{mla}
\\hypersetup{hidelinks}
\\usepackage{times} "
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")

View File

@ -80,13 +80,13 @@
;;vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
(syntax +flymake +childframe) ; tasing you for every semicolon you forget
(spell +flyspell +everywhere) ; tasing you for misspelling mispelling
grammar ; tasing grammar mistake every you make
:tools
;;ansible
biblio ; Writes a PhD for you (citation needed)
(biblio +icons) ; Writes a PhD for you (citation needed)
;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv
;;docker
@ -153,7 +153,7 @@
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org +roam2 +gnuplot +hugo +pomodoro +noter) ; organize your plain life in plain text
(org +roam2 +gnuplot +hugo +pomodoro +noter +present +pretty) ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional