From c298c621c905bc47fe3e23b437e571c3089aa970 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 3 May 2021 11:38:31 +0800 Subject: [PATCH] Update editor config and add new config packages --- emacs/config.el | 151 +++++++++++++------------ emacs/modules/tools/neuron/config.el | 81 ------------- emacs/modules/tools/neuron/packages.el | 8 -- mpd/mpd.conf | 23 ++++ newsboat/config | 4 +- nvim/init.vim | 5 +- youtube-dl/config | 3 + 7 files changed, 109 insertions(+), 166 deletions(-) delete mode 100755 emacs/modules/tools/neuron/config.el delete mode 100755 emacs/modules/tools/neuron/packages.el create mode 100644 mpd/mpd.conf create mode 100644 youtube-dl/config diff --git a/emacs/config.el b/emacs/config.el index b67e1f4..5e4c037 100755 --- a/emacs/config.el +++ b/emacs/config.el @@ -9,26 +9,11 @@ (setq user-full-name "Gabriel Arazas" 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) 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) -;; 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" org-roam-directory "~/writings/wiki") @@ -57,12 +42,7 @@ ;; Search the project path with Projectile. (setq projectile-project-search-path '("~/projects/software/" "~/writings/")) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; CUSTOM PACKAGES CONFIGURATIONS ; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -; Set the TeX engine to LuaTeX. + ; Set the TeX engine to LuaTeX. (after! tex (TeX-engine-set "luatex") (add-to-list 'safe-local-variable-values @@ -71,80 +51,101 @@ (after! org (setq time-stamp-start "date_modified:[ ]+\\\\?[\"<]+" - ; Set the capture + ; Set the capture org-capture-templates `( - ("i" "inbox" entry - (file ,(concat org-directory "/inbox.org")) - ,(concat "* TODO %?\n" - "entered on %<%F %T %:z>")) + ("i" "inbox" entry + (file ,(concat org-directory "/inbox.org")) + ,(concat "* TODO %?\n" + "entered on %<%F %T %:z>")) - ("p" "project" entry - (file ,(concat org-directory "/projects.org")) - ,(concat "* PROJ %?\n" - "- [ ] %?")) + ("p" "project" entry + (file ,(concat org-directory "/projects.org")) + ,(concat "* PROJ %?\n" + "- [ ] %?")) - ("c" "org-protocol-capture" entry - (file ,(concat org-directory "/inbox.org")) - "* TODO [[%:link][%:description]]\n%x" - :immediate-finish t)) + ("c" "org-protocol-capture" entry + (file ,(concat org-directory "/inbox.org")) + "* TODO [[%:link][%:description]]\n%x" + :immediate-finish t)) - ; Configure org-roam. - org-roam-capture-templates '( - ("p" "permanent" plain - #'org-roam-capture--get-point - "#+date: \"%<%Y-%m-%d %T %:z>\" + ; Configure org-roam. + org-roam-capture-templates '( + ("p" "permanent" plain + #'org-roam-capture--get-point "%?" + :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>\" #+language: en +#+property: anki_deck ${title}" + :file-name "cards/${slug}" + :unnarrowed t) -%?" - :file-name "%<%Y-%m-%d-%H-%M-%S>" - :head "#+title: ${title}\n" - :unnarrowed t) - - ("l" "literature" plain - #'org-roam-capture--get-point - "#+date: \"%<%Y-%m-%d %T %:z>\" + ("l" "literature" plain + #'org-roam-capture--get-point "%?" + :head "#+title: ${title} +#+date: \"%<%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>" + :unnarrowed t) -%?" - :file-name "literature/%<%Y-%m-%d-%H-%M-%S>" - :head "#+title: ${title}\n") + ("d" "dailies" entry + #'org-roam-capture--get-point "%?" + :file-name "daily/%<%Y-%m-%d>" + :head "#+title %<%Y-%m-%d>")) - ("d" "dailies" entry - #'org-roam-capture--get-point - "* %?" - :file-name "daily/%<%Y-%m-%d>" - :head "#+title %<%Y-%m-%d>" - :olp ("Study notes" "Random"))) - - ; Get the tags from vanilla and Roam-specific properties. - org-roam-tag-sources '(prop vanilla)) + ;; Get the tags from vanilla and Roam-specific properties. + org-roam-tag-sources '(prop vanilla)) (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 - ; Modify the time-stamp with each save. - time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %:z" + ;; Modify the time-stamp with each save. + time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %:z" - ; Set file templates folder at $DOOMDIR/templates. - +file-templates-dir (expand-file-name "templates/" doom-private-dir) + ;; Set file templates folder at $DOOMDIR/templates. + +file-templates-dir (expand-file-name "templates/" doom-private-dir) - ; Set the journal. - org-journal-dir "~/writings/journal" - org-journal-file-format "%F" + ;; Set the journal. + org-journal-dir "~/writings/journal" + org-journal-file-format "%F" - enable-local-variables "query" - ) + enable-local-variables "query" + ) -; A workaround for electric-indent plugin. -; See https://github.com/hlissner/doom-emacs/issues/3172 for more details. +(defun align-non-space (BEG END) + "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 () (electric-indent-local-mode -1))) -; Automate updating timestamps on save. +;; Automate updating timestamps on save. (add-hook! 'before-save-hook 'time-stamp) -; Set up Anki editor +;; Set up Anki editor (use-package! anki-editor :hook (org-mode . anki-editor-mode) :config @@ -153,9 +154,9 @@ :map org-mode-map (:prefix ("C" . "Anki cards") "p" #'anki-editor-push-notes - "P" #'anki-editor-retry-failure-notes + "r" #'anki-editor-retry-failure-notes "i" #'anki-editor-insert-note - "d" #'anki-editor-cloze-region + "I" #'anki-editor-cloze-region "e" #'anki-editor-export-subtree-to-html))) ;;; config.el ends here diff --git a/emacs/modules/tools/neuron/config.el b/emacs/modules/tools/neuron/config.el deleted file mode 100755 index f1b6a1b..0000000 --- a/emacs/modules/tools/neuron/config.el +++ /dev/null @@ -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) - diff --git a/emacs/modules/tools/neuron/packages.el b/emacs/modules/tools/neuron/packages.el deleted file mode 100755 index 3de0377..0000000 --- a/emacs/modules/tools/neuron/packages.el +++ /dev/null @@ -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 diff --git a/mpd/mpd.conf b/mpd/mpd.conf new file mode 100644 index 0000000..a4e00b6 --- /dev/null +++ b/mpd/mpd.conf @@ -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" + diff --git a/newsboat/config b/newsboat/config index 091fea3..d0237b4 100755 --- a/newsboat/config +++ b/newsboat/config @@ -1,7 +1,7 @@ # Config copied from Luke Smith's because I'm unoriginal. auto-reload yes 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 SPACE next-unread @@ -26,3 +26,5 @@ bind-key r reload-all bind-key R reload reload-threads 50 + +datetime-format "%F" diff --git a/nvim/init.vim b/nvim/init.vim index 41a324c..45213e4 100755 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -23,6 +23,9 @@ Plug 'lilydjwg/colorizer' " One of the must-haves for me. 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. let g:UltiSnipsSnippetDirectories = [$HOME . "/.config/nvim/own-snippets", ".snippets"] let g:UltiSnipsExpandTrigger="" @@ -54,7 +57,7 @@ if !exists('g:airline_symbols') let g:airline_symbols = {} endif -" fzf +" Fuzzy finder for finding files freely and fastly. Plug 'junegunn/fzf' Plug 'junegunn/fzf.vim' diff --git a/youtube-dl/config b/youtube-dl/config new file mode 100644 index 0000000..a9076f0 --- /dev/null +++ b/youtube-dl/config @@ -0,0 +1,3 @@ +--output '%(title)s.%(ext)s' + +--no-overwrite