Update editor config and add new config packages

This commit is contained in:
Gabriel Arazas 2021-05-03 11:38:31 +08:00
parent 1f1a2817c2
commit c298c621c9
7 changed files with 109 additions and 166 deletions

View File

@ -9,26 +9,11 @@
(setq user-full-name "Gabriel Arazas" (setq user-full-name "Gabriel Arazas"
user-mail-address "foo.dogsquared@gmail.com") user-mail-address "foo.dogsquared@gmail.com")
;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
;; are the three important ones:
;;
;; + `doom-font'
;; + `doom-variable-pitch-font'
;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;;
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
;; font string. You generally only need these two:
(setq doom-font (font-spec :family "Iosevka" :size 16) (setq doom-font (font-spec :family "Iosevka" :size 16)
doom-serif-font (font-spec :family "Source Serif Pro")) doom-serif-font (font-spec :family "Source Serif Pro"))
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'doom-nord) (setq doom-theme 'doom-nord)
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/writings/orgnotes" (setq org-directory "~/writings/orgnotes"
org-roam-directory "~/writings/wiki") org-roam-directory "~/writings/wiki")
@ -57,12 +42,7 @@
;; Search the project path with Projectile. ;; Search the project path with Projectile.
(setq projectile-project-search-path '("~/projects/software/" "~/writings/")) (setq projectile-project-search-path '("~/projects/software/" "~/writings/"))
; Set the TeX engine to LuaTeX.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; CUSTOM PACKAGES CONFIGURATIONS ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Set the TeX engine to LuaTeX.
(after! tex (after! tex
(TeX-engine-set "luatex") (TeX-engine-set "luatex")
(add-to-list 'safe-local-variable-values (add-to-list 'safe-local-variable-values
@ -91,60 +71,81 @@
; Configure org-roam. ; Configure org-roam.
org-roam-capture-templates '( org-roam-capture-templates '(
("p" "permanent" plain ("p" "permanent" plain
#'org-roam-capture--get-point #'org-roam-capture--get-point "%?"
"#+date: \"%<%Y-%m-%d %T %:z>\" :file-name "%<%Y-%m-%d-%H-%M-%S>"
:head "#+title: ${title}
#+date: \"%<%Y-%m-%d %T %:z>\"
#+date_modified: \"%<%Y-%m-%d %T %:z>\"
#+language: en"
:unnarrowed t)
("c" "cards" plain
#'org-roam-capture--get-point "%?"
:head "#+title: Anki: ${title}
#+date: \"%<%Y-%m-%d %T %:z>\"
#+date_modified: \"%<%Y-%m-%d %T %:z>\" #+date_modified: \"%<%Y-%m-%d %T %:z>\"
#+language: en #+language: en
#+property: anki_deck ${title}"
%?" :file-name "cards/${slug}"
:file-name "%<%Y-%m-%d-%H-%M-%S>"
:head "#+title: ${title}\n"
:unnarrowed t) :unnarrowed t)
("l" "literature" plain ("l" "literature" plain
#'org-roam-capture--get-point #'org-roam-capture--get-point "%?"
"#+date: \"%<%Y-%m-%d %T %:z>\" :head "#+title: ${title}
#+date: \"%<%Y-%m-%d %T %:z>\"
#+date_modified: \"%<%Y-%m-%d %T %:z>\" #+date_modified: \"%<%Y-%m-%d %T %:z>\"
#+language: en #+language: en"
%?"
:file-name "literature/%<%Y-%m-%d-%H-%M-%S>" :file-name "literature/%<%Y-%m-%d-%H-%M-%S>"
:head "#+title: ${title}\n") :unnarrowed t)
("d" "dailies" entry ("d" "dailies" entry
#'org-roam-capture--get-point #'org-roam-capture--get-point "%?"
"* %?"
:file-name "daily/%<%Y-%m-%d>" :file-name "daily/%<%Y-%m-%d>"
:head "#+title %<%Y-%m-%d>" :head "#+title %<%Y-%m-%d>"))
:olp ("Study notes" "Random")))
; Get the tags from vanilla and Roam-specific properties. ;; Get the tags from vanilla and Roam-specific properties.
org-roam-tag-sources '(prop vanilla)) org-roam-tag-sources '(prop vanilla))
(add-to-list 'org-modules 'org-checklist)) (add-to-list 'org-modules 'org-checklist))
;; Custom keybindings
(map!
(:when (featurep! :editor format)
:n "g=" #'+format/buffer)
(:when (featurep! :lang org +roam)
(:map org-roam-mode-map
:leader
:prefix "nr"
:desc "Find a random Org-roam note" "R" #'org-roam-random-note)))
(setq (setq
; Modify the time-stamp with each save. ;; Modify the time-stamp with each save.
time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %:z" time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %:z"
; Set file templates folder at $DOOMDIR/templates. ;; Set file templates folder at $DOOMDIR/templates.
+file-templates-dir (expand-file-name "templates/" doom-private-dir) +file-templates-dir (expand-file-name "templates/" doom-private-dir)
; Set the journal. ;; Set the journal.
org-journal-dir "~/writings/journal" org-journal-dir "~/writings/journal"
org-journal-file-format "%F" org-journal-file-format "%F"
enable-local-variables "query" enable-local-variables "query"
) )
; A workaround for electric-indent plugin. (defun align-non-space (BEG END)
; See https://github.com/hlissner/doom-emacs/issues/3172 for more details. "Align non-space columns in region BEG END."
(interactive "r")
(align-regexp BEG END "\\(\\s-*\\)\\S-+" 1 1 t))
;; A workaround for electric-indent plugin.
;; See https://github.com/hlissner/doom-emacs/issues/3172 for more details.
(add-hook 'org-mode (lambda () (add-hook 'org-mode (lambda ()
(electric-indent-local-mode -1))) (electric-indent-local-mode -1)))
; Automate updating timestamps on save. ;; Automate updating timestamps on save.
(add-hook! 'before-save-hook 'time-stamp) (add-hook! 'before-save-hook 'time-stamp)
; Set up Anki editor ;; Set up Anki editor
(use-package! anki-editor (use-package! anki-editor
:hook (org-mode . anki-editor-mode) :hook (org-mode . anki-editor-mode)
:config :config
@ -153,9 +154,9 @@
:map org-mode-map :map org-mode-map
(:prefix ("C" . "Anki cards") (:prefix ("C" . "Anki cards")
"p" #'anki-editor-push-notes "p" #'anki-editor-push-notes
"P" #'anki-editor-retry-failure-notes "r" #'anki-editor-retry-failure-notes
"i" #'anki-editor-insert-note "i" #'anki-editor-insert-note
"d" #'anki-editor-cloze-region "I" #'anki-editor-cloze-region
"e" #'anki-editor-export-subtree-to-html))) "e" #'anki-editor-export-subtree-to-html)))
;;; config.el ends here ;;; config.el ends here

View File

@ -1,81 +0,0 @@
;;; tools/neuron/config.el -*- lexical-binding: t; -*-
(defface neuron-stub-face
'((((class color) (min-colors 88) (background dark)) :foreground "#C16069" :underline "#C16069")
(((class color) (min-colors 88) (background light)) :foreground "#C16069" :underline "#C16069")
(((class color) :foreground "Red" :underline "Red"))
(t :inherit neuron-title-overlay-face))
"Face for stub links."
:group 'neuron-faces)
(customize-set-variable 'neuron-default-zettelkasten-directory (expand-file-name "~/zettelkasten"))
(customize-set-variable 'neuron-default-tags (list "stub"))
(customize-set-variable 'neuron-tag-specific-title-faces '(("stub" neuron-stub-face)))
(defun search-zettelkasten ()
"Search zettels by content."
(interactive)
(progn
(+ivy-file-search :in (neuron-zettelkasten) :recursive nil :prompt "Search Zettelkasten: ")
(neuron-mode)))
(defun find-file-in-zettelkasten ()
"Find a file in the currently active zettelkasten."
(interactive)
(let ((default-directory (neuron-zettelkasten)))
(counsel-find-file)))
(use-package! neuron-mode
; Enable link autocompletion globally
:hook (neuron-mode . company-neuron-setup)
:config
(map! :leader
(:prefix ("z" . "zettel")
"z" #'neuron-new-zettel
"e" #'neuron-edit-zettel
"w" #'neuron-rib-watch
"g" #'neuron-rib-generate
"o" #'neuron-open-zettel
"O" #'neuron-open-index
"j" #'neuron-open-daily-notes
"t" #'neuron-query-tags
"r" #'neuron-refresh
"c" #'neuron-edit-zettelkasten-configuration
;;; Alternatively, bind all rib commands in a separate prefix
;; (:prefix ("r" . "rib")
;; "w" #'neuron-rib-watch
;; "g" #'neuron-rib-generate
;; "s" #'neuron-rib-serve
;; "o" #'neuron-rib-open-zettel
;; "z" #'neuron-rib-open-z-index
;; "k" #'neuron-rib-kill
;; )
)
)
(map! :map neuron-mode-map
:localleader
;; Override markdown-mode's default behavior to handle neuron links
:ni "o" #'neuron-follow-thing-at-point
;; You can also remove the "z" prefix but
;; be careful not to override default
;; markdown-mode bindings.
(:prefix ("z" . "zettel")
:ni "u" #'neuron-edit-uplink
:ni "t" #'neuron-add-tag
:ni "T" #'neuron-add-tags
:ni "o" #'neuron-open-current-zettel
:ni "l" #'neuron-create-and-insert-zettel-link
:v "L" #'neuron-create-zettel-from-selection
:ni "s" #'neuron-insert-static-link
:ni "c" #'neuron-toggle-connection-type
)
)
(map! :leader "sz" #'search-zettelkasten)
(map! :leader "fz" #'find-file-in-zettelkasten)

View File

@ -1,8 +0,0 @@
;; -*- no-byte-compile: t; -*-
;;; tools/neuron/packages.el
(package! neuron-mode)
;; For more reproducibility, pin the repo:
;; (package! neuron-mode :pin e1b3e12c71)
;; or run M-x doom/update-pinned-package-form to have the latest commit

23
mpd/mpd.conf Normal file
View File

@ -0,0 +1,23 @@
# Recommended location for database
db_file "~/.config/mpd/database"
# Logs to systemd journal
log_file "syslog"
# The music directory is by default the XDG directory, uncomment to amend and choose a different directory
music_directory "~/library/music"
# Uncomment to refresh the database whenever files in the music_directory are changed
auto_update "yes"
audio_output {
type "pulse"
name "pulse audio"
}
# Uncomment to enable the functionalities
playlist_directory "~/.config/mpd/playlists"
#pid_file "~/.config/mpd/pid"
#state_file "~/.config/mpd/state"
#sticker_file "~/.config/mpd/sticker.sql"

View File

@ -1,7 +1,7 @@
# Config copied from Luke Smith's because I'm unoriginal. # Config copied from Luke Smith's because I'm unoriginal.
auto-reload yes auto-reload yes
browser "nohup brave --new-tab %u &>/dev/null &" browser "nohup brave --new-tab %u &>/dev/null &"
macro m set browser "mpv %u"; open-in-browser ; set browser "brave %u" macro m set browser "mpv %u"; one ; set browser brave
bind-key ; cmdline bind-key ; cmdline
bind-key SPACE next-unread bind-key SPACE next-unread
@ -26,3 +26,5 @@ bind-key r reload-all
bind-key R reload bind-key R reload
reload-threads 50 reload-threads 50
datetime-format "%F"

View File

@ -23,6 +23,9 @@ Plug 'lilydjwg/colorizer'
" One of the must-haves for me. " One of the must-haves for me.
Plug 'sirver/ultisnips' Plug 'sirver/ultisnips'
" Text editor integration for the browser
Plug 'subnut/nvim-ghost.nvim', {'do': ':call nvim_ghost#installer#install()'}
" Setting my private snippets in a consistent home directory and a relative snippets directory for project-specific snippets. " Setting my private snippets in a consistent home directory and a relative snippets directory for project-specific snippets.
let g:UltiSnipsSnippetDirectories = [$HOME . "/.config/nvim/own-snippets", ".snippets"] let g:UltiSnipsSnippetDirectories = [$HOME . "/.config/nvim/own-snippets", ".snippets"]
let g:UltiSnipsExpandTrigger="<tab>" let g:UltiSnipsExpandTrigger="<tab>"
@ -54,7 +57,7 @@ if !exists('g:airline_symbols')
let g:airline_symbols = {} let g:airline_symbols = {}
endif endif
" fzf " Fuzzy finder for finding files freely and fastly.
Plug 'junegunn/fzf' Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'

3
youtube-dl/config Normal file
View File

@ -0,0 +1,3 @@
--output '%(title)s.%(ext)s'
--no-overwrite