Capture dotfiles using org-captureSince I discovered org mode, I always was balancing between using symlinks and org babel tangle to manage my configuration. Now I'm in point that work related items are org babel managed and system level config is symlinked, because, often tools write back to their files. Another reason why I did not go full on babel was that I don't like workflow:1. found file that requires backup2. copy file3. paste in to org mode4. fill all details5. tangle.But yesterday I was visited by GNU spirit and she gave mi this org-capture template that reduces adding new file to backup to C-c k (my capture prefix) b (backup) and then tangle that file to original place: * [[%(project-root (project-current))]] [[%(abbreviate-file-name (org-capture-get :original-file))][%(file-relative-name (org-capture-get :original-file) (project-root (project-current)))]] - repository :: [[%(project-root (project-current))]] - file :: [[%(abbreviate-file-name (org-capture-get :original-file))][%(file-relative-name (org-capture-get :original-file) (project-root (project-current)))]] #+header: :tangle %(abbreviate-file-name (org-capture-get :original-file)) #+begin_src %^{Language|shell|elixir|nix|python|elisp|fundamental|eshell|conf} %(with-temp-buffer (insert-file-contents (org-capture-get :original-file)) (buffer-string)) #+end_srcI cannot comprehend how simple it is and how I never realized I could do this. Two think I think would be nice in future: \- if only it can automatically group those captures by project, but thinking of creating project backup capture template and simply refile from capture buffer \- automatic detangle so I can get back changes written by tools to their files, but not all of them support comments and many of them don't patch but dump state to file, so probably unsolvable using build in tools, only by elisp scriptingI'm trying to avoid longer elisp scripting for now 😄 What do you think?redd.it/1vowo7f@r_emacs