Improved doom files and added clipmon

This commit is contained in:
Roger Gonzalez 2022-08-18 17:31:20 -03:00
parent 54ac8f44fd
commit d3d455f95c
2 changed files with 42 additions and 33 deletions

View File

@ -45,11 +45,7 @@
(custom-set-faces! (custom-set-faces!
'(font-lock-comment-face :slant italic) '(font-lock-comment-face :slant italic)
'(font-lock-keyword-face :slant italic)) '(font-lock-keyword-face :slant italic))
(setq doom-theme 'doom-badger) ;; obscuro, chulo (setq doom-theme 'doom-badger)
;; (setq doom-theme 'doom-oceanic-next) ;; primero original
;; (setq doom-theme 'doom-henna) ;; mucho verde + rojo. tambien ta bueno
;; (setq doom-theme 'doom-moonlight) ;; mucho morado. no esta mal
;; (setq doom-theme 'doom-tomorrow-night) ;; parecido a badger, sin integracion con ORG
;; If you use `org' and don't want your org files in the default location below, ;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads! ;; change `org-directory'. It must be set before org loads!
@ -120,10 +116,6 @@
(interactive) (interactive)
(helm-other-buffer '(helm-httpstatus-source) "*helm httpstatus*")) (helm-other-buffer '(helm-httpstatus-source) "*helm httpstatus*"))
;; Removes mouse from code
;; (mouse-avoidance-mode "animate")
;; Org Mode ;; Org Mode
(after! org (after! org
;; Include diary ;; Include diary
@ -169,14 +161,14 @@
(setq org-capture-templates (setq org-capture-templates
(quote (quote
( (
("G" "Define a goal" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/goal.org")) ("G" "Define a goal" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/goal.org") :empty-lines-after 2)
("R" "REPEAT entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/repeat.org")) ("R" "REPEAT entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/repeat.org") :empty-lines-before 2)
("N" "NEXT entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/next.org")) ("N" "NEXT entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/next.org") :empty-lines-before 2)
("T" "TODO entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/todo.org")) ("T" "TODO entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/todo.org") :empty-lines-before 2)
("W" "WAITING entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/waiting.org")) ("W" "WAITING entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/waiting.org") :empty-lines-before 2)
("S" "SOMEDAY entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/someday.org")) ("S" "SOMEDAY entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/someday.org") :empty-lines-before 2)
("P" "PROJ entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/proj.org")) ("P" "PROJ entry" entry (file+headline "~/org/capture.org" "Capture") (file "~/org/templates/proj.org") :empty-lines-before 2)
("B" "Book on the to-read-list" entry (file+headline "~/org/private.org" "Libros para leer") (file "~/org/templates/book.org")) ("B" "Book on the to-read-list" entry (file+headline "~/org/private.org" "Libros para leer") (file "~/org/templates/book.org") :empty-lines-after 2)
("p" "Create a daily plan") ("p" "Create a daily plan")
("pP" "Daily plan private" plain (file+olp+datetree "~/org/plan-free.org") (file "~/org/templates/dailyplan.org") :immediate-finish t) ("pP" "Daily plan private" plain (file+olp+datetree "~/org/plan-free.org") (file "~/org/templates/dailyplan.org") :immediate-finish t)
("pW" "Daily plan work" plain (file+olp+datetree "~/org/plan-work.org") (file "~/org/templates/dailyplan.org") :immediate-finish t) ("pW" "Daily plan work" plain (file+olp+datetree "~/org/plan-work.org") (file "~/org/templates/dailyplan.org") :immediate-finish t)
@ -294,6 +286,7 @@
(defun org-focus-all() "Set focus on all things." (defun org-focus-all() "Set focus on all things."
(interactive) (interactive)
(setq org-agenda-files '("~/org/"))) (setq org-agenda-files '("~/org/")))
(defun my/org-add-ids-to-headlines-in-file () (defun my/org-add-ids-to-headlines-in-file ()
"Add ID properties to all headlines in the current file which "Add ID properties to all headlines in the current file which
do not already have one." do not already have one."
@ -334,17 +327,21 @@ text and copying to the killring."
(when (member org-state org-done-keywords) ;; org-state dynamically bound in org.el/org-todo (when (member org-state org-done-keywords) ;; org-state dynamically bound in org.el/org-todo
(org-reset-checkbox-state-maybe))) (org-reset-checkbox-state-maybe)))
(add-hook 'org-after-todo-state-change-hook 'org-checklist)) (add-hook 'org-after-todo-state-change-hook 'org-checklist)
;; Save all org buffers on each save
(add-hook 'auto-save-hook 'org-save-all-org-buffers)
(add-hook 'after-save-hook 'org-save-all-org-buffers))
;; My own menu ;; My own menu
(map! :leader (map! :leader
(:prefix-map ("a" . "applications") (:prefix-map ("a" . "applications")
;; ispell :desc "HTTP Status cheatsheet" "h" #'helm-httpstatus)
:desc "Open vterm" "v" #'vterm (:prefix-map ("ao" . "org")
:desc "HTTP Status cheatsheet" "h" #'helm-httpstatus :desc "Org focus work" "w" #'org-focus-work
:desc "Run ispell" "i" #'ispell :desc "Org focus private" "p" #'org-focus-private
)) :desc "Org focus all" "a" #'org-focus-all
))
;; Python ;; Python
@ -356,9 +353,6 @@ text and copying to the killring."
(add-hook 'prog-mode-hook (lambda () (symbol-overlay-mode t))) (add-hook 'prog-mode-hook (lambda () (symbol-overlay-mode t)))
(setq enable-local-variables :all) (setq enable-local-variables :all)
;; (use-package python-pytest
;; :custom
;; (python-pytest-executable "/home/roger/code/lazer/certn/api_server/.docker-python-tests.sh"))
(elpy-enable) (elpy-enable)
(after! elpy (after! elpy
(set-company-backend! 'elpy-mode (set-company-backend! 'elpy-mode
@ -367,11 +361,13 @@ text and copying to the killring."
(remove-hook 'elpy-modules 'elpy-module-flymake) (remove-hook 'elpy-modules 'elpy-module-flymake)
(defun certn/new-spike () ;; Create new spikes, saved for later
"Create a new org spike in ~/org/Lazer/Certn/." ;; (defun certn/new-spike ()
(interactive) ;; "Create a new org spike in ~/org/Lazer/Certn/."
(let ((name (read-string "Ticket: "))) ;; (interactive)
(expand-file-name (format "%s.org" name) "~/org/Lazer/Certn/Spikes"))) ;; (let ((name (read-string "Ticket: ")))
;; (expand-file-name (format "%s.org" name) "~/org/Lazer/Certn/Spikes")))
;; Dashboard mode ;; Dashboard mode
(use-package dashboard (use-package dashboard
@ -380,7 +376,6 @@ text and copying to the killring."
(setq dashboard-set-file-icons t) (setq dashboard-set-file-icons t)
(setq dashboard-center-content nil) ;; set to 't' for centered content (setq dashboard-center-content nil) ;; set to 't' for centered content
(setq dashboard-items '((recents . 5) (setq dashboard-items '((recents . 5)
(agenda . 5)
(bookmarks . 5) (bookmarks . 5)
(projects . 5))) (projects . 5)))
(setq dashboard-set-navigator t) (setq dashboard-set-navigator t)
@ -390,3 +385,16 @@ text and copying to the killring."
(bookmarks . "book")))) (bookmarks . "book"))))
(setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
(setq doom-fallback-buffer-name "*dashboard*") (setq doom-fallback-buffer-name "*dashboard*")
(defun my/html2org-clipboard ()
"Convert clipboard contents from HTML to Org and then paste (yank)."
(interactive)
(kill-new (shell-command-to-string "timeout 1 xclip -selection clipboard -o -t text/html | pandoc -f html -t json | pandoc -f json -t org --wrap=none"))
(yank)
(message "Pasted HTML in org"))
(define-key org-mode-map (kbd "<f4>") 'my/html2org-clipboard)
;; Clipmon as emacs clipboard manager
(global-set-key (kbd "M-y") 'helm-show-kill-ring)
(add-to-list 'after-init-hook 'clipmon-mode-start)
(setq clipmon-timer-interval 1)

View File

@ -59,5 +59,6 @@
(package! ox-gfm) (package! ox-gfm)
(package! ox-clip) (package! ox-clip)
(package! dashboard) (package! dashboard)
(package! clipmon)
;; (package! lsp-python-ms :disable t) ;; (package! lsp-python-ms :disable t)