Commit 3d0ea9df6fe8
Changed files (22)
docs
tools
emacs
config
docs/emacs.org
@@ -498,7 +498,7 @@
the =Ubuntu= font are not available on the system, I am just letting Emacs start with its
default font.
-#+INCLUDE: "../tools/emacs/config/appearance.el" src emacs-lisp :range-begin "TypeFaceConfiguration" :range-end "-TypeFaceConfiguration" :lines "6-45"
+#+INCLUDE: "../tools/emacs/config/config-appearance.el" src emacs-lisp :range-begin "TypeFaceConfiguration" :range-end "-TypeFaceConfiguration" :lines "6-45"
** Typeface suitability test
:PROPERTIES:
@@ -601,7 +601,7 @@
** Org-mode (personal information manager)
:PROPERTIES:
-:header-args: :tangle config/setup-org.el
+:header-args: :tangle config/config-org.el
:CUSTOM_ID: h:c8fd2624-6c91-4b89-9645-4261ca85d584
:END:
@@ -646,7 +646,7 @@
First, let's define some basic constants, mainly on how my main =org= folder is organized.
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgConstants" :range-end "-OrgConstants" :lines "7-18"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgConstants" :range-end "-OrgConstants" :lines "7-18"
In a nutshell, I am currently trying the following organization, with =~/desktop/org/= as
the base of almost all =org-mode= things:
@@ -677,7 +677,7 @@
=inbox.org=. For this, we can use the emacs [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Registers.html][registers]] and more accurately the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Registers.html#File-Registers][file
registers]].
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgRegisters" :range-end "-OrgRegisters" :lines "21-26"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgRegisters" :range-end "-OrgRegisters" :lines "21-26"
With this, I can jump to the inbox with ~C-x r j i~, to the journal using ~C-x r j j~, โฆ
@@ -770,7 +770,7 @@
/The =ensure org-plus-contrib= is there to make sure I am loading the =org= module from my
nix configuration and not the built-in =org= module (that might lag in terms of version)/
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgMain" :range-end "-OrgMain" :lines "29-104"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgMain" :range-end "-OrgMain" :lines "29-104"
I've set-up an =org-mode= hook to add few modes to the default setup.
- I am really annoyed by trailing white-space so I want them to be shown
@@ -779,15 +779,15 @@
+ I turn on =auto-revert-mode= so that the buffer is always up-to-date.
+ I like to have header indented, so I'm enabling =org-indent-mode=.
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgHook" :range-end "-OrgHook" :lines "107-116"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgHook" :range-end "-OrgHook" :lines "107-116"
Let's also use =org-id=โฆ
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgId" :range-end "-OrgId" :lines "119-148"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgId" :range-end "-OrgId" :lines "119-148"
โฆ and =org-crypt= (for encrypted =org-mode= files).
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCrypt" :range-end "-OrgCrypt" :lines "151-156"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCrypt" :range-end "-OrgCrypt" :lines "151-156"
**** TODO Refiling
:PROPERTIES:
@@ -822,11 +822,11 @@
agenda views. This allows to group things and overall set-up the agenda view I want. This
agenda view uses the =n= key.
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgAgenda" :range-end "-OrgAgenda" :lines "159-208"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgAgenda" :range-end "-OrgAgenda" :lines "159-208"
Let's try to get my work calendar entries in my agenda too. It is a little bit tricky ๐ผ.
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgGcal" :range-end "-OrgGcal" :lines "211-225"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgGcal" :range-end "-OrgGcal" :lines "211-225"
*** Habits :ATTACH:
:PROPERTIES:
@@ -858,14 +858,14 @@
[[./images/2020-02-29-14-41-59.png]]
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgHabit" :range-end "-OrgHabit" :lines "228-233"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgHabit" :range-end "-OrgHabit" :lines "228-233"
*** TODO Sources
:PROPERTIES:
:CUSTOM_ID: h:82c3b800-9d80-408d-b3b6-54dc15b0590c
:END:
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgSrc" :range-end "-OrgSrc" :lines "236-243"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgSrc" :range-end "-OrgSrc" :lines "236-243"
*** TODO Capture
:PROPERTIES:
@@ -882,7 +882,7 @@
options. This is very interesting when you want to group some capture template together
(like templates related to /work/, โฆ).
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureStart" :range-end "-OrgCaptureStart" :lines "246-250"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureStart" :range-end "-OrgCaptureStart" :lines "246-250"
Some of my capture template are big and hard to read if embedded in the =emacs-lisp=
code. The good thing is that =org-mode= is able to load the template from files too ๐.
@@ -890,44 +890,44 @@
Here is a list of my templates:
- Default :: Store a link (mainly used with =org-protocol=) and take a random note
- #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureOldTemplate" :range-end "-OrgCaptureOldTemplate" :lines "253-262"
+ #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureOldTemplate" :range-end "-OrgCaptureOldTemplate" :lines "253-262"
- Tasks :: /work/ task, like reviewing a PR, or cleaning a folder.
- #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureTask" :range-end "-OrgCaptureTask" :lines "265-277"
+ #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureTask" :range-end "-OrgCaptureTask" :lines "265-277"
- journaling :: As I use =org-mode= for my /journal/ too, I need capture entry for
it. I currently have two types of journal entry :
- #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureJournalBase" :range-end "-OrgCaptureJournalBase" :lines "280-282"
+ #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureJournalBase" :range-end "-OrgCaptureJournalBase" :lines "280-282"
+ standard: one title and some text
#+INCLUDE: "../tools/emacs/etc/orgmode/journal.org" src org
- #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureJournalEntry" :range-end "-OrgCaptureJournalEntry" :lines "285-292"
+ #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureJournalEntry" :range-end "-OrgCaptureJournalEntry" :lines "285-292"
+ worklog: related to work, to be able to say what I did, what I wanted to do, problems,
โฆ during the daily
#+INCLUDE: "../tools/emacs/etc/orgmode/worklog.org" src org
- #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureWorklog" :range-end "-OrgCaptureWorklog" :lines "295-300"
+ #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureWorklog" :range-end "-OrgCaptureWorklog" :lines "295-300"
- weekly review :: each and every week, I am going through this item to make my review of
the week.
#+INCLUDE: "../tools/emacs/etc/orgmode/weekly.org" src org
- #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureWeekly" :range-end "-OrgCaptureWeekly" :lines "303-308"
+ #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureWeekly" :range-end "-OrgCaptureWeekly" :lines "303-308"
- blog posts ::
- #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureBlog" :range-end "-OrgCaptureBlog" :lines "318-320"
+ #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureBlog" :range-end "-OrgCaptureBlog" :lines "318-320"
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureEnd" :range-end "-OrgCaptureEnd" :lines "323-324"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureEnd" :range-end "-OrgCaptureEnd" :lines "323-324"
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgProtocol" :range-end "-OrgProtocol" :lines "327-329"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgProtocol" :range-end "-OrgProtocol" :lines "327-329"
*** Clocking
:PROPERTIES:
@@ -947,36 +947,35 @@
In addition to that workflow, I want to switch the state of the task to =STARTED= when I
am clocking-in, if it's not already =STARTED=.
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgClock" :range-end "-OrgClock" :lines "332-425"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgClock" :range-end "-OrgClock" :lines "332-425"
*** TODO Links
:PROPERTIES:
:CUSTOM_ID: h:afc81fbb-f7a0-401c-8b56-19f51edebd88
:END:
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgAttach" :range-end "-OrgAttach" :lines "428-433"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgAttach" :range-end "-OrgAttach" :lines "428-433"
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgLinks" :range-end "-OrgLinks" :lines "436-461"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgLinks" :range-end "-OrgLinks" :lines "436-461"
*** TODO Litterate programming
:PROPERTIES:
:CUSTOM_ID: h:b5f6beba-6195-4ff0-a194-502ac2a9e3da
:END:
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgBabel" :range-end "-OrgBabel" :lines "464-523"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgBabel" :range-end "-OrgBabel" :lines "464-523"
*** TODO Exporting
:PROPERTIES:
:CUSTOM_ID: h:afad00e0-367c-4c7b-b191-e3ed72be754b
:END:
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgExportConstants" :range-end "-OrgExportConstants" :lines "526-528"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgExportConstants" :range-end "-OrgExportConstants" :lines "526-528"
-#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgExportCfg" :range-end "-OrgExportCfg" :lines "531-542"
+#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgExportCfg" :range-end "-OrgExportCfg" :lines "531-542"
** TODO Email and newsgroup
:PROPERTIES:
-:header-args: :tangle config/setup-mails.el
:CUSTOM_ID: h:afa562d5-b07e-413b-8c1d-2d489fb72900
:END:
@@ -1002,7 +1001,7 @@
Before configuring any email client, we need to establish some essentials: who we are,
where our credentials are stored and whether encryption is supported.
-#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "AuthSource" :range-end "-AuthSource" :lines "4-9"
+#+INCLUDE: "../tools/emacs/config/config-mails.el" src emacs-lisp :range-begin "AuthSource" :range-end "-AuthSource" :lines "4-9"
*** Gnus
:PROPERTIES:
@@ -1202,16 +1201,16 @@
:CUSTOM_ID: h:8cd8c972-ba38-40c2-b30f-68a4233593d6
:END:
-#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "SendmailCfg" :range-end "-SendmailCfg" :lines "22-38"
+#+INCLUDE: "../tools/emacs/config/config-mails.el" src emacs-lisp :range-begin "SendmailCfg" :range-end "-SendmailCfg" :lines "22-38"
-#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "MessageCfg" :range-end "-MessageCfg" :lines "41-52"
+#+INCLUDE: "../tools/emacs/config/config-mails.el" src emacs-lisp :range-begin "MessageCfg" :range-end "-MessageCfg" :lines "41-52"
*** TODO ~notmuch~ configuration
:PROPERTIES:
:CUSTOM_ID: h:b67b377e-0fbc-4237-857c-641cdf2de1cf
:END:
-#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "Notmuch" :range-end "-Notmuch" :lines "55-72"
+#+INCLUDE: "../tools/emacs/config/config-mails.el" src emacs-lisp :range-begin "Notmuch" :range-end "-Notmuch" :lines "55-72"
* User interface and interactions
:PROPERTIES:
tools/emacs/config/appearance.el โ tools/emacs/config/config-appearance.el
File renamed without changes
tools/emacs/config/setup-buffers.el โ tools/emacs/config/config-buffers.el
File renamed without changes
tools/emacs/config/setup-compile.el โ tools/emacs/config/config-compile.el
File renamed without changes
tools/emacs/config/setup-completion.el โ tools/emacs/config/config-completion.el
@@ -172,7 +172,7 @@ With universal argument ARG or when not in project, rely on
Otherwise, use `projectile-switch-to-project'."
(interactive "P")
(if (or arg (not (projectile-project-p)))
- (switch-to-buffer)
+ (call-interactively 'switch-to-buffer)
(projectile-switch-to-buffer)))
:bind (:map icomplete-minibuffer-map
tools/emacs/config/setup-dired.el โ tools/emacs/config/config-dired.el
File renamed without changes
tools/emacs/config/setup-editing.el โ tools/emacs/config/config-editing.el
File renamed without changes
tools/emacs/config/setup-files.el โ tools/emacs/config/config-files.el
File renamed without changes
tools/emacs/config/02-help.el โ tools/emacs/config/config-help.el
File renamed without changes
tools/emacs/config/setup-keybindings.el โ tools/emacs/config/config-keybindings.el
File renamed without changes
tools/emacs/config/setup-mails.el โ tools/emacs/config/config-mails.el
File renamed without changes
tools/emacs/config/setup-org.el โ tools/emacs/config/config-org.el
File renamed without changes
tools/emacs/config/setup-projectile.el โ tools/emacs/config/config-projects.el
File renamed without changes
tools/emacs/config/setup-search.el โ tools/emacs/config/config-search.el
File renamed without changes
tools/emacs/config/setup-shells.el โ tools/emacs/config/config-shells.el
File renamed without changes
tools/emacs/config/setup-vcs.el โ tools/emacs/config/config-vcs.el
@@ -1,11 +1,54 @@
-;;; -*- lexical-binding: t; -*-
-(use-package vc-hooks ; Simple version control
- :disabled
- :bind (("S-<f5>" . vc-revert)
- ("C-c v r" . vc-refresh-state))
+;;; config-vcs.el --- -*- lexical-binding: t; -*-
+;;; Commentary:
+;;; Version control configuration
+;;; Code:
+
+;; UseVC
+(use-package vc
:config
- ;; Always follow symlinks to files in VCS repos
- (setq-default vc-follow-symlinks t))
+ (setq-default vc-find-revision-no-save t
+ vc-follow-symlinks t)
+ :bind (("C-x v f" . vc-log-incoming) ; git fetch
+ ("C-x v F" . vc-update)
+ ("C-x v d" . vc-diff)))
+;; -UseVC
+
+;; UseVCDir
+(use-package vc-dir
+ :config
+ (defun vde/vc-dir-project ()
+ "Unconditionally display `vc-diff' for the current project."
+ (interactive)
+ (vc-dir (vc-root-dir)))
+
+ (defun vde/vc-dir-jump ()
+ "Jump to present directory in a `vc-dir' buffer."
+ (interactive)
+ (vc-dir default-directory))
+ :bind (("C-x v p" . vde/vc-dir-project)
+ ("C-x v j" . vde/vc-dir-jump) ; similar to `dired-jump'
+ :map vc-dir-mode-map
+ ("f" . vc-log-incoming) ; replaces `vc-dir-find-file' (use RET)
+ ("F" . vc-update) ; symmetric with P: `vc-push'
+ ("d" . vc-diff) ; align with D: `vc-root-diff'
+ ("k" . vc-dir-clean-files)))
+;; -UseVCDir
+
+;; UseVCGit
+(use-package vc-git
+ :config
+ (setq vc-git-diff-switches "--patch-with-stat")
+ (setq vc-git-print-log-follow t))
+;; -UseVCGit
+
+;; UseVCAnnotate
+(use-package vc-annotate
+ :config
+ (setq vc-annotate-display-mode 'scale) ; scale to oldest
+ :bind (("C-x v a" . vc-annotate) ; `vc-update-change-log' is not in git
+ :map vc-annotate-mode-map
+ ("t" . vc-annotate-toggle-annotation-visibility)))
+;; -UseVcAnnotate
(use-package magit ; The best Git client out there
:disabled
@@ -117,3 +160,4 @@
(kill-buffer commit-buf)))
(provide 'setup-vcs)
+;;; setup-vcs.el ends here
tools/emacs/config/setup-windows.el โ tools/emacs/config/config-windows.el
File renamed without changes
tools/emacs/config/setup-docker.el โ tools/emacs/config/programming-docker.el
File renamed without changes
tools/emacs/config/setup-go.el โ tools/emacs/config/programming-go.el
File renamed without changes
tools/emacs/config/setup-nix.el โ tools/emacs/config/programming-nix.el
File renamed without changes
tools/emacs/config/setup-hydras.el
@@ -1,69 +0,0 @@
-;;; -*- lexical-binding: t; -*-
-(when nil
- (progn
- (defhydra hydra-goto-line (goto-map "")
- "goto-line"
- ("g" goto-line "go")
- ("m" set-mark-command "mark" :bind nil)
- ("q" nil "quit"))
-
- (defhydra hydra-yank-pop ()
- "yank"
- ("C-y" yank nil)
- ("M-y" yank-pop nil)
- ("y" (yank-pop 1) "next")
- ("Y" (yank-pop -1) "prev")) ; or browse-kill-ring
-
- (defhydra hydra-zoom (global-map "<f2>")
- "zoom"
- ("g" text-scale-increase "in")
- ("l" text-scale-decrease "out")
- ("r" (text-scale-set 0) "reset")
- ("0" (text-scale-set 0) :bind nil :exit t)
- ("1" (text-scale-set 0) nil :bind nil :exit t))
-
- ;; Better shrink/enlarge windows
- (defhydra hydra-resize (global-map "<f2>")
- "resize windows"
- ("<up>" enlarge-window "enlarge")
- ("<down>" shrink-window "shrink")
- ("<left>" shrink-window-horizontally "shrink horizontaly")
- ("<right>" enlarge-window-horizontally "enlarge horizontaly"))
-
- (defvar hide-mode-line-mode nil)
- (defvar whitespace-mode nil)
- (defvar subword-mode nil)
- (defhydra hydra-toggle (:color pink :hint nil)
- "
-_a_ abbrev-mode: %`abbrev-mode
-_b_ subword-mode: %`subword-mode
-_d_ debug-on-error: %`debug-on-error
-_h_ hide-mode-line-mode %`hide-mode-line-mode
-_f_ auto-fill-mode: %`auto-fill-function
-_r_ readonly-mode: %`buffer-read-only
-_t_ truncate-lines %`truncate-lines
-_v_ visual-line-mode: %`visual-line-mode
-_w_ whitespace-mode: %`whitespace-mode
-_s_ smartparens-strict: %`smartparens-strict-mode
-_V_ visible-mode: %`visible-mode
-"
- ("a" abbrev-mode nil)
- ("b" subword-mode nil)
- ("d" toggle-debug-on-error nil)
- ("f" auto-fill-mode nil)
- ("h" hide-mode-line-mode nil)
- ("r" dired-toggle-read-only nil)
- ("t" toggle-truncate-lines nil)
- ("v" visual-line-mode nil)
- ("V" visible-mode nil)
- ("w" whitespace-mode nil)
- ("s" smartparens-strict-mode nil)
- ("q" nil "quit"))
-
- (global-set-key (kbd "C-c C-v") 'hydra-toggle/body)
-
- (bind-key "M-y" #'hydra-yank-pop/yank-pop)
- (bind-key "C-y" #'hydra-yank-pop/yank)
- ))
-
-(provide 'setup-hydras)