]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Customize a bit
authorEshel Yaron <eshel@areionsec.com>
Sun, 3 Apr 2022 18:12:11 +0000 (21:12 +0300)
committerEshel Yaron <eshel@areionsec.com>
Sun, 3 Apr 2022 18:12:11 +0000 (21:12 +0300)
.emacs.d/etc/custom.el
.emacs.d/etc/gnus/init.el [new file with mode: 0644]
.emacs.d/init.el

index 6153bf0cb32398b0333f501bd80a0677fa37939c..24535b5842cefefc9f855cfc376dcdc4d05ade70 100644 (file)
  '(org-agenda-start-on-weekday 0)
  '(org-default-notes-file "~/inbox.org")
  '(package-selected-packages
-   '(cape corfu speed-type json-mode json-navigator flymake-swi-prolog package-lint package-lint-flymake all-the-icons-completion mct dap-ui auto-package-update zenburn-theme yasnippet-snippets yaml-mode yagist windswap whole-line-or-region whitespace-cleanup-mode which-key w3m vterm vlf vertico use-package unfill tramp terraform-mode terraform-doc symbol-overlay switch-window smartparens sketch-mode semi rustic rg reformatter rainbow-delimiters protobuf-mode proof-general pdf-tools page-break-lines org-superstar orderless ob-prolog ns-auto-titlebar no-littering multiple-cursors move-dup mode-line-bell markdown-toc markdown-changelog marginalia magit-todos lsp-ui lsp-java lsp-haskell lorem-ipsum list-unicode-display keyfreq keycast iedit idris-mode ibuffer-vc ibuffer-projectile ialign htmlize highlight-escape-sequences helpful graphviz-dot-mode go-mode gnu-elpa-keyring-update gitignore-mode github-review github-clone gitconfig-mode git-timemachine git-blamed ggtags fullframe forge flycheck-golangci-lint expand-region exec-path-from-shell esup erlang epresent embark-consult emacsql-sqlite3 elixir-mode ediprolog dtache dockerfile-mode disable-mouse diminish diff-hl define-word default-text-scale consult-flycheck company-quickhelp company-coq company-auctex command-log-mode bug-reference-github browse-kill-ring browse-at-remote beacon auctex-latexmk anzu all-the-icons alert affe ace-jump-mode academic-phrases))
- '(savehist-additional-variables '(esy/org-capture-to-project-heading-history-list)))
+   '(cov cape corfu speed-type json-mode json-navigator flymake-swi-prolog package-lint package-lint-flymake all-the-icons-completion mct dap-ui auto-package-update zenburn-theme yasnippet-snippets yaml-mode yagist windswap whole-line-or-region whitespace-cleanup-mode which-key w3m vterm vlf vertico use-package unfill tramp terraform-mode terraform-doc symbol-overlay switch-window smartparens sketch-mode semi rustic rg reformatter rainbow-delimiters protobuf-mode proof-general pdf-tools page-break-lines org-superstar orderless ob-prolog ns-auto-titlebar no-littering multiple-cursors move-dup mode-line-bell markdown-toc markdown-changelog marginalia magit-todos lsp-ui lsp-java lsp-haskell lorem-ipsum list-unicode-display keyfreq keycast iedit idris-mode ibuffer-vc ibuffer-projectile ialign htmlize highlight-escape-sequences helpful graphviz-dot-mode go-mode gnu-elpa-keyring-update gitignore-mode github-review github-clone gitconfig-mode git-timemachine git-blamed ggtags fullframe forge flycheck-golangci-lint expand-region exec-path-from-shell esup erlang epresent embark-consult emacsql-sqlite3 elixir-mode ediprolog dtache dockerfile-mode disable-mouse diminish diff-hl define-word default-text-scale consult-flycheck company-quickhelp company-coq company-auctex command-log-mode bug-reference-github browse-kill-ring browse-at-remote beacon auctex-latexmk anzu all-the-icons alert affe ace-jump-mode academic-phrases))
+ '(savehist-additional-variables '(esy/org-capture-to-project-heading-history-list))
+ '(send-mail-function 'smtpmail-send-it)
+ '(speed-type-max-chars 1024)
+ '(speed-type-min-chars 512))
 (custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
diff --git a/.emacs.d/etc/gnus/init.el b/.emacs.d/etc/gnus/init.el
new file mode 100644 (file)
index 0000000..4aaaaf9
--- /dev/null
@@ -0,0 +1,12 @@
+(setq user-mail-address "eshelshay.yaron@gmail.com"
+      user-full-name "Eshel Yaron")
+
+(setq gnus-select-method
+      '(nnimap "gmail"
+               (nnimap-address "imap.gmail.com")  ; it could also be imap.googlemail.com if that's your server.
+               (nnimap-server-port "imaps")
+               (nnimap-stream ssl)))
+
+(setq smtpmail-smtp-server "smtp.gmail.com"
+      smtpmail-smtp-service 587
+      gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")
index 6026b6056a1df2f882bbe2faaf7c4759562981d5..b62e6ef584a4c8ef8099f087cc68d65573088b83 100644 (file)
@@ -91,6 +91,7 @@
 
 (add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
 (add-hook 'prog-mode-hook 'display-line-numbers-mode)
+(add-hook 'prog-mode-hook 'display-fill-column-indicator-mode)
 
 (add-hook 'after-init-hook 'show-paren-mode)
 
 (global-set-key (kbd "C-x l") #'ialign)
 
 (global-set-key (kbd "C-x m") #'execute-extended-command)  ; bound to #'compose-mail by default
+(global-set-key (kbd "C-x M") #'execute-extended-command-for-buffer)
 
 (require 'keycast)
 
 (add-to-list 'auto-mode-alist '("\\.pl\\'" . prolog-mode))
 (add-to-list 'auto-mode-alist '("\\.plt\\'" . prolog-mode))
 
+(require 'ob-prolog)
+
 (define-derived-mode dapscript-mode
   prolog-mode "DAP script"
   "Major mode for dapscript source files."
 (defvar esy/inbox-path "~/inbox.org"
   "Path to my Org mode inbox file.")
 
+(defvar esy/projects-root-path "~/checkouts/"
+  "Path to the Projects Root directory.")
+
+(defun esy/read-project-directory ()
+  "Prompt for a project directory.
+Project directories are direct subdirectories of the Projects
+Root Directory defined by 'esy/projects-root-path'."
+  (read-directory-name "Project: " esy/projects-root-path))
+
 (defvar esy/org-capture-to-project-heading-history-list nil
   "History list for 'esy/org-capture-to-project-heading'.")
 
   (let* ((projects
           (org-map-entries `(lambda () (nth 4 (org-heading-components)))
                            "+project+LEVEL=2" (list esy/inbox-path)))
-         (choice (completing-read "Project: " projects nil t nil 'esy/org-capture-to-project-heading-history-list)))
-    (org-capture-set-target-location (list 'file+olp esy/inbox-path "Projects" choice))))
+         (choice (completing-read "Project: " projects nil t nil 'esy/org-capture-to-project-heading-history-list))
+         (m (org-find-olp (cons (org-capture-expand-file esy/inbox-path) (list "Projects" choice)))))
+    (set-buffer (marker-buffer m))
+    (org-capture-put-target-region-and-position)
+    (widen)
+    (goto-char m)
+    (set-marker m nil)))
+
+(require 'project)
+
+(defun esy/org-capture-to-current-project ()
+  "Prompt for a projects and capture a related task."
+  (let* ((projects
+          (org-map-entries `(lambda () (nth 4 (org-heading-components)))
+                           (concat "+project+LEVEL=2+SCM=\"file:"
+                                   (project-root (with-current-buffer
+                                                     (org-capture-get :original-buffer)
+                                                   (project-current)))
+                                   "\"")
+                           (list esy/inbox-path)))
+         (choice (car projects))
+         (m (org-find-olp (cons (org-capture-expand-file esy/inbox-path) (list "Projects" choice)))))
+    (set-buffer (marker-buffer m))
+    (org-capture-put-target-region-and-position)
+    (widen)
+    (goto-char m)
+    (set-marker m nil)))
 
 
 (setq org-capture-templates '(("t" "Todo [inbox]" entry
                                (file+headline esy/inbox-path "Tasks")
-                               "** TODO %?    %^g\n %i\n %t\n %a\n" :prepend t)
+                               "** TODO %^{Task}    %^g
+:PROPERTIES:
+:CreatedAt: %t
+:CapturedAt: %a
+:CapturedAs: Inbox Task
+:END:
+"
+                               :prepend t
+                               :empty-lines 1
+                               :immediate-finish t)
                               ("n" "New Project" entry
                                (file+headline esy/inbox-path "Projects")
-                               "** %?    %^g\n %i\n" :prepend t)
+                               "** %^{Name}    %^g
+:PROPERTIES:
+:CreatedAt: %t
+:CapturedAt: %a
+:CapturedAs: New Project
+:SCM: file:%(esy/read-project-directory)
+:END:
+"
+                               :prepend t
+                               :empty-lines 1
+                               :immediate-finish t)
                               ("p" "New Project Task" entry
                                (file+function esy/inbox-path esy/org-capture-to-project-heading)
-                               "*** TODO %?\n:PROPERTIES:\n:CreatedAt: %t\n:CapturedAt: %a\n:END:\n%i\n" :prepend t)))
+                               "*** TODO %?
+:PROPERTIES:
+:CreatedAt: %t
+:CapturedAt: %a
+:CapturedAs: Project Task
+:END:
+%i
+"
+                               :prepend t
+                               :empty-lines 1)
+                              ("Q" "Quick Project Task" entry
+                               (file+function esy/inbox-path esy/org-capture-to-project-heading)
+                               "*** TODO %^{Task}
+:PROPERTIES:
+:CreatedAt: %t
+:CapturedAt: %a
+:CaptuerdAs: Quick Project Task
+:END:
+%i
+"
+                               :prepend t
+                               :empty-lines 1
+                               :immediate-finish t)
+                              ("P" "Current Project Task" entry
+                               (file+function esy/inbox-path esy/org-capture-to-current-project)
+                               "*** TODO %^{Task}
+:PROPERTIES:
+:CreatedAt: %t
+:CapturedAt: %a
+:CaptuerdAs: Current Project Task
+:END:
+%i
+"
+                               :prepend t
+                               :empty-lines 1
+                               :immediate-finish t)))
+
+(setq org-capture-templates-contexts
+      '(("P" (list project-current))))
+
+(setq org-log-into-drawer t)
+
+(setq org-todo-keywords
+      '((sequence "TODO(t)" "BLOCKED(b@/!)" "INPROGRESS(i!)" "|" "DONE(d!)" "CANCELED(c@)")))
+
+(setq org-use-fast-todo-selection 'expert)
+
+(setq org-clock-in-switch-to-state "INPROGRESS")
+
+(setq org-babel-load-languages
+      '((emacs-lisp . t)
+        (shell      . t)
+        (prolog      . t)))
+
+(setq org-confirm-babel-evaluate nil)
 
 (global-set-key (kbd "C-c c") 'org-capture)
+(global-set-key (kbd "C-c a") 'org-agenda)
 
 
 (use-package org-superstar)
 
 (global-set-key [remap transpose-chars] #'backward-kill-word)
 
+(minibuffer-depth-indicate-mode)
+
+(display-time-mode)
+
+(require 'eww)
+
+(setq eww-auto-rename-buffer 'title)
+
+;; (require 'cov)
+
+;; (defun cov--swiplcov-parse (&optional buffer)
+;;   "Foo BUFFER."
+;;   (with-current-buffer (or buffer (current-buffer))
+;;       (save-excursion
+;;         (save-match-data
+;;           (save-restriction
+;;             (goto-char (point-min))
+;;             ...)))))
+
+
+;; (setq cov-coverage-file-paths
+;;       (list #'(lambda (file-dir file-name)
+;;                 (let ((path (concat file-dir
+;;                                     "/"
+;;                                     file-name
+;;                                     ".cov")))
+;;                   (and (file-exists-p try)
+;;                        (cons (file-truename try) 'swiplcov))))))
+
 (provide 'init)
 ;;; init.el ends here