feat emacs org mode and stuff

This commit is contained in:
Flinner 2021-08-18 18:53:03 +03:00
parent 00e4620c81
commit e98d93993f
Signed by: flinner
GPG Key ID: 95CE0DA7F0E58CA6
6 changed files with 261 additions and 50 deletions

2
bin/bin/org-capture Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
emacsclient -e '(make-orgcapture-frame)'

View File

@ -141,9 +141,10 @@ Actuall Theme:
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(flycheck-warning ((t (:background "#282828" :underline "#fabd2f")))) ;; '(flycheck-warning ((t (:background "#282828" :underline "#fabd2f"))))
'(org-date ((t (:inherit fixed-pitch)))) '(org-date ((t (:inherit fixed-pitch))))
'(ivy-posframe-border ((t (:background "#ffffff"))))) ;; '(ivy-posframe-border ((t (:background "#ffffff")))))
)
;; Enable custom neotree theme (all-the-icons must be installed!) ;; Enable custom neotree theme (all-the-icons must be installed!)
(doom-themes-neotree-config) (doom-themes-neotree-config)
@ -233,6 +234,12 @@ Single Esc to Quit, instead of *three*
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
#+end_src #+end_src
** Function keys
#+begin_src emacs-lisp
(global-set-key (kbd "M-<f8>") '(lambda () (interactive) (org-agenda nil "a")))
(global-set-key (kbd "M-<f6>") 'elfeed-dashboard)
#+end_src
** General.el ** General.el
Eval First and Last at least block! Eval First and Last at least block!
E: honestly I have no clue wtf that meant, but I will keep it E: honestly I have no clue wtf that meant, but I will keep it
@ -341,6 +348,12 @@ E: honestly I have no clue wtf that meant, but I will keep it
"rcR" '(org-clock-report :which-key "Clock Report") "rcR" '(org-clock-report :which-key "Clock Report")
"rcg" '(org-clock-goto :which-key "Goto Clock") "rcg" '(org-clock-goto :which-key "Goto Clock")
;; Anki
"rn" '(:ignore t :which-key "AnKi")
"rnp" '(anki-editor-push-notes :which-key "Clock In")
"rni" '(anki-editor-insert-notes :which-key "Clock In")
;; Schedules and Deadlines ;; Schedules and Deadlines
;; TODO! ;; TODO!
#+end_src #+end_src
@ -595,6 +608,7 @@ Capture
(evil-snipe-mode +1)) (evil-snipe-mode +1))
#+end_src #+end_src
* Completions * Completions
** ivy ** ivy
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -722,6 +736,18 @@ better sorting for ivy, company..
#+end_src #+end_src
* Org-Mode * Org-Mode
** Set directories
#+begin_src emacs-lisp
(setq org-directory "~/Documents/gtd/"
org-roam-directory "~/Documents/roam/"
org-agenda-files (list org-directory (concat org-roam-directory "life.org"))
rmh-elfeed-org-files (list "~/Documents/private.el/elfeed.org")
elfeed-dashboard-file "~/Documents/private.el/elfeed-dashboard.org"
org-preview-latex-image-directory "/tmp/ltximg"
org-my-anki-file (concat org-roam-directory "anki.org")
)
#+end_src
** use-package ** use-package
Modes To Start Modes To Start
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -759,6 +785,7 @@ use-package
(set-face-attribute (car face) nil :font my/ui/varfont :weight 'regular :height (cdr face))) (set-face-attribute (car face) nil :font my/ui/varfont :weight 'regular :height (cdr face)))
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.5))
;; Ensure that anything that should be fixed-pitch in Org files appears that way ;; Ensure that anything that should be fixed-pitch in Org files appears that way
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch) (set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch)
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
@ -769,17 +796,6 @@ use-package
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)) (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch))
#+end_src #+end_src
** Set directories
#+begin_src emacs-lisp
(setq org-directory "~/Documents/gtd/"
org-roam-directory "~/Documents/roam/"
org-agenda-files (list org-directory (concat org-roam-directory "life.org"))
rmh-elfeed-org-files (list "~/Documents/private.el/elfeed.org")
elfeed-dashboard-file "~/Documents/private.el/elfeed-dashboard.org"
org-preview-latex-image-directory "/tmp/ltximg"
)
#+end_src
** Appearance ** Appearance
*** Symbols *** Symbols
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -824,19 +840,11 @@ use-package
(org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●"))) (org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●")))
#+end_src #+end_src
** CANCELED Auto Tangle Configuration Files *** Latex
CLOSED: [2021-07-30 Fri 12:52] scale inline
Automatically tangle our Emacs.org config file when we save it #+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle no ; moved to use -package
(defun my/org-mode/org-babel-tangle-config () ; (setq org-format-latex-options (plist-put org-format-latex-options :scale 1.5))
(when (string-equal (buffer-file-name)
(expand-file-name "~/.config/emacs/init.org"))
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-babel-tangle))))
(add-hook 'org-mode-hook
(lambda () (add-hook 'after-save-hook #'my/org-mode/org-babel-tangle-config)))
#+end_src #+end_src
** Babel ** Babel
@ -866,12 +874,35 @@ Allow fast code insertion
(add-to-list 'org-structure-template-alist '("scm" . "src scheme")) (add-to-list 'org-structure-template-alist '("scm" . "src scheme"))
#+end_src #+end_src
** Capture Templates ** Capture
*** Templates
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq org-capture-templates (setq org-capture-templates
`( `(
("d" "Distraction" entry (file+headline ,(concat org-directory "distractions.org") "Inbox") ("d" "Distraction" entry (file+headline ,(concat org-directory "distractions.org") "Inbox")
"* %?\n%T"))) "* %?\n%T")
("a" "Anki basic"
entry
(file+headline org-my-anki-file "Dispatch Shelf")
"* %<%H:%M> \n:PROPERTIES:\n:ANKI_NOTE_TYPE: Basic\n:ANKI_DECK: Math::Calculus-III\n:END:\n** Front\n%?\n** Back\n%x\n")
("A" "Anki cloze"
entry
(file+headline org-my-anki-file "Dispatch Shelf")
"* %<%H:%M> \n:PROPERTIES:\n:ANKI_NOTE_TYPE: Cloze\n:ANKI_DECK: Mega\n:END:\n** Text\n%x\n** Extra\n")))
#+end_src
*** Utils
launch with =emacsclient -e '(make-orgcapture-frame)'=
#+begin_src emacs-lisp
(defun make-orgcapture-frame ()
"Create a new frame and run org-capture."
(interactive)
(make-frame '((name . "org-capture") (window-system . x)))
(select-frame-by-name "org-capture")
(counsel-org-capture)
(delete-other-windows)
)
#+end_src #+end_src
** Agenda ** Agenda
@ -976,6 +1007,7 @@ Allow fast code insertion
#+end_src #+end_src
** org-roam ** org-roam
*** use-package
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package org-roam (use-package org-roam
:defer t :defer t
@ -999,7 +1031,7 @@ Allow fast code insertion
(no-delete-other-windows . t)))))) (no-delete-other-windows . t))))))
#+end_src #+end_src
** org roam server *** org roam server
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package websocket (use-package websocket
:after org-roam) :after org-roam)
@ -1019,7 +1051,7 @@ Allow fast code insertion
#+end_src #+end_src
** Deft *** Deft
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package deft (use-package deft
:after org :after org
@ -1037,6 +1069,23 @@ Allow fast code insertion
#+end_src #+end_src
** Anki
#+begin_src emacs-lisp
(use-package anki-editor
:after org
:bind (:map org-mode-map
("<f12>" . anki-editor-cloze-region-auto-incr))
:init
(setq-default anki-editor-use-math-jax t)
:config
(setq anki-editor-create-decks nil ;; Allow anki-editor to create a new deck if it doesn't exist
anki-editor-org-tags-as-anki-tags t)
)
#+end_src
* Development * Development
** General ** General
*** Brackets setup *** Brackets setup
@ -1206,7 +1255,8 @@ Get treemacs-lsp
:bind (:map rustic-mode-map :bind (:map rustic-mode-map
("C-c C-c l" . lsp-ui-flycheck-list) ("C-c C-c l" . lsp-ui-flycheck-list)
("C-c C-c s" . lsp-rust-analyzer-status) ("C-c C-c s" . lsp-rust-analyzer-status)
("<f5>" . rustic-cargo-test)) ("<f5>" . rustic-cargo-test)
("C-<f5>" . rustic-cargo-run))
:config :config
;; uncomment for less flashiness ;; uncomment for less flashiness
;; (setq lsp-eldoc-hook nil) ;; (setq lsp-eldoc-hook nil)
@ -1362,8 +1412,8 @@ Better Diff in header sizes
*** Scheme (guile) *** Scheme (guile)
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package geiser (use-package geiser
:bind :bind ([remap eval-last-sexp] . geiser-eval-last-sexp))
([remap eval-last-sexp] . geiser-eval-last-sexp))
(use-package geiser-guile) (use-package geiser-guile)
#+end_src #+end_src
@ -1392,22 +1442,6 @@ Better Diff in header sizes
:ensure t) :ensure t)
#+end_src #+end_src
** Elfeed org
#+begin_src emacs-lisp
(use-package elfeed-dashboard
:config
;; (setq elfeed-dashboard-file "~/Documents/private.el/elfeed-dashboard.org")
;; update feed counts on elfeed-quit
(advice-add 'elfeed-search-quit-window :after #'elfeed-dashboard-update-links))
(use-package elfeed-org
:commands elfeed
:hook (elfeed . elfeed-org)
:config)
;; (setq rmh-elfeed-org-files (list "~/Documents/private.el/elfeed.org"))
#+end_src
** ranger ** ranger
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ranger (use-package ranger
@ -1449,6 +1483,46 @@ Better Diff in header sizes
`([,(cdr char-regexp) 0 font-shape-gstring])))) `([,(cdr char-regexp) 0 font-shape-gstring]))))
#+end_src #+end_src
* Elfeed org
=;; (setq rmh-elfeed-org-files (list "~/Documents/private.el/elfeed.org"))=
** Elfeed-org
#+begin_src emacs-lisp
(use-package elfeed-org
:commands elfeed
:config (elfeed-org))
#+end_src
** Elfeed Dashboard
#+begin_src emacs-lisp
(use-package elfeed-dashboard
:commands elfeed-dashboard
:config
;; (setq elfeed-dashboard-file "~/Documents/private.el/elfeed-dashboard.org")
;; update feed counts on elfeed-quit
(advice-add 'elfeed-search-quit-window :after #'elfeed-dashboard-update-links)
(evil-set-initial-state 'elfeed-dashboard-mode 'emacs)
:hook (elfeed-dashboard-mode . (lambda () (variable-pitch-mode -1))))
#+end_src
** Visual
#+begin_src emacs-lisp
(use-package elfeed
:config
(defun my/elfeed/visual ()
(interactive)
(set-face-attribute 'variable-pitch (selected-frame) :font (font-spec :family my/ui/varfont :size 13))
(setq visual-fill-column-width 110
visual-fill-column-center-text t
fill-column 90)
(visual-fill-column-mode 1)
(visual-line-mode 1))
:hook (elfeed-show-mode . my/elfeed/visual))
#+end_src
* IRC * IRC
** unsused 'erc' ** unsused 'erc'
#+begin_src emacs-lisp :tangle no #+begin_src emacs-lisp :tangle no

View File

@ -0,0 +1,132 @@
####################
# General settings #
####################
# Anki deck for new cards. Subdecks are supported.
deck_name=Japanese::Mining
# Model names are listed in `Tools -> Manage note types` menu in Anki.
model_name=Japanese sentences
# Field names as they appear in the selected note type.
sentence_field=SentKanji
audio_field=SentAudio
image_field=Image
# The tag(s) added to new notes. Spaces separate multiple tags.
# Leave nothing after `=` to disable tagging completely.
# The following substitutions are supported:
# %n - the name of the video
# %t - timestamp
# %d - episode number (if none, returns nothing)
# %e - SUBS2SRS_TAGS environment variable
note_tag=subs2srs
#note_tag=%n %t %e
#note_tag=
# Size of the font used in the menu
menu_font_size=24
##############################################
# Togglebles. Possble values: `yes` or `no`. #
##############################################
# Automatically create the deck for new cards (see deck_name option)
create_deck=yes
# When mpv starts, automatically copy subs to the clipboard as they appear on screen.
# This option can be also toggled in the addon's OSD menu.
autoclip=no
# Remove all spaces from the subtitle text.
# Only makes sense for languages without spaces like Japanese.
nuke_spaces=yes
# if set to `yes`, the volume of the outputted audio file
# depends on the volume of the player at the time of export
tie_volumes=no
# Remove text in parentheses that may interfere with Yomichan
# before copying subtitles to the clipboard
clipboard_trim_enabled=yes
# Add media to fields before or after existing data
append_media=yes
# Remove text in brackets before substituting %n into tag
tag_nuke_brackets=yes
# Remove text in brackets before substituting %n into tag
tag_nuke_parentheses=no
# Remove the episode number before substituting %n into tag
tag_del_episode_num=yes
# Remove everything after the episode number before substituting %n into tag
# Does nothing if the previous option tag_del_episode_num is disabled.
tag_del_after_episode_num=yes
# Convert filename to lowercase for tagging.
tag_filename_lowercase=no
##################
# Image settings #
##################
# Snapshot format.
snapshot_format=webp
#snapshot_format=jpg
# Quality of produced image files. 0 = lowest, 100=highest.
snapshot_quality=15
# Image dimensions
# If either (but not both) of the width or height parameters is -2,
# the value will be calculated preserving the aspect-ratio.
snapshot_width=-2
snapshot_height=200
##################
# Audio settings #
##################
# Audio format.
audio_format=opus
#audio_format=mp3
# Sane values are 16k-32k for opus, 64k-128k for mp3.
audio_bitrate=18k
# Set a pad to the dialog timings. 0.5 = half a second
audio_padding=0.0
#audio_padding=0.5
#######################################
# Forvo support (Yomichan users only) #
#######################################
# yes - fetch audio from Forvo if Yomichan couldn't find the audio (default)
# always - always fetch audio from Forvo and replace the audio added by Yomichan
# no - never use Forvo
use_forvo=yes
# Vocab field should be equal to {expression} field in Yomichan
vocab_field=VocabKanji
# Vocab Audio field should be equal to {audio} field in Yomichan
vocab_audio_field=VocabAudio
#######################################
# Misc info #
#######################################
# By enabling miscinfo you can add certain context information to your cards.
miscinfo_enable=yes
# Field name
miscinfo_field=Notes
# Format string used to fill the miscinfo_field.
# It supports the same substitutions as note_tag. HTML is supported.
miscinfo_format=%n EP%d (%t)
#miscinfo_format=From <b>mpvacious</b> %n at %t.

View File

@ -0,0 +1 @@
/etc/mpv/scripts/mpvacious/

View File

@ -49,6 +49,8 @@ super + e
emacsclient -nc -alternate-editor="emacs" emacsclient -nc -alternate-editor="emacs"
#emacsclient -nc -alternate-editor="" #emacsclient -nc -alternate-editor=""
super + shift + e
~/bin/org-capture
# show poly-bar # show poly-bar
super + b super + b
polybar-msg cmd show; bspc config -m focused top_padding 20 polybar-msg cmd show; bspc config -m focused top_padding 20