[literate] absorb 4 files into init.org
This commit is contained in:
parent
bcd8d2aabe
commit
c6fcec9b81
|
@ -1,260 +0,0 @@
|
|||
(use-package run-transformers
|
||||
:load-path "~/.emacs.d/contrapunctus/run-transformers/")
|
||||
|
||||
(use-package chronometrist
|
||||
:load-path "~/.emacs.d/contrapunctus/chronometrist/elisp/"
|
||||
:hook
|
||||
(chronometrist-kv-read-mode . visual-line-mode)
|
||||
(chronometrist-sexp-mode . auto-revert-mode)
|
||||
(kill-emacs-query-functions . chronometrist-query-stop)
|
||||
:bind (("<f9>" . chronometrist)
|
||||
("<kp-insert>" . chronometrist))
|
||||
:config
|
||||
(setq chronometrist-before-in-functions '()
|
||||
chronometrist-after-in-functions '(;; chronometrist-tags-add
|
||||
;; chronometrist-kv-add
|
||||
contrapunctus-start-project)
|
||||
chronometrist-before-out-functions '(contrapunctus-before-project-stop
|
||||
;; chronometrist-skip-query-prompt
|
||||
chronometrist-tags-add
|
||||
;; chronometrist-tags-hydra
|
||||
;; chronometrist-tags-choice
|
||||
chronometrist-kv-add
|
||||
chronometrist-skip-query-reset)
|
||||
chronometrist-after-out-functions '(contrapunctus-after-project-stop)
|
||||
chronometrist-activity-indicator 'contrapunctus-chronometrist-activity-indicator))
|
||||
|
||||
(use-package chronometrist-goal
|
||||
:load-path "~/.emacs.d/contrapunctus/chronometrist-goal/"
|
||||
:hook (chronometrist-mode . chronometrist-goal-minor-mode)
|
||||
:config
|
||||
(setq chronometrist-goal-list
|
||||
'((15 "Arrangement/new edition")
|
||||
(15 "Aural exercises")
|
||||
(15 "Transcription" "Theory")
|
||||
(30 "Composing" "Writing" "Recording")
|
||||
(15 "Data organization" "Physical organization" "Khilona archiving")
|
||||
(60 "Exercise")
|
||||
(120 "Guitar")
|
||||
(90 "Reading")
|
||||
(60 "Singing")
|
||||
(20 "Subtitles")
|
||||
(15 "Acting")
|
||||
(30 "Keyboard")
|
||||
(15 "Wikisource"))
|
||||
alert-default-style 'libnotify))
|
||||
|
||||
(defun contrapunctus-chronometrist-activity-indicator ()
|
||||
(thread-last (plist-put (chronometrist-last)
|
||||
:stop (chronometrist-format-time-iso8601))
|
||||
list
|
||||
chronometrist-events-to-durations
|
||||
(-reduce #'+)
|
||||
truncate
|
||||
chronometrist-format-time))
|
||||
|
||||
(defun contrapunctus-find-two-files-other-window (file-1 file-2)
|
||||
"Open FILE-1 and FILE-2 in new windows.
|
||||
FILE-1 will appear above FILE-2."
|
||||
(find-file-other-window file-2)
|
||||
(split-window-below)
|
||||
(find-file file-1))
|
||||
|
||||
(defun cp-outline-open-heading (n)
|
||||
(goto-char (point-min))
|
||||
(outline-next-visible-heading n)
|
||||
(outline-show-subtree))
|
||||
|
||||
(defun contrapunctus-start-project (project)
|
||||
(delete-other-windows)
|
||||
(pcase project
|
||||
("Arrangement/new edition"
|
||||
(delete-other-windows)
|
||||
(find-file
|
||||
"~/1-music-notation/4-my-arrangements/2020/2020-11-27 Winterreise/01 Gute Nacht/music/")
|
||||
(launch-file
|
||||
"~/1-music-notation/4-my-arrangements/2020/2020-11-27 Winterreise/01 Gute Nacht/output/01 Gute Nacht-pacON.pdf")
|
||||
(launch-file
|
||||
"~/Sync/Scores/voice/Schubert, Franz/IMSLP570459-PMLP2203-D_911,_Winterreise.pdf"))
|
||||
("Aural exercises"
|
||||
(find-file-other-window "~/phone/Nokia 6.1/Documents/Markor/Music/Analyse.md"))
|
||||
("Composing"
|
||||
(find-file-other-window
|
||||
"/home/anon/1-music-notation/2-my-compositions/2017/2017-02 The Rainbow Flower/1 Chhutti Ka Din/music/"))
|
||||
("Data organization"
|
||||
(find-dired "~/" "-name \\'dl\\' -size +0c"))
|
||||
("Exercise"
|
||||
(let* ((path-1 "~/Documents/Text Files/ma/practice.org")
|
||||
(path-2 "~/Documents/Text Files/ma/0shoto-syllabus.org")
|
||||
(file-1 (file-name-nondirectory path-1))
|
||||
(file-2 (file-name-nondirectory path-2)))
|
||||
(contrapunctus-find-two-files-other-window path-1 path-2)
|
||||
(select-window (get-buffer-window file-1))))
|
||||
("Guitar"
|
||||
(let* ((path-1 "~/Sync/Scores/guitar-solo/repertoire.org")
|
||||
(path-2 "~/Sync/Scores/guitar-duo/repertoire.org")
|
||||
(weekday (elt (decode-time) 6))
|
||||
(week (string-to-number (format-time-string "%U"))))
|
||||
(contrapunctus-find-two-files-other-window path-1 path-2)
|
||||
(select-window (get-buffer-window (get-file-buffer path-1)))
|
||||
(org-match-sparse-tree nil "perform")))
|
||||
("Keyboard"
|
||||
(find-file-other-window "~/Documents/Text Files/music_stuff/piano.org")
|
||||
(outline-show-subtree))
|
||||
("Khilona archiving"
|
||||
(find-file-other-window "/home/anon/Documents/sync/Khilona/")
|
||||
(split-window-below)
|
||||
(other-window 1)
|
||||
(find-file "/home/anon/Khilona/Videos/Me?/")
|
||||
(other-window 1)
|
||||
(find-file "/home/anon/Documents/Text Files/khilona/2011 Me?/script/script.tex"))
|
||||
("OSM"
|
||||
;; (async-shell-command "java -jar ~/josm-tested.jar" " *JOSM*" " *JOSM errors*")
|
||||
;; (delete-window (get-buffer-window " *JOSM*"))
|
||||
(contrapunctus-find-two-files-other-window "~/phone/Nokia 6.1/Android/data/net.osmand.plus/files/"
|
||||
;; "~/phone/Nokia 6.1/external/DCIM/OpenCamera/osm/"
|
||||
"~/phone/Nokia 6.1/Documents/Markor/OSM/TODO.md"))
|
||||
("Programming"
|
||||
(find-file-other-window
|
||||
"~/phone/Nokia 6.1/Documents/Markor/Computers/todo.md"))
|
||||
("Singing"
|
||||
(find-file-other-window "~/Sync/Scores/voice/repertoire.org"))
|
||||
("Subtitles"
|
||||
;; (find-file-other-window "~/Music/0-classical/vocal/musical/Company/")
|
||||
(start-process "subtitleeditor" nil "subtitleeditor" "/home/khilona/Videos/Peer Gynt/peer-gynt.srt"))
|
||||
("Teaching"
|
||||
(launch-file "~/Sync/Scores/voice/jingle-bell-rock.pdf"))
|
||||
("Theatre rehearsal"
|
||||
(contrapunctus-find-two-files-other-window
|
||||
"~/Documents/Text Files/khilona/voices.org"
|
||||
"~/1-music-notation/2-my-compositions/2019/2019-03 Kahe Natak Karte Ho Ji/Kahe Natak Karte Ho Ji.org"))
|
||||
("Transcription"
|
||||
;; (find-file-other-window
|
||||
;; "~/phone/Nokia 6.1/Documents/Markor/Music/transcriptions.md")
|
||||
(emms-play-file "~/Music/christmas/Glee - Jingle Bell Rock (Lyrics)-VfLf7A_-1Vw.webm")
|
||||
(find-file "~/1-music-notation/3-my-transcriptions/Glee - Jingle Bell Rock/music/")
|
||||
(launch-file "~/1-music-notation/3-my-transcriptions/Glee - Jingle Bell Rock/output/Glee - Jingle Bell Rock-pacON.pdf"))
|
||||
("Video editing"
|
||||
(start-process "flatpak" (generate-new-buffer-name "kdenlive")
|
||||
"flatpak" "run" "org.kde.kdenlive"
|
||||
"/home/khilona/Videos/ghar ghar theatre 3/ggt3.kdenlive")
|
||||
(find-alternate-file-other-window "/home/khilona/Videos/ghar ghar theatre 3/"
|
||||
;; "/home/khilona/Videos/podcast/"
|
||||
))
|
||||
("Wiktionary"
|
||||
(find-file-other-window
|
||||
"~/phone/Nokia 6.1/Documents/Markor/Languages/hindi.md"))
|
||||
("Writing"
|
||||
(find-file-other-window
|
||||
"/home/anon/phone/Nokia 6.1/Documents/Markor/Songs or Poems/"))))
|
||||
|
||||
(autoload 'magit-anything-modified-p "magit")
|
||||
|
||||
(defun contrapunctus-commit-prompt ()
|
||||
"Prompt user if `default-directory' is a dirty Git repository.
|
||||
Return t if the user answers yes, if the repository is clean, or
|
||||
if there is no Git repository.
|
||||
|
||||
Return nil (and run `magit-status') if the user answers no."
|
||||
(cond ((not (magit-anything-modified-p)) t)
|
||||
((yes-or-no-p
|
||||
(format "You have uncommitted changes in %S. Really clock out? "
|
||||
default-directory)) t)
|
||||
(t (magit-status) nil)))
|
||||
|
||||
(defun contrapunctus-before-project-stop (project)
|
||||
(if (member project '("Composing" "Khilona archiving" "Programming"))
|
||||
(contrapunctus-commit-prompt)
|
||||
;; all functions in `chronometrist-before-project-stop-functions'
|
||||
;; must return t for successful clock-out
|
||||
t))
|
||||
|
||||
(require 'request)
|
||||
(require 'esxml-query)
|
||||
(defun contrapunctus-after-project-stop (project)
|
||||
(pcase project
|
||||
("OSM"
|
||||
(delete-other-windows)
|
||||
;; What should we do when there's no network connectivity?
|
||||
;; Ideally - note the clock-out time, and retry every five
|
||||
;; minutes. When connected, request the changesets, look for the
|
||||
;; first changeset with a "created_at" which is less than the
|
||||
;; clock-out time.
|
||||
(request
|
||||
"https://api.openstreetmap.org/api/0.6/changesets"
|
||||
:params '(("display_name" . "contrapunctus"))
|
||||
:parser (lambda () (libxml-parse-xml-region (point) (point-max)))
|
||||
:success
|
||||
(cl-function
|
||||
(lambda (&key data &allow-other-keys)
|
||||
(let* ((latest-changeset (-> data
|
||||
(esxml-node-children)
|
||||
(car)))
|
||||
(comment (->> latest-changeset
|
||||
(esxml-query "[k=comment]")
|
||||
(esxml-node-attributes)
|
||||
(cdr)
|
||||
(car)
|
||||
(cdr)))
|
||||
(id (-> latest-changeset
|
||||
(esxml-node-attributes)
|
||||
(car)
|
||||
(cdr))))
|
||||
(chronometrist-append-to-last-expr nil
|
||||
`(:osm-url ,(concat "https://www.openstreetmap.org/changeset/" id)
|
||||
:osm-comment ,comment)))))))
|
||||
(_ (delete-other-windows))))
|
||||
|
||||
(defun contrapunctus-count-expressions ()
|
||||
(interactive)
|
||||
(chronometrist-sexp-in-file chronometrist-file
|
||||
(goto-char (point-min))
|
||||
(cl-loop with count = 0
|
||||
while (ignore-errors (read (current-buffer)))
|
||||
do (cl-incf count)
|
||||
finally do (message "%s" count))))
|
||||
|
||||
;; Wrote these two as potential alternatives to `org-babel-tangle',
|
||||
;; which was far slower than I'd like (took around 20s for
|
||||
;; chronometrist.org when I checked during the migration process, and
|
||||
;; 43s after the migration was complete.) These, on the other hand,
|
||||
;; are almost instant, but I don't use them anywhere because I run a
|
||||
;; sed script as a file local variable.
|
||||
(defun chronometrist-tangle ()
|
||||
(goto-char (point-min))
|
||||
(cl-loop with source
|
||||
while (not (eobp))
|
||||
when (looking-at-p (rx (and line-start (zero-or-more blank) "#+BEGIN_SRC emacs-lisp" line-end)))
|
||||
concat (progn
|
||||
(forward-line 1)
|
||||
(buffer-substring-no-properties
|
||||
(point)
|
||||
(cl-loop while (not (eobp))
|
||||
if (looking-at-p (rx (and line-start
|
||||
(zero-or-more blank)
|
||||
"#+END_SRC"
|
||||
line-end)))
|
||||
do (cl-return (point))
|
||||
else do (forward-line 1)))) into source
|
||||
do (forward-line 1)
|
||||
finally do
|
||||
(with-current-buffer (find-file-noselect "chronometrist.el")
|
||||
(delete-region (point-min) (point-max))
|
||||
(insert source)
|
||||
(save-buffer))))
|
||||
|
||||
(defun chronometrist-tangle-sed ()
|
||||
(let* ((file-path (buffer-file-name
|
||||
(current-buffer)))
|
||||
(base (file-name-base file-path)))
|
||||
(when (equal "chronometrist.org" (file-name-nondirectory file-path))
|
||||
(start-process-shell-command
|
||||
"sed-tangle"
|
||||
(generate-new-buffer-name "sed-tangle")
|
||||
(format "sed -n '/#+BEGIN_SRC emacs-lisp$/,/#+END_SRC$/{//!p;}' ~s.org > ~s.el" base base)))))
|
||||
|
||||
(provide 'cp-chronometrist)
|
||||
|
||||
;; Local Variables:
|
||||
;; nameless-current-name: nil
|
||||
;; End:
|
|
@ -1,89 +0,0 @@
|
|||
|
||||
;; TODO - make toggle command for emms-start/emms-stop
|
||||
;; TODO - change mode line display - don't show the whole file path, just the name
|
||||
(use-package emms
|
||||
:after hydra
|
||||
:bind
|
||||
("<f2> e" . #'hydra-emms/body)
|
||||
("<f2> E" . #'emms)
|
||||
(:map dired-mode-map
|
||||
("E" . #'hydra-emms/body))
|
||||
:commands
|
||||
(emms-minimalistic emms emms-play-dired emms-add-dired)
|
||||
:config
|
||||
(emms-minimalistic)
|
||||
(emms-default-players)
|
||||
(setq emms-player-mpv-parameters
|
||||
(lambda ()
|
||||
(append
|
||||
'("--fs"
|
||||
"--quiet"
|
||||
"--really-quiet"
|
||||
;; "--vid=no"
|
||||
"--force-window=yes"
|
||||
"-ao=jack,alsa"
|
||||
;; "--loop-file=inf"
|
||||
)
|
||||
(let* ((dir (->> (emms-playlist-current-selected-track)
|
||||
(alist-get 'name)
|
||||
(file-name-directory)))
|
||||
(subs-in-dir (f-glob "*.srt" dir))
|
||||
(subs-in-subdir (f-glob "*/*.srt" dir)))
|
||||
(->> (append subs-in-dir subs-in-subdir)
|
||||
(-interpose ":")
|
||||
(append '("--sub-files="))
|
||||
(apply #'concat)
|
||||
(list))))))
|
||||
;; ;; This won't work for `emms-random', because it runs in a `save-excursion'
|
||||
;; (add-to-list 'emms-playlist-selection-changed-hook 'emms-playlist-mode-center-current)
|
||||
;; (--map (add-to-list 'emms-player-mpv-parameters it)
|
||||
;; '("--fs"))
|
||||
(defun contrapunctus-emms-toggle-player ()
|
||||
(interactive)
|
||||
(if emms-player-stopped-p
|
||||
(emms-start)
|
||||
(emms-stop)))
|
||||
:init (defhydra hydra-emms ()
|
||||
("e" #'emms "EMMS")
|
||||
("n" #'emms-next "Next")
|
||||
("p" #'emms-previous "Previous")
|
||||
("SPC" #'emms-pause "Pause")
|
||||
("s" #'contrapunctus-emms-toggle-player "Start/Stop")
|
||||
("0" #'emms-volume-raise)
|
||||
("9" #'emms-volume-lower)
|
||||
("<up>" #'emms-volume-raise)
|
||||
("<down>" #'emms-volume-lower)
|
||||
("<left>" #'emms-seek-backward)
|
||||
("<right>" #'emms-seek-forward)
|
||||
("l" #'emms-play-dired "Play file (dired)")
|
||||
("a" #'emms-add-dired "Add file (dired)")
|
||||
("A" #'emms-add-directory-tree "Add directory")
|
||||
("u" #'emms-play-url)))
|
||||
|
||||
(use-package emms-playlist-mode
|
||||
:bind
|
||||
(:map emms-playlist-mode-map
|
||||
("0" . #'emms-volume-raise)
|
||||
("9" . #'emms-volume-lower)
|
||||
("<up>" . #'emms-volume-raise)
|
||||
("<down>" . #'emms-volume-lower)
|
||||
("<left>" . #'emms-seek-backward)
|
||||
("<right>" . #'emms-seek-forward)
|
||||
("n" . #'next-line)
|
||||
("p" . #'previous-line)
|
||||
("N" . #'emms-next)
|
||||
("P" . #'emms-previous)
|
||||
("R" . #'emms-toggle-random-playlist)
|
||||
("M-n" . #'emms-cue-next)
|
||||
("M-p" . #'emms-cue-previous)
|
||||
("SPC" . #'emms-pause))
|
||||
:config
|
||||
(setq emms-playlist-buffer-name "EMMS Playlist"))
|
||||
|
||||
(use-package emms-info-tinytag
|
||||
:init
|
||||
(setq emms-info-functions '(emms-info-tinytag))
|
||||
:config
|
||||
(setq emms-info-tinytag-python-name "python3"))
|
||||
|
||||
(provide 'cp-emms)
|
|
@ -1,55 +0,0 @@
|
|||
|
||||
;; (add-hook 'markdown-mode-hook '(lambda () (turn-off-smartparens-mode)))
|
||||
|
||||
(use-package markdown-mode
|
||||
:mode "\\.md\\'"
|
||||
:hook
|
||||
(markdown-mode . (lambda ()
|
||||
(make-local-variable 'before-save-hook)
|
||||
(add-hook 'before-save-hook 'markdown-cleanup-list-numbers)))
|
||||
(markdown-mode . markdown-display-inline-images)
|
||||
:config (setq markdown-command "cmark"
|
||||
markdown-css-paths '("style.css")
|
||||
markdown-display-remote-images t
|
||||
markdown-max-image-size '(500 . 500)
|
||||
;; reflows text to suit different screens
|
||||
markdown-xhtml-header-content
|
||||
(concat "<meta name=\"viewport\" "
|
||||
"content=\"width=device-width, "
|
||||
"initial-scale=1.0, "
|
||||
"user-scalable=yes\" />"))
|
||||
(when (featurep 'boon)
|
||||
(general-def markdown-mode-map
|
||||
"C-c ," 'markdown-promote
|
||||
"C-c ." 'markdown-demote
|
||||
"C-c C-e" 'markdown-export))
|
||||
(setq-default ;; markdown-hide-markup t ;; has a bug with heading cycling
|
||||
markdown-hide-urls t)
|
||||
:bind
|
||||
(:map markdown-mode-map
|
||||
;; ("M-n" . org-drag-element-forward)
|
||||
;; ("M-p" . org-drag-element-backward)
|
||||
;; ("C-c C-o" . markdown-follow-link-at-point)
|
||||
("M-n" . markdown-move-down)
|
||||
("M-p" . markdown-move-up)
|
||||
("C-c C--" . org-cycle-list-bullet)
|
||||
([mouse-1] . markdown-cycle)
|
||||
("C-c C-x C-n" . markdown-next-link)
|
||||
("C-c C-x C-p" . markdown-previous-link)
|
||||
|
||||
("C-c C-h C-u" . #'markdown-toggle-url-hiding)
|
||||
("C-c C-h C-m" . #'markdown-toggle-markup-hiding)
|
||||
("C-c C-h C-i" . #'markdown-toggle-inline-images)
|
||||
("C-c C-r" . #'reverse-region)))
|
||||
|
||||
(defun cp/copy-line-or-md-link (prefix-arg)
|
||||
(interactive "P")
|
||||
(save-excursion
|
||||
(beginning-of-line)
|
||||
(if (looking-at-p ".*http")
|
||||
(progn
|
||||
(cp/re-search-line "http")
|
||||
(forward-char -4)
|
||||
(kill-new (thing-at-point 'url))))))
|
||||
|
||||
(provide 'cp-md)
|
|
@ -1,142 +0,0 @@
|
|||
;; modal editing configurations
|
||||
|
||||
;; normal boon config
|
||||
(use-package boon
|
||||
:ensure t
|
||||
:commands (boon-mode)
|
||||
:bind
|
||||
(:map boon-command-map
|
||||
("C-l" . recenter-top-bottom)
|
||||
("r" . swiper)
|
||||
("/" . undo-tree-undo)
|
||||
("?" . undo-tree-redo)
|
||||
("G" . join-line) ;; mnemonic - Glue (I'd like to bind J and
|
||||
;; : to sentence movement once I extend
|
||||
;; Boon to select by sentence movement)
|
||||
;; ("TAB" . 'company-indent-or-complete-common)
|
||||
;; ;; this works, but also breaks unfolding in org mode :\
|
||||
;; ("<tab>" . 'company-indent-or-complete-common)
|
||||
("C" . 'boon-toggle-comment)
|
||||
("t" . nil)
|
||||
("t w" . 'transpose-words)
|
||||
("t e" . 'transpose-sexps)
|
||||
("t l" . 'transpose-lines)
|
||||
("t p" . 'transpose-paragraphs)
|
||||
("t c" . 'transpose-chars)
|
||||
("\\" . projectile-command-map)
|
||||
("(" . boon-navigate-backward)
|
||||
(")" . boon-navigate-forward))
|
||||
(:map boon-x-map
|
||||
("w" . 'write-file)
|
||||
("s" . 'save-buffer)
|
||||
("d" . 'dired-jump)
|
||||
("e" . 'eval-last-sexp)
|
||||
("f" . 'find-file)
|
||||
("l" . 'ido-mini)
|
||||
("c" . 'kill-emacs)
|
||||
("v" . 'find-alternate-file)
|
||||
("b" . 'ibuffer)
|
||||
("=" . text-scale-adjust)
|
||||
("-" . text-scale-adjust))
|
||||
:config
|
||||
(use-package boon-qwerty)
|
||||
(add-to-list 'boon-enclosures `(40 "(" ")")) ;; 40 = (
|
||||
(use-package boon-powerline)
|
||||
(boon-powerline-theme)
|
||||
(mapc (lambda (mode)
|
||||
(add-to-list 'boon-special-mode-list mode))
|
||||
'(emms-playlist-mode
|
||||
emms-browser-mode
|
||||
edebug-mode
|
||||
sldb-mode
|
||||
macrostep-mode
|
||||
view-mode))
|
||||
(dolist (var '((bound-and-true-p edebug-mode)
|
||||
(bound-and-true-p view-mode)))
|
||||
(add-to-list 'boon-special-conditions var))
|
||||
;; :hook
|
||||
;; ((text-mode . turn-on-boon-mode)
|
||||
;; (prog-mode . turn-on-boon-mode)
|
||||
;; (shell-mode . turn-on-boon-mode)
|
||||
;; (helpful-mode . turn-on-boon-mode)
|
||||
;; (fundamental-mode . turn-on-boon-mode))
|
||||
:init
|
||||
(boon-mode))
|
||||
|
||||
;; experimental boon+modalka config
|
||||
(use-package boon
|
||||
:ensure t
|
||||
:disabled
|
||||
:bind
|
||||
("C-d" . 'boon-take-region)
|
||||
("C-a" . 'boon-beginning-of-line)
|
||||
("C-e" . 'boon-end-of-line)
|
||||
("M-f" . 'boon-smarter-forward)
|
||||
("M-b" . 'boon-smarter-backward))
|
||||
|
||||
;; experimental Emacs-flavored-Boon config
|
||||
(use-package boon
|
||||
:ensure t
|
||||
:disabled
|
||||
:bind
|
||||
(:map boon-command-map
|
||||
("n" . next-line)
|
||||
("p" . previous-line)
|
||||
("f" . 'forward-char)
|
||||
("b" . 'backward-char)
|
||||
("a" . 'boon-beginning-of-line)
|
||||
("e" . 'boon-end-of-line)
|
||||
("y" . 'boon-splice)
|
||||
("r" . swiper)
|
||||
("x l" . ido-mini)
|
||||
("/" . undo-tree-undo)
|
||||
("?" . undo-tree-redo))
|
||||
(:map boon-x-map
|
||||
("s" . #'save-buffer)
|
||||
("d" . #'dired-jump))
|
||||
:config
|
||||
(use-package boon-qwerty)
|
||||
(boon-mode))
|
||||
|
||||
(use-package modalka
|
||||
:disabled
|
||||
:bind
|
||||
(("<escape>" . #'modalka-mode)
|
||||
:map modalka-mode-map
|
||||
("J" . #'join-line)
|
||||
("P" . #'backward-paragraph)
|
||||
("N" . #'forward-paragraph)
|
||||
("M" . mark-sexp))
|
||||
;; (2019-11-03) I'm pretty much using this to emulate `god-mode',
|
||||
;; which was great, but is no longer actively developed and had no
|
||||
;; support for non-Latin input methods.
|
||||
:config
|
||||
(let ((keybind-re (rx-to-string '(group-n 1 (or (and bow (1+ (char graph)) eow)
|
||||
(and (1+ (char graph))))))))
|
||||
(mapc
|
||||
(lambda (actual)
|
||||
(let ((target (replace-regexp-in-string keybind-re "C-\\1" actual)))
|
||||
(modalka-define-kbd actual target)))
|
||||
;; no "t", "x", or "c", because they are prefix keys used later
|
||||
'("`" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "-" "="
|
||||
"q" "w" "e" "r" "y" "u" "i" "o" "p" "[" "]" "\\"
|
||||
"a" "s" "d" "f" "h" "j" "k" "l" ";" "'"
|
||||
"z" "v" "b" "n" "m" "," "." "/"
|
||||
"<" ">" "?"
|
||||
"SPC"
|
||||
;; (2019-11-03) It's a little unfortunate that these cannot be
|
||||
;; elided by entering ("x" "C-x") ("t" "C-t") ("c" "C-c") just
|
||||
;; once :\ (I did try)
|
||||
"x =" "x -" "x e" "x s" "x d"
|
||||
"x f" "x l" "x x" "x c" "x v" "x b"
|
||||
"t w" "t e" "t l"
|
||||
"c n" "c ," "c ." "c p"
|
||||
"c c n" "c h u" "c h m")))
|
||||
(modalka-define-kbd "O" "C-S-o")
|
||||
(setq-default cursor-type '(bar . 1))
|
||||
(setq modalka-cursor-type 'box)
|
||||
:hook
|
||||
((text-mode . modalka-mode)
|
||||
(prog-mode . modalka-mode)))
|
||||
|
||||
(provide 'cp-modal)
|
734
init.org
734
init.org
|
@ -63,38 +63,440 @@
|
|||
:config
|
||||
(setq ag-highlight-search t))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** modal editing
|
||||
*** active boon config
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(require 'cp-modal)
|
||||
(use-package boon
|
||||
:ensure t
|
||||
:commands (boon-mode)
|
||||
:bind
|
||||
(:map boon-command-map
|
||||
("C-l" . recenter-top-bottom)
|
||||
("r" . swiper)
|
||||
("/" . undo-tree-undo)
|
||||
("?" . undo-tree-redo)
|
||||
("G" . join-line) ;; mnemonic - Glue (I'd like to bind J and
|
||||
;; : to sentence movement once I extend
|
||||
;; Boon to select by sentence movement)
|
||||
;; ("TAB" . 'company-indent-or-complete-common)
|
||||
;; ;; this works, but also breaks unfolding in org mode :\
|
||||
;; ("<tab>" . 'company-indent-or-complete-common)
|
||||
("C" . 'boon-toggle-comment)
|
||||
("t" . nil)
|
||||
("t w" . 'transpose-words)
|
||||
("t e" . 'transpose-sexps)
|
||||
("t l" . 'transpose-lines)
|
||||
("t p" . 'transpose-paragraphs)
|
||||
("t c" . 'transpose-chars)
|
||||
("\\" . projectile-command-map)
|
||||
("(" . boon-navigate-backward)
|
||||
(")" . boon-navigate-forward)
|
||||
("e r" . swiper-thing-at-point)
|
||||
("x d f" . nil)) ;; shadows my binding of "x d" for `dired-jump'
|
||||
(:map boon-x-map
|
||||
("w" . 'write-file)
|
||||
("s" . 'save-buffer)
|
||||
("d" . 'dired-jump)
|
||||
("e" . 'eval-last-sexp)
|
||||
("f" . 'find-file)
|
||||
("l" . 'ido-mini)
|
||||
("c" . 'kill-emacs)
|
||||
("v" . 'find-alternate-file)
|
||||
("b" . 'ibuffer)
|
||||
("=" . text-scale-adjust)
|
||||
("-" . text-scale-adjust))
|
||||
:config
|
||||
(use-package boon-qwerty)
|
||||
;; (add-to-list 'boon-enclosures `(40 "(" ")")) ;; 40 = (
|
||||
;; (use-package boon-powerline)
|
||||
;; (boon-powerline-theme)
|
||||
(mapc (lambda (mode)
|
||||
(add-to-list 'boon-special-mode-list mode))
|
||||
'(emms-playlist-mode
|
||||
emms-browser-mode
|
||||
edebug-mode
|
||||
sldb-mode
|
||||
macrostep-mode
|
||||
view-mode
|
||||
slime-popup-buffer-mode
|
||||
finder-mode))
|
||||
(dolist (var '((bound-and-true-p edebug-mode)
|
||||
(bound-and-true-p view-mode)
|
||||
(bound-and-true-p macrostep-mode)
|
||||
(bound-and-true-p slime-popup-buffer-mode)))
|
||||
(add-to-list 'boon-special-conditions var))
|
||||
(setq hi-lock-auto-select-face t)
|
||||
;; :hook
|
||||
;; ((text-mode . turn-on-boon-mode)
|
||||
;; (prog-mode . turn-on-boon-mode)
|
||||
;; (shell-mode . turn-on-boon-mode)
|
||||
;; (helpful-mode . turn-on-boon-mode)
|
||||
;; (fundamental-mode . turn-on-boon-mode))
|
||||
:init
|
||||
(boon-mode))
|
||||
#+END_SRC
|
||||
*** experimental boon+modalka config :disabled:
|
||||
#+BEGIN_SRC emacs-lisp :load no
|
||||
(use-package boon
|
||||
:ensure t
|
||||
:disabled
|
||||
:bind
|
||||
("C-d" . 'boon-take-region)
|
||||
("C-a" . 'boon-beginning-of-line)
|
||||
("C-e" . 'boon-end-of-line)
|
||||
("M-f" . 'boon-smarter-forward)
|
||||
("M-b" . 'boon-smarter-backward))
|
||||
#+END_SRC
|
||||
*** experimental Emacs-flavored-Boon config :disabled:
|
||||
#+BEGIN_SRC emacs-lisp :load no
|
||||
(use-package boon
|
||||
:ensure t
|
||||
:disabled
|
||||
:bind
|
||||
(:map boon-command-map
|
||||
("n" . next-line)
|
||||
("p" . previous-line)
|
||||
("f" . 'forward-char)
|
||||
("b" . 'backward-char)
|
||||
("a" . 'boon-beginning-of-line)
|
||||
("e" . 'boon-end-of-line)
|
||||
("y" . 'boon-splice)
|
||||
("r" . swiper)
|
||||
("x l" . ido-mini)
|
||||
("/" . undo-tree-undo)
|
||||
("?" . undo-tree-redo))
|
||||
(:map boon-x-map
|
||||
("s" . #'save-buffer)
|
||||
("d" . #'dired-jump))
|
||||
:config
|
||||
(use-package boon-qwerty)
|
||||
(boon-mode))
|
||||
#+END_SRC
|
||||
*** modalka :disabled:
|
||||
<2019-11-03>
|
||||
I'm pretty much using this to emulate `god-mode', which was great, but is no longer actively developed and had no support for non-Latin input methods.
|
||||
#+BEGIN_SRC emacs-lisp :load no
|
||||
(use-package modalka
|
||||
:disabled
|
||||
:bind
|
||||
(("<escape>" . #'modalka-mode)
|
||||
:map modalka-mode-map
|
||||
("J" . #'join-line)
|
||||
("P" . #'backward-paragraph)
|
||||
("N" . #'forward-paragraph)
|
||||
("M" . mark-sexp))
|
||||
:config
|
||||
(let ((keybind-re (rx-to-string '(group-n 1 (or (and bow (1+ (char graph)) eow)
|
||||
(and (1+ (char graph))))))))
|
||||
(mapc
|
||||
(lambda (actual)
|
||||
(let ((target (replace-regexp-in-string keybind-re "C-\\1" actual)))
|
||||
(modalka-define-kbd actual target)))
|
||||
;; no "t", "x", or "c", because they are prefix keys used later
|
||||
'("`" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "-" "="
|
||||
"q" "w" "e" "r" "y" "u" "i" "o" "p" "[" "]" "\\"
|
||||
"a" "s" "d" "f" "h" "j" "k" "l" ";" "'"
|
||||
"z" "v" "b" "n" "m" "," "." "/"
|
||||
"<" ">" "?"
|
||||
"SPC"
|
||||
;; (2019-11-03) It's a little unfortunate that these cannot be
|
||||
;; elided by entering ("x" "C-x") ("t" "C-t") ("c" "C-c") just
|
||||
;; once :\ (I did try)
|
||||
"x =" "x -" "x e" "x s" "x d"
|
||||
"x f" "x l" "x x" "x c" "x v" "x b"
|
||||
"t w" "t e" "t l"
|
||||
"c n" "c ," "c ." "c p"
|
||||
"c c n" "c h u" "c h m")))
|
||||
(modalka-define-kbd "O" "C-S-o")
|
||||
(setq-default cursor-type '(bar . 1))
|
||||
(setq modalka-cursor-type 'box)
|
||||
:hook
|
||||
((text-mode . modalka-mode)
|
||||
(prog-mode . modalka-mode)))
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(require 'cp-god)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** time tracking - chronometrist :application:
|
||||
choice.el is required by =chronometrist-key-values=
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(require 'cp-chronometrist)
|
||||
#+END_SRC
|
||||
(use-package choice
|
||||
:load-path "~/.emacs.d/contrapunctus/choice/")
|
||||
|
||||
**
|
||||
(use-package chronometrist
|
||||
;; :disabled t
|
||||
:load-path "~/.emacs.d/contrapunctus/chronometrist/elisp/"
|
||||
:hook
|
||||
(chronometrist-kv-read-mode . visual-line-mode)
|
||||
(chronometrist-sexp-mode . auto-revert-mode)
|
||||
(chronometrist-sexp-mode . visual-line-mode)
|
||||
(kill-emacs-query-functions . chronometrist-query-stop)
|
||||
:bind (("<f9>" . chronometrist)
|
||||
("<kp-insert>" . chronometrist))
|
||||
:config
|
||||
(require 'chronometrist-key-values)
|
||||
(setq chronometrist-before-in-functions '()
|
||||
chronometrist-after-in-functions '(;; chronometrist-tags-add
|
||||
;; chronometrist-kv-add
|
||||
contrapunctus-start-project)
|
||||
chronometrist-before-out-functions '(contrapunctus-before-project-stop
|
||||
;; chronometrist-tags-add
|
||||
;; chronometrist-tag-choice
|
||||
chronometrist-key-values-unified-choice
|
||||
;; chronometrist-kv-add
|
||||
;; chronometrist-skip-query-reset
|
||||
)
|
||||
chronometrist-after-out-functions '(contrapunctus-after-project-stop)
|
||||
chronometrist-activity-indicator 'contrapunctus-chronometrist-activity-indicator))
|
||||
|
||||
(use-package chronometrist-goal
|
||||
:load-path "~/.emacs.d/contrapunctus/chronometrist-goal/"
|
||||
:hook (chronometrist-mode . chronometrist-goal-minor-mode)
|
||||
:config
|
||||
(setq chronometrist-goal-list
|
||||
'((15 "Arrangement/new edition")
|
||||
(15 "Aural exercises")
|
||||
(15 "Transcription" "Theory")
|
||||
(30 "Composing" "Writing" "Recording")
|
||||
(15 "Data organization" "Physical organization" "Khilona archiving")
|
||||
(60 "Exercise")
|
||||
(120 "Guitar")
|
||||
(90 "Reading")
|
||||
(60 "Singing")
|
||||
(20 "Subtitles")
|
||||
(15 "Acting")
|
||||
(30 "Keyboard")
|
||||
(15 "Wikisource"))
|
||||
alert-default-style 'libnotify))
|
||||
|
||||
(defun contrapunctus-chronometrist-activity-indicator ()
|
||||
(thread-last (plist-put (chronometrist-last)
|
||||
:stop (chronometrist-format-time-iso8601))
|
||||
list
|
||||
chronometrist-events-to-durations
|
||||
(-reduce #'+)
|
||||
truncate
|
||||
chronometrist-format-time))
|
||||
|
||||
(defun contrapunctus-find-two-files (file-1 file-2)
|
||||
"Open FILE-1 and FILE-2 in new windows.
|
||||
FILE-1 will appear above FILE-2."
|
||||
(find-file-other-window file-2)
|
||||
(split-window-below)
|
||||
(find-file file-1))
|
||||
|
||||
(defun cp-outline-open-heading (n)
|
||||
(goto-char (point-min))
|
||||
(outline-next-visible-heading n)
|
||||
(outline-show-subtree))
|
||||
|
||||
(defun contrapunctus-start-project (project)
|
||||
(delete-other-windows)
|
||||
(pcase project
|
||||
("Arrangement/new edition"
|
||||
(delete-other-windows)
|
||||
(find-file
|
||||
"~/1-music-notation/4-my-arrangements/2020/2020-11-27 Winterreise/01 Gute Nacht/music/")
|
||||
(launch-file
|
||||
"~/1-music-notation/4-my-arrangements/2020/2020-11-27 Winterreise/01 Gute Nacht/output/01 Gute Nacht-pacON.pdf")
|
||||
(launch-file
|
||||
"~/Sync/Scores/voice/Schubert, Franz/IMSLP570459-PMLP2203-D_911,_Winterreise.pdf"))
|
||||
("Aural exercises"
|
||||
(find-file-other-window "~/phone/Nokia 6.1/Documents/Markor/Music/Analyse.md"))
|
||||
("Composing"
|
||||
(find-file-other-window
|
||||
"~/1-music-notation/2-my-compositions/2017/2017-02 The Rainbow Flower/1 Chhutti Ka Din/music/"))
|
||||
("Data organization"
|
||||
(find-dired "~/" "-name \\'dl\\' -size +0c"))
|
||||
("Digitization"
|
||||
(find-file "~/Documents/Text Files/latex/Don't, Mr. Disraeli!/dont-mr-disraeli.tex")
|
||||
(split-window-below)
|
||||
(find-file "~/Pictures/1280px-KB_Programmer_Dvorak.svg.png"))
|
||||
("Exercise"
|
||||
(let* ((path-1 "~/Documents/Text Files/ma/practice.org")
|
||||
(path-2 "~/Documents/Text Files/ma/0shoto-syllabus.org")
|
||||
(file-1 (file-name-nondirectory path-1))
|
||||
(file-2 (file-name-nondirectory path-2)))
|
||||
(contrapunctus-find-two-files path-1 path-2)
|
||||
(select-window (get-buffer-window file-1))))
|
||||
("Guitar"
|
||||
(let* ((path-1 "~/Sync/Scores/guitar-solo/repertoire.org")
|
||||
(path-2 "~/Sync/Scores/guitar-duo/repertoire.org")
|
||||
(weekday (elt (decode-time) 6))
|
||||
(week (string-to-number (format-time-string "%U"))))
|
||||
(contrapunctus-find-two-files path-1 path-2)
|
||||
(select-window (get-buffer-window (get-file-buffer path-1)))
|
||||
(org-match-sparse-tree nil "perform")))
|
||||
("Keyboard"
|
||||
(find-file-other-window "~/Documents/Text Files/music_stuff/piano.org")
|
||||
(outline-show-subtree))
|
||||
("Khilona archiving"
|
||||
(find-file-other-window "~/Documents/sync/Khilona/")
|
||||
(split-window-below)
|
||||
(other-window 1)
|
||||
(find-file "~/Khilona/Videos/Me?/")
|
||||
(other-window 1)
|
||||
(find-file "~/Documents/Text Files/khilona/2011 Me?/script/script.tex"))
|
||||
("OSM"
|
||||
;; (async-shell-command "java -jar ~/josm-tested.jar" " *JOSM*" " *JOSM errors*")
|
||||
;; (delete-window (get-buffer-window " *JOSM*"))
|
||||
(contrapunctus-find-two-files "~/phone/Nokia 6.1/Android/data/net.osmand.plus/files/"
|
||||
;; "~/phone/Nokia 6.1/external/DCIM/OpenCamera/osm/"
|
||||
"~/phone/Nokia 6.1/Documents/Markor/OSM/TODO.md"))
|
||||
("Programming"
|
||||
(launch-file "~/git/cl/McCLIM/Documentation/Manual/Texinfo/mcclim.pdf")
|
||||
(find-file-other-window "~/phone/Nokia 6.1/Documents/Markor/Computers/todo.md"))
|
||||
("Singing"
|
||||
(find-file-other-window "~/Sync/Scores/voice/repertoire.org"))
|
||||
("Subtitles"
|
||||
;; (find-file-other-window "~/Music/0-classical/vocal/musical/Company/")
|
||||
(start-process "subtitleeditor" nil "subtitleeditor" "/home/khilona/Videos/Peer Gynt/peer-gynt.srt"))
|
||||
("Teaching"
|
||||
(find-file-other-window "~/Documents/Text Files/students/")
|
||||
;; (launch-file "~/Sync/Scores/voice/jingle-bell-rock.pdf")
|
||||
)
|
||||
("Theatre rehearsal"
|
||||
(contrapunctus-find-two-files
|
||||
"~/Documents/Text Files/khilona/voices.org"
|
||||
"~/1-music-notation/2-my-compositions/2019/2019-03 Kahe Natak Karte Ho Ji/Kahe Natak Karte Ho Ji.org"))
|
||||
("Transcription"
|
||||
;; (find-file-other-window
|
||||
;; "~/phone/Nokia 6.1/Documents/Markor/Music/transcriptions.md")
|
||||
(emms-play-file "~/Music/christmas/Glee - Jingle Bell Rock (Lyrics)-VfLf7A_-1Vw.webm")
|
||||
(find-file "~/1-music-notation/3-my-transcriptions/Glee - Jingle Bell Rock/music/")
|
||||
(launch-file "~/1-music-notation/3-my-transcriptions/Glee - Jingle Bell Rock/output/Glee - Jingle Bell Rock-pacON.pdf"))
|
||||
("Video editing"
|
||||
(start-process "flatpak" (generate-new-buffer-name "kdenlive")
|
||||
"flatpak" "run" "org.kde.kdenlive"
|
||||
"/home/khilona/Videos/ghar ghar theatre 3/ggt3.kdenlive")
|
||||
(find-alternate-file-other-window "/home/khilona/Videos/ghar ghar theatre 3/"
|
||||
;; "/home/khilona/Videos/podcast/"
|
||||
))
|
||||
("Wiktionary"
|
||||
(find-file-other-window
|
||||
"~/phone/Nokia 6.1/Documents/Markor/Languages/hindi.md"))
|
||||
("Writing"
|
||||
(find-file-other-window
|
||||
"~/phone/Nokia 6.1/Documents/Markor/Songs or Poems/"))))
|
||||
|
||||
(autoload 'magit-anything-modified-p "magit")
|
||||
|
||||
(defun contrapunctus-commit-prompt ()
|
||||
"Prompt user if `default-directory' is a dirty Git repository.
|
||||
Return t if the user answers yes, if the repository is clean, or
|
||||
if there is no Git repository.
|
||||
|
||||
Return nil (and run `magit-status') if the user answers no."
|
||||
(cond ((not (magit-anything-modified-p)) t)
|
||||
((yes-or-no-p
|
||||
(format "You have uncommitted changes in %S. Really clock out? "
|
||||
default-directory)) t)
|
||||
(t (magit-status) nil)))
|
||||
|
||||
(defun contrapunctus-before-project-stop (project)
|
||||
(if (member project '("Composing" "Khilona archiving" "Programming"))
|
||||
(contrapunctus-commit-prompt)
|
||||
;; all functions in `chronometrist-before-project-stop-functions'
|
||||
;; must return t for successful clock-out
|
||||
t))
|
||||
|
||||
(require 'request)
|
||||
(require 'esxml-query)
|
||||
(defun contrapunctus-after-project-stop (project)
|
||||
(pcase project
|
||||
("OSM"
|
||||
(delete-other-windows)
|
||||
;; What should we do when there's no network connectivity?
|
||||
;; Ideally - note the clock-out time, and retry every five
|
||||
;; minutes. When connected, request the changesets, look for the
|
||||
;; first changeset with a "created_at" which is less than the
|
||||
;; clock-out time.
|
||||
(request
|
||||
"https://api.openstreetmap.org/api/0.6/changesets"
|
||||
:params '(("display_name" . "contrapunctus"))
|
||||
:parser (lambda () (libxml-parse-xml-region (point) (point-max)))
|
||||
:success
|
||||
(cl-function
|
||||
(lambda (&key data &allow-other-keys)
|
||||
(let* ((latest-changeset (-> data
|
||||
(esxml-node-children)
|
||||
(car)))
|
||||
(comment (->> latest-changeset
|
||||
(esxml-query "[k=comment]")
|
||||
(esxml-node-attributes)
|
||||
(cdr)
|
||||
(car)
|
||||
(cdr)))
|
||||
(id (-> latest-changeset
|
||||
(esxml-node-attributes)
|
||||
(car)
|
||||
(cdr))))
|
||||
(chronometrist-append-to-last-expr nil
|
||||
`(:osm-url ,(concat "https://www.openstreetmap.org/changeset/" id)
|
||||
:osm-comment ,comment)))))))
|
||||
(_ (delete-other-windows))))
|
||||
|
||||
(defun contrapunctus-count-expressions ()
|
||||
(interactive)
|
||||
(chronometrist-sexp-in-file chronometrist-file
|
||||
(goto-char (point-min))
|
||||
(cl-loop with count = 0
|
||||
while (ignore-errors (read (current-buffer)))
|
||||
do (cl-incf count)
|
||||
finally do (message "%s" count))))
|
||||
|
||||
;; Wrote these two as potential alternatives to `org-babel-tangle',
|
||||
;; which was far slower than I'd like (took around 20s for
|
||||
;; chronometrist.org when I checked during the migration process, and
|
||||
;; 43s after the migration was complete.) These, on the other hand,
|
||||
;; are almost instant, but I don't use them anywhere because I run a
|
||||
;; sed script as a file local variable.
|
||||
(defun chronometrist-tangle ()
|
||||
(goto-char (point-min))
|
||||
(cl-loop with source
|
||||
while (not (eobp))
|
||||
when (looking-at-p (rx (and line-start (zero-or-more blank) "#+BEGIN_SRC emacs-lisp" line-end)))
|
||||
concat (progn
|
||||
(forward-line 1)
|
||||
(buffer-substring-no-properties
|
||||
(point)
|
||||
(cl-loop while (not (eobp))
|
||||
if (looking-at-p (rx (and line-start
|
||||
(zero-or-more blank)
|
||||
"#+END_SRC"
|
||||
line-end)))
|
||||
do (cl-return (point))
|
||||
else do (forward-line 1)))) into source
|
||||
do (forward-line 1)
|
||||
finally do
|
||||
(with-current-buffer (find-file-noselect "chronometrist.el")
|
||||
(delete-region (point-min) (point-max))
|
||||
(insert source)
|
||||
(save-buffer))))
|
||||
|
||||
(defun chronometrist-tangle-sed ()
|
||||
(let* ((file-path (buffer-file-name
|
||||
(current-buffer)))
|
||||
(base (file-name-base file-path)))
|
||||
(when (equal "chronometrist.org" (file-name-nondirectory file-path))
|
||||
(start-process-shell-command
|
||||
"sed-tangle"
|
||||
(generate-new-buffer-name "sed-tangle")
|
||||
(format "sed -n '/#+BEGIN_SRC emacs-lisp$/,/#+END_SRC$/{//!p;}' ~s.org > ~s.el" base base)))))
|
||||
#+END_SRC
|
||||
** comint
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package comint
|
||||
:bind (:map comint-mode-map
|
||||
("M-p" . #'comint-previous-matching-input-from-input)
|
||||
("M-n" . #'comint-next-matching-input-from-input)))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** company-emoji
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package company-emoji
|
||||
:hook (text-mode . company-emoji-init)
|
||||
:config (add-to-list 'company-backends 'company-emoji))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** counsel
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package counsel
|
||||
:bind ("M-x" . counsel-M-x)
|
||||
|
@ -104,29 +506,22 @@
|
|||
;; (use-package elsa
|
||||
;; :commands flycheck-elsa-setup)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** misc keybindings
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(global-set-key (kbd "M-w") 'kill-ring-save)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(define-key emacs-lisp-mode-map (kbd "M-w") nil)
|
||||
;; ;; M-d is useful in the minibuffer
|
||||
;; (define-key emacs-lisp-mode-map (kbd "M-d") nil)
|
||||
;; (global-set-key (kbd "M-d") 'easy-kill-delete-region)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** easy-kill :disabled:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package easy-kill
|
||||
:disabled
|
||||
:bind (("M-w" . easy-kill)
|
||||
("M-d" . easy-kill-delete-region)))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** elpher :application:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package elpher
|
||||
:bind (:map elpher-mode-map
|
||||
|
@ -136,8 +531,7 @@
|
|||
("w" . elpher-copy-current-url)
|
||||
("W" . elpher-copy-link-url)))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** elfeed :application:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package elfeed
|
||||
:bind (:map elfeed-show-mode-map
|
||||
|
@ -146,31 +540,114 @@
|
|||
(add-to-list 'boon-special-mode-list 'elfeed-show-mode)
|
||||
(add-to-list 'boon-special-mode-list 'elfeed-search-mode))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** hydra
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package hydra
|
||||
:commands defhydra)
|
||||
#+END_SRC
|
||||
** TODO emms :application:
|
||||
1. [ ] make toggle command for emms-start/emms-stop
|
||||
2. [ ] change mode line display - don't show the whole file path, just the name
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(require 'cp-emms)
|
||||
#+END_SRC
|
||||
(use-package emms
|
||||
:after hydra
|
||||
:bind
|
||||
("<f2> e" . #'hydra-emms/body)
|
||||
("<f2> E" . #'emms)
|
||||
(:map dired-mode-map
|
||||
("E" . #'hydra-emms/body))
|
||||
:commands
|
||||
(emms-minimalistic emms emms-play-dired emms-add-dired)
|
||||
:config
|
||||
(emms-minimalistic)
|
||||
(emms-default-players)
|
||||
(setq emms-player-mpv-parameters
|
||||
(lambda ()
|
||||
(append
|
||||
'("--fs"
|
||||
"--quiet"
|
||||
"--really-quiet"
|
||||
;; "--vid=no"
|
||||
"--force-window=yes"
|
||||
"-ao=jack,alsa"
|
||||
;; "--loop-file=inf"
|
||||
)
|
||||
(let* ((dir (->> (emms-playlist-current-selected-track)
|
||||
(alist-get 'name)
|
||||
(file-name-directory)))
|
||||
(subs-in-dir (f-glob "*.srt" dir))
|
||||
(subs-in-subdir (f-glob "*/*.srt" dir)))
|
||||
(->> (append subs-in-dir subs-in-subdir)
|
||||
(-interpose ":")
|
||||
(append '("--sub-files="))
|
||||
(apply #'concat)
|
||||
(list))))))
|
||||
;; ;; This won't work for `emms-random', because it runs in a `save-excursion'
|
||||
;; (add-to-list 'emms-playlist-selection-changed-hook 'emms-playlist-mode-center-current)
|
||||
;; (--map (add-to-list 'emms-player-mpv-parameters it)
|
||||
;; '("--fs"))
|
||||
(defun contrapunctus-emms-toggle-player ()
|
||||
(interactive)
|
||||
(if emms-player-stopped-p
|
||||
(emms-start)
|
||||
(emms-stop)))
|
||||
:init (defhydra hydra-emms ()
|
||||
("e" #'emms "EMMS")
|
||||
("n" #'emms-next "Next")
|
||||
("p" #'emms-previous "Previous")
|
||||
("SPC" #'emms-pause "Pause")
|
||||
("s" #'contrapunctus-emms-toggle-player "Start/Stop")
|
||||
("0" #'emms-volume-raise)
|
||||
("9" #'emms-volume-lower)
|
||||
("<up>" #'emms-volume-raise)
|
||||
("<down>" #'emms-volume-lower)
|
||||
("<left>" #'emms-seek-backward)
|
||||
("<right>" #'emms-seek-forward)
|
||||
("l" #'emms-play-dired "Play file (dired)")
|
||||
("a" #'emms-add-dired "Add file (dired)")
|
||||
("A" #'emms-add-directory-tree "Add directory")
|
||||
("u" #'emms-play-url)))
|
||||
|
||||
**
|
||||
(use-package emms-playlist-mode
|
||||
:bind
|
||||
(:map emms-playlist-mode-map
|
||||
("0" . #'emms-volume-raise)
|
||||
("9" . #'emms-volume-lower)
|
||||
("<up>" . #'emms-volume-raise)
|
||||
("<down>" . #'emms-volume-lower)
|
||||
("<left>" . #'emms-seek-backward)
|
||||
("<right>" . #'emms-seek-forward)
|
||||
("n" . #'next-line)
|
||||
("p" . #'previous-line)
|
||||
("N" . #'emms-next)
|
||||
("P" . #'emms-previous)
|
||||
("R" . #'emms-toggle-random-playlist)
|
||||
("M-n" . #'emms-cue-next)
|
||||
("M-p" . #'emms-cue-previous)
|
||||
("SPC" . #'emms-pause))
|
||||
:config
|
||||
(setq emms-playlist-buffer-name "EMMS Playlist"))
|
||||
|
||||
(use-package emms-info-tinytag
|
||||
:init
|
||||
(setq emms-info-functions '(emms-info-tinytag))
|
||||
:config
|
||||
(setq emms-info-tinytag-python-name "python3"))
|
||||
|
||||
#+END_SRC
|
||||
** eshell
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package eshell
|
||||
:config (setq eshell-history-size 999))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** eww :application:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package eww
|
||||
:config
|
||||
(setq shr-image-animate nil)
|
||||
:bind
|
||||
;; start boon specific config
|
||||
;; start boon-specific config
|
||||
(:map shr-map
|
||||
("v" . nil))
|
||||
(:map shr-image-map
|
||||
|
@ -185,8 +662,14 @@
|
|||
("f" . #'eww-forward-url)
|
||||
("v" . nil)))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** url-cookie
|
||||
Ask for confirmation before saving cookies. I'd rather just disallow them all though 🤔
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package url-cookie
|
||||
:config
|
||||
(setq url-cookie-confirmation t))
|
||||
#+END_SRC
|
||||
** image-mode
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package image-mode
|
||||
:bind
|
||||
|
@ -195,15 +678,7 @@
|
|||
(:map image-mode-map
|
||||
("o" . nil)))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package url-cookie
|
||||
:config
|
||||
(setq url-cookie-confirmation t))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** flx-ido :disabled:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package flx-ido
|
||||
:disabled
|
||||
|
@ -211,8 +686,7 @@
|
|||
(setq ido-enable-flex-matching t
|
||||
ido-use-faces nil))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** flx-isearch :disabled:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package flx-isearch
|
||||
:disabled
|
||||
|
@ -227,14 +701,9 @@
|
|||
;; (use-package flycheck-elsa
|
||||
;; :hook (emacs-lisp-mode . flycheck-elsa-setup))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** environment variables
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setenv "PATH" (concat "/home/anon/bin:" (getenv "PATH")))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setenv "EDITOR" "emacsclient")
|
||||
|
||||
;; what on earth is this message after every init -
|
||||
|
@ -245,34 +714,15 @@
|
|||
;; ;; (toggle-debug-on-quit)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(require 'dash)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(require 's)
|
||||
;; (add-to-list 'load-path "~/.emacs.d/elisp-git/yafolding.el/")
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(add-to-list 'load-path "~/.emacs.d/user/")
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(add-to-list 'load-path "~/.emacs.d/contrapunctus/")
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(add-to-list 'load-path "~/.emacs.d/contrapunctus/fin/")
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
;; (add-to-list 'load-path "~/.emacs.d/contrapunctus/fin/")
|
||||
(add-to-list 'load-path "~/.emacs.d/contrapunctus/ido-mini/")
|
||||
#+END_SRC
|
||||
|
||||
|
@ -301,7 +751,7 @@
|
|||
;; update to use general, add M-f8 binding
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** misc keybindings
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(general-define-key
|
||||
"<f8>" 'keyboard-quit
|
||||
|
@ -320,67 +770,80 @@
|
|||
|
||||
;;;; UTF-8 magic
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** UTF-8 incantations
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq locale-coding-system 'utf-8)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(set-terminal-coding-system 'utf-8)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(set-keyboard-coding-system 'utf-8)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(set-selection-coding-system 'utf-8)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(prefer-coding-system 'utf-8)
|
||||
|
||||
;;;; Linewrapping
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** Linewrapping
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(add-hook 'org-mode-hook 'visual-line-mode)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(add-hook 'erc-mode-hook 'visual-line-mode)
|
||||
;(global-set-key (kbd "C-x t") 'toggle-truncate-lines)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(add-hook 'text-mode-hook 'visual-line-mode)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(require 'cp-md)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(cl-loop for hook in
|
||||
'(dired-mode-hook prog-mode-hook diff-mode-hook message-mode-hook)
|
||||
do (add-hook hook (lambda () (toggle-truncate-lines 1))))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(global-visual-line-mode -1)
|
||||
#+END_SRC
|
||||
|
||||
** markdown-mode :editing:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package markdown-mode
|
||||
:mode "\\.md\\'"
|
||||
:hook
|
||||
(markdown-mode . (lambda ()
|
||||
(make-local-variable 'before-save-hook)
|
||||
(add-hook 'before-save-hook 'markdown-cleanup-list-numbers)))
|
||||
(markdown-mode . markdown-display-inline-images)
|
||||
:config (setq markdown-command "cmark"
|
||||
markdown-css-paths '("style.css")
|
||||
markdown-display-remote-images t
|
||||
markdown-max-image-size '(500 . 500)
|
||||
;; reflows text to suit different screens
|
||||
markdown-xhtml-header-content
|
||||
(concat "<meta name=\"viewport\" "
|
||||
"content=\"width=device-width, "
|
||||
"initial-scale=1.0, "
|
||||
"user-scalable=yes\" />"))
|
||||
(when (featurep 'boon)
|
||||
(general-def markdown-mode-map
|
||||
"C-c ," 'markdown-promote
|
||||
"C-c ." 'markdown-demote
|
||||
"C-c C-e" 'markdown-export))
|
||||
(setq-default ;; markdown-hide-markup t ;; has a bug with heading cycling
|
||||
markdown-hide-urls t)
|
||||
:bind
|
||||
(:map markdown-mode-map
|
||||
;; ("M-n" . org-drag-element-forward)
|
||||
;; ("M-p" . org-drag-element-backward)
|
||||
;; ("C-c C-o" . markdown-follow-link-at-point)
|
||||
("M-n" . markdown-move-down)
|
||||
("M-p" . markdown-move-up)
|
||||
("C-c C--" . org-cycle-list-bullet)
|
||||
([mouse-1] . markdown-cycle)
|
||||
("C-c C-x C-n" . markdown-next-link)
|
||||
("C-c C-x C-p" . markdown-previous-link)
|
||||
|
||||
("C-c C-h C-u" . #'markdown-toggle-url-hiding)
|
||||
("C-c C-h C-m" . #'markdown-toggle-markup-hiding)
|
||||
("C-c C-h C-i" . #'markdown-toggle-inline-images)
|
||||
("C-c C-r" . #'reverse-region)))
|
||||
|
||||
(defun cp/copy-line-or-md-link (prefix-arg)
|
||||
(interactive "P")
|
||||
(save-excursion
|
||||
(beginning-of-line)
|
||||
(if (looking-at-p ".*http")
|
||||
(progn
|
||||
(cp/re-search-line "http")
|
||||
(forward-char -4)
|
||||
(kill-new (thing-at-point 'url))))))
|
||||
#+END_SRC
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq truncate-partial-width-windows nil
|
||||
|
@ -389,7 +852,7 @@
|
|||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(add-hook 'erc-mode-hook 'visual-line-mode)
|
||||
(add-hook 'erc-mode-hook 'visual-line-mode)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
|
@ -415,50 +878,23 @@
|
|||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq-default indent-tabs-mode nil)
|
||||
;;;; Fix scrolling
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** scrolling
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq scroll-conservatively 10000
|
||||
scroll-preserve-screen-position t)
|
||||
scroll-preserve-screen-position t
|
||||
auto-window-vscroll nil)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq auto-window-vscroll nil)
|
||||
;;; Recenter screen on isearch matches
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
** Recenter screen on isearch matches
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(add-hook 'isearch-mode-hook 'recenter)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(add-hook 'isearch-update-post-hook 'recenter)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defadvice isearch-repeat-forward
|
||||
(after isearch-repeat-forward-recenter activate) (recenter))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defadvice isearch-repeat-backward
|
||||
(after isearch-repeat-backward-recenter activate) (recenter))
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(ad-activate 'isearch-repeat-forward)
|
||||
#+END_SRC
|
||||
|
||||
**
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(ad-activate 'isearch-repeat-backward)
|
||||
#+END_SRC
|
||||
|
||||
|
|
Loading…
Reference in New Issue