summaryrefslogtreecommitdiff
path: root/emacs_init
diff options
context:
space:
mode:
authoryaideltg <github.j9jab@aleeas.com>2023-08-22 23:21:56 +0200
committeryaideltg <github.j9jab@aleeas.com>2023-08-22 23:21:56 +0200
commit1b165e8879c4aaf3197646e1607b0cb91ca1cc6b (patch)
tree505cbc60929c8acce1e60d2ca54be38fc9939b1f /emacs_init
parent2ffae9b2e55656748e3273668a84f2339f15018c (diff)
downloadconfiguration files-1b165e8879c4aaf3197646e1607b0cb91ca1cc6b.tar.gz
configuration files-1b165e8879c4aaf3197646e1607b0cb91ca1cc6b.tar.bz2
configuration files-1b165e8879c4aaf3197646e1607b0cb91ca1cc6b.zip
Furhter modifications: org-capture from Elfeed, etc
Diffstat (limited to 'emacs_init')
-rw-r--r--emacs_init/dot_emacs.org365
1 files changed, 215 insertions, 150 deletions
diff --git a/emacs_init/dot_emacs.org b/emacs_init/dot_emacs.org
index ac785cb..159375c 100644
--- a/emacs_init/dot_emacs.org
+++ b/emacs_init/dot_emacs.org
@@ -468,6 +468,9 @@ Hide dotfiles by default, and add =super + h= keybinding to toggle:
;; (define-key dired-mode-map (kbd "s-h") 'dired-omit-mode)
#+END_SRC
** Elfeed
+:PROPERTIES:
+:ID: 4529071a-2ea8-4299-90b9-0593cc31ecda
+:END:
Load elfeed
@@ -553,6 +556,26 @@ Appearance settings:
;; (setq-default elfeed-curl-max-connections 100)
;; (setq-default elfeed-search-trailing-width 30)
#+END_SRC
+** Org-capture in Elfeed configuration
+
+When I am reading an article in [[id:4529071a-2ea8-4299-90b9-0593cc31ecda][Elfeed]], sometimes some idea popup and I want to capture it. Normally, I would have to manually copy the link, and then open the regular capture template I have and make the capture of the idea. What the following function does is to automate the copying part. The variable ~org-store-link-functions~ is set to ~ytg/org-elfeed-entry-store-link~, so in the =org-capture-template= dedicated to this purpose we can use =%a= to [[https://orgmode.org/manual/Template-expansion.html][retrieve the stored link]]. See the =org-capture-template= =Read later / take a note= on the section [[id:ebdfd897-7542-44e6-8413-632b41e7fb32][Org mode]] which makes use of this functions and hook by using =%a=, as previously explained.
+
+This solution was taken from [[https://yiming.dev/blog/2016/01/28/add-org-store-link-entry-for-elfeed/][this post of Yiming Chen]].
+
+#+begin_src emacs-lisp
+(defun ytg/org-elfeed-entry-store-link ()
+ (when elfeed-show-entry
+ (let* ((link (elfeed-entry-link elfeed-show-entry))
+ (title (elfeed-entry-title elfeed-show-entry)))
+ (org-store-link-props
+ :link link
+ :description title)
+ )))
+
+(add-hook 'org-store-link-functions
+ 'ytg/org-elfeed-entry-store-link)
+#+end_src
+
** Which-key
When typing in the M-x, it shows a list of possibilities
@@ -572,7 +595,6 @@ When typing in the M-x, it shows a list of possibilities
:ensure t
)
#+end_src
-
* Autocomplete
#+BEGIN_SRC emacs-lisp
;; (use-package auto-complete
@@ -606,6 +628,16 @@ When typing in the M-x, it shows a list of possibilities
:ensure t
)
#+end_src
+* Projectile
+
+#+begin_src emacs-lisp
+ (use-package projectile
+ :ensure t
+ :init
+ (projectile-mode +1)
+ :bind (:map projectile-mode-map
+ ("C-c p" . projectile-command-map)))
+#+end_src
* Spelling
#+begin_src emacs-lisp
@@ -747,6 +779,9 @@ Some resources to which you can refer here are:
- [[http://doc.norang.ca/org-mode.html][Bernt Hansen's guide]]
** Org mode
+:PROPERTIES:
+:ID: ebdfd897-7542-44e6-8413-632b41e7fb32
+:END:
Setting the name of the file where all the captured notes are going to.
@@ -769,159 +804,164 @@ The =org-agenda-files= configuration has been written in the section [[*Adding _
because it uses [[*Denote][Denote's]] tags in the file name to detect the project files and add them to the list.
#+begin_src emacs-lisp
- (use-package org
- :ensure t
- :hook
- (org-mode . flyspell-mode)
- (org-mode . visual-line-mode)
- (org-mode . org-indent-mode)
- :config
-
- ;; (setq org-adapt-indentation nil) ;; set the identation method in ORG mode
-
- (setq org-clock-persist 'history) ;; Clocking projects time settings to save clocking history throughout sessions
- (org-clock-persistence-insinuate)
- (setq org-clock-idle-time 10)
-
- (setq org-clock-out-remove-zero-time-clocks t) ;; Sometimes I change tasks I'm clocking quickly - this removes clocked tasks with 0:00 duration
- (setq calendar-week-start-day 1)
-
- ;;
- ;; Tasks and Todos
- (setq org-todo-keywords
- '((sequence "TODO(t)" "NEXT(n)" "WORKING(w)" "DELEGATED(g)" "|" "DONE(d)" "CANCELLED(x)")
- (sequence "COMPUTE(c)" "COMPUTING(p)" "|" "FINISHED(f)" "UNFINISHED(u)")))
- (setq org-todo-keyword-faces
- (quote (("TODO" :background "IndianRed1" :foreground "black" :weight bold)
- ("NEXT" :background "sky blue" :foreground "black" :weight bold)
- ("WORKING" :background "lemon chiffon" :foreground "black" :weight bold)
- ("COMPUTING" :background "lavender" :foreground "black" :weight bold)
- ("DONE" :background "DarkOliveGreen2" :foreground "black" :weight bold)
- ("CANCELLED" :background "DarkOliveGreen2" :foreground "black" :weight bold)
- ("DELEGATED" :background "aquamarine2" :foreground "black" :weight bold))))
- (setq org-tag-alist
- '(("@pyrene" . ?p) ("@curta" . ?c) ("@irene" . ?i) ("@project" . ?j) ("@someday" . ?s)))
-
- ;;
- ;; TODO states trigers
- (setq org-todo-state-tags-triggers
- (quote ((done ("@pyrene") ("@curta") ("@irene") ("@project") ("@someday")))))
-
- ;;
- ;; Capture
- (setq org-directory "/media/Datos/notes/")
- (setq org-default-notes-file (concat org-directory organizer-file))
- (global-set-key (kbd "C-c c") 'org-capture) ;; use C-c c to start capture mode
-
- ;; capture templates for: TODO tasks, Notes, appointments, meetings
- (setq org-templates-location-var (concat org-directory organizer-file))
- (setq org-capture-templates
- '(("t" "Todo" entry (file+headline org-templates-location-var "Inbox")
- "* TODO [#C] %? \nCaptured on %U")))
-
- ;; Refile
- ;; Targets include this file and any file contributing to the agenda - up to 9 levels deep
- ;; C-c C-w for refile
- (setq org-refile-targets (quote ((nil :maxlevel . 3)
- (org-agenda-files :maxlevel . 3))))
- ;;
- ;; Agenda customization
- ;;
- (global-set-key (kbd "C-c a") 'org-agenda)
- ;;
- ;; Format of the columns in the agenda view
- (setq org-columns-default-format-for-agenda "%65item(Task) %Effort(Effort){:} %clocksum_t(Today) %clocksum(Total)")
- ;; Format the habits tracker in the agenda buffer
- (setq org-habit-following-days 1)
- (setq org-habit-graph-column 80)
-
-
- (setq org-agenda-custom-commands
- '(("x" "My Agenda"
- ((agenda "" ((org-agenda-overriding-header "Today's Schedule:")
- (org-agenda-span 'day)
- (org-agenda-ndays 1)
- (org-agenda-start-on-weekday nil)
- (org-agenda-start-day "+0d")
- (org-agenda-sorting-strategy
- (quote
- (time-up deadline-down priority-down)))))
- (tags-todo "-@project/+WORKING"
- ((org-agenda-overriding-header "Tasks in progress")
- (org-agenda-sorting-strategy
- (quote
- (priority-down deadline-down effort-down)))))
- (tags-todo "-@project/+NEXT"
- ((org-agenda-overriding-header "Next tasks")
- (org-agenda-sorting-strategy
- (quote
- (priority-down deadline-down effort-down)))
- (org-agenda-max-entries 5)))
- (tags-todo "-@project/+TODO"
- ((org-agenda-overriding-header "TODOs")
- (org-agenda-sorting-strategy
- (quote
- (priority-down deadline-down effort-down)))
- (org-agenda-max-entries 5)))
- ;; (agenda ""
- ;; ((org-agenda-overriding-header "The Week in a Glance:")
- ;; (org-agenda-sorting-strategy
- ;; (quote
- ;; (time-up deadline-down priority-down)))))
- (tags "+@capture-@excludeFromAgenda"
- ((org-agenda-overriding-header "Items to refile")
- ;;(org-tags-match-list-sublevels nil)
- (org-agenda-sorting-strategy
- (quote
- (priority-down time-down)))))
- (org-agenda-list-stuck-projects)
- (tags "CLOSED<=\"<-1m>\""
- ((org-agenda-overriding-header "Items to archive (older than a month)")
- (org-agenda-span
- (quote month))))))
- ("c" "Computations"
- ((tags-todo "TODO=\"COMPUTING\"+@curta"
- ((org-agenda-overriding-header "Computations Curta")
- (org-agenda-sorting-strategy
- (quote
- (priority-down deadline-down effort-down)))))
- (tags-todo "TODO=\"COMPUTING\"+@pyrene"
- ((org-agenda-overriding-header "Computations Pyrene")
- (org-agenda-sorting-strategy
- (quote
- (priority-down deadline-down effort-down)))))
- (tags-todo "TODO=\"COMPUTING\"+@irene"
- ((org-agenda-overriding-header "Computations TGCC")
+ (use-package org
+ :ensure t
+ :hook
+ (org-mode . flyspell-mode)
+ (org-mode . visual-line-mode)
+ (org-mode . org-indent-mode)
+ :config
+
+ ;; (setq org-adapt-indentation nil) ;; set the identation method in ORG mode
+
+ (setq org-clock-persist 'history) ;; Clocking projects time settings to save clocking history throughout sessions
+ (org-clock-persistence-insinuate)
+ (setq org-clock-idle-time 10)
+
+ (setq org-clock-out-remove-zero-time-clocks t) ;; Sometimes I change tasks I'm clocking quickly - this removes clocked tasks with 0:00 duration
+ (setq calendar-week-start-day 1)
+
+ ;;
+ ;; Tasks and Todos
+ (setq org-todo-keywords
+ '((sequence "TODO(t)" "NEXT(n)" "WORKING(w)" "DELEGATED(g)" "|" "DONE(d)" "CANCELLED(x)")
+ (sequence "COMPUTE(c)" "COMPUTING(p)" "|" "FINISHED(f)" "UNFINISHED(u)")))
+ (setq org-todo-keyword-faces
+ (quote (("TODO" :background "IndianRed1" :foreground "black" :weight bold)
+ ("NEXT" :background "sky blue" :foreground "black" :weight bold)
+ ("WORKING" :background "lemon chiffon" :foreground "black" :weight bold)
+ ("COMPUTING" :background "lavender" :foreground "black" :weight bold)
+ ("DONE" :background "DarkOliveGreen2" :foreground "black" :weight bold)
+ ("CANCELLED" :background "DarkOliveGreen2" :foreground "black" :weight bold)
+ ("DELEGATED" :background "aquamarine2" :foreground "black" :weight bold))))
+ (setq org-tag-alist
+ '(("@pyrene" . ?p) ("@curta" . ?c) ("@irene" . ?i) ("@project" . ?j) ("@someday" . ?s)))
+
+ ;;
+ ;; TODO states trigers
+ (setq org-todo-state-tags-triggers
+ (quote ((done ("@pyrene") ("@curta") ("@irene") ("@project") ("@someday")))))
+
+ ;;
+ ;; Capture
+ (setq org-directory "/media/Datos/notes/")
+ (setq org-default-notes-file (concat org-directory organizer-file))
+ (setq org-health-tracking-file (concat org-directory "20230815T112721--health-tracking__health.org"))
+ (global-set-key (kbd "C-c c") 'org-capture) ;; use C-c c to start capture mode
+
+ ;; capture templates for: TODO tasks, Notes, appointments, meetings
+ (setq org-templates-location-var (concat org-directory organizer-file))
+ (setq org-capture-templates
+ '(("t" "Todo" entry (file+headline org-templates-location-var "Inbox")
+ "* TODO [#C] %? \nCaptured on %U")
+ ("h" "Health Tracking" entry (file+headline org-health-tracking-file "Daily data")
+ "* %t \n:PROPERTIES:\n:barras: %?\n:pararelas: \n:planchas: \n:abdominales: \n:dificultad: \n:ánimo: \n:tiempo: \n:sueño: \n:ayuno: \n:caminar: \n:END:")
+ ("n" "Read later / take a note" entry (file+headline org-templates-location-var "Inbox")
+ "* Note from %a\nCaptured on: %U\n\n%?*Highlighted region*: %i\n\n")))
+
+ ;; Refile
+ ;; Targets include this file and any file contributing to the agenda - up to 9 levels deep
+ ;; C-c C-w for refile
+ (setq org-refile-targets (quote ((nil :maxlevel . 3)
+ (org-agenda-files :maxlevel . 3))))
+ ;;
+ ;; Agenda customization
+ ;;
+ (global-set-key (kbd "C-c a") 'org-agenda)
+ ;;
+ ;; Format of the columns in the agenda view
+ (setq org-columns-default-format-for-agenda "%65item(Task) %Effort(Effort){:} %clocksum_t(Today) %clocksum(Total)")
+ ;; Format the habits tracker in the agenda buffer
+ (setq org-habit-following-days 1)
+ (setq org-habit-graph-column 80)
+
+
+ (setq org-agenda-custom-commands
+ '(("x" "My Agenda"
+ ((agenda "" ((org-agenda-overriding-header "Today's Schedule:")
+ (org-agenda-span 'day)
+ (org-agenda-ndays 1)
+ (org-agenda-start-on-weekday nil)
+ (org-agenda-start-day "+0d")
+ (org-agenda-sorting-strategy
+ (quote
+ (time-up deadline-down priority-down)))))
+ (tags-todo "-@project/+WORKING"
+ ((org-agenda-overriding-header "Tasks in progress")
+ (org-agenda-sorting-strategy
+ (quote
+ (priority-down deadline-down effort-down)))))
+ (tags-todo "-@project/+NEXT"
+ ((org-agenda-overriding-header "Next tasks")
+ (org-agenda-sorting-strategy
+ (quote
+ (priority-down deadline-down effort-down)))
+ (org-agenda-max-entries 5)))
+ (tags-todo "-@project/+TODO"
+ ((org-agenda-overriding-header "TODOs")
+ (org-agenda-sorting-strategy
+ (quote
+ (priority-down deadline-down effort-down)))
+ (org-agenda-max-entries 5)))
+ ;; (agenda ""
+ ;; ((org-agenda-overriding-header "The Week in a Glance:")
+ ;; (org-agenda-sorting-strategy
+ ;; (quote
+ ;; (time-up deadline-down priority-down)))))
+ (tags "+@capture-@excludeFromAgenda"
+ ((org-agenda-overriding-header "Items to refile")
+ ;;(org-tags-match-list-sublevels nil)
+ (org-agenda-sorting-strategy
+ (quote
+ (priority-down time-down)))))
+ (org-agenda-list-stuck-projects)
+ (tags "CLOSED<=\"<-1m>\""
+ ((org-agenda-overriding-header "Items to archive (older than a month)")
+ (org-agenda-span
+ (quote month))))))
+ ("c" "Computations"
+ ((tags-todo "TODO=\"COMPUTING\"+@curta"
+ ((org-agenda-overriding-header "Computations Curta")
(org-agenda-sorting-strategy
(quote
(priority-down deadline-down effort-down)))))
+ (tags-todo "TODO=\"COMPUTING\"+@pyrene"
+ ((org-agenda-overriding-header "Computations Pyrene")
+ (org-agenda-sorting-strategy
+ (quote
+ (priority-down deadline-down effort-down)))))
+ (tags-todo "TODO=\"COMPUTING\"+@irene"
+ ((org-agenda-overriding-header "Computations TGCC")
+ (org-agenda-sorting-strategy
+ (quote
+ (priority-down deadline-down effort-down)))))
+ ))
+ ("p" "Projects"
+ ((tags-todo "+@project/-DELEGATED-DONE-CANCELLED"
+ ((org-agenda-overriding-header "Working on:")
+ (org-agenda-sorting-strategy
+ (quote
+ (priority-down deadline-down effort-down)))))
+ (tags-todo "@project+@someday/-DELEGATED-DONE-CANCELLED"
+ ((org-agenda-overriding-header "Future Projects:")
+ (org-agenda-sorting-strategy
+ (quote
+ (priority-down deadline-down effort-down)))))
+ (org-agenda-list-stuck-projects)
+ ))
))
- ("p" "Projects"
- ((tags-todo "+@project/-DELEGATED-DONE-CANCELLED"
- ((org-agenda-overriding-header "Working on:")
- (org-agenda-sorting-strategy
- (quote
- (priority-down deadline-down effort-down)))))
- (tags-todo "@project+@someday/-DELEGATED-DONE-CANCELLED"
- ((org-agenda-overriding-header "Future Projects:")
- (org-agenda-sorting-strategy
- (quote
- (priority-down deadline-down effort-down)))))
- (org-agenda-list-stuck-projects)
- ))
- ))
- (setq org-stuck-projects
- '("+@project/-DONE-CANCELLED-DELEGATED" ;; entries considered as projects
- ("NEXT" "WORKING") ;; if none of these are present in the subtree, the project is stuck
- ("@someday") ;; list of tags identifying non-stuck projects
- "")) ;; arbitrary regular expression matching non-stuck projects
+ (setq org-stuck-projects
+ '("+@project/-DONE-CANCELLED-DELEGATED" ;; entries considered as projects
+ ("NEXT" "WORKING") ;; if none of these are present in the subtree, the project is stuck
+ ("@someday") ;; list of tags identifying non-stuck projects
+ "")) ;; arbitrary regular expression matching non-stuck projects
- ;; as the @project tag defines what is a project, I do not want all the sub-trees are marked also as projects
- ;; I want to manually set what are the projects
- (setq org-tags-exclude-from-inheritance '("@project" "project" "blog" "@excludeFromAgenda"))
+ ;; as the @project tag defines what is a project, I do not want all the sub-trees are marked also as projects
+ ;; I want to manually set what are the projects
+ (setq org-tags-exclude-from-inheritance '("@project" "project" "blog" "@excludeFromAgenda"))
- )
+ )
#+end_src
Furthermore, to automatically set the values displayed in the agenda identifying the file from where the task is being pulled from to the "humanized" name of the file in the file-system, Boris Buliga proposed the following configuration in [[https://d12frosted.io/posts/2020-06-24-task-management-with-roam-vol2.html][this blog post]]. Nevertheless, after some time using it, I removed it from my configuration. A simpler solution is just to specify the =#+category:= value in the heading of the =org= file
@@ -986,6 +1026,18 @@ Do not start the Agenda on Mondays, but the day you are on
(setq org-agenda-start-on-weekday nil)
#+end_src
+** Activate Babel languages (gnuplot, python, etc)
+
+To execute certain languages inside an org buffer and to use the data contained in it (ex. tables), you need to enable the language. See the documentation [[https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.html][in the case of gnuplot]] and [[https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html][in the case of python]] for more information.
+
+#+begin_src emacs-lisp
+ ;; active Babel languages
+ (org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((gnuplot . t)
+ (python . t)))
+#+end_src
+
** Org-bullets
#+BEGIN_SRC emacs-lisp
@@ -1144,8 +1196,8 @@ Facilitating the automatic loggin to the IRC server by using auth-source library
("C-c n f" . denote-open-or-create)
("C-c n n" . denote)
("C-c n l" . denote-link-or-create)
- ("C-c n B" . denote-link-find-file)
- ("C-c n b" . denote-link-backlinks)
+ ("C-c n B" . denote-find-link)
+ ("C-c n b" . denote-backlinks)
)
#+end_src
@@ -1467,10 +1519,23 @@ Figures polaroid like in a blog post
)
#+end_src
+* GNUPlot mode
+
+#+begin_src emacs-lisp
+ (use-package gnuplot-mode
+ :ensure t)
+#+end_src
+
+#+begin_src emacs-lisp
+ (use-package gnuplot
+ :ensure t)
+#+end_src
+
* Packages I want to try and probably use
- PDFTools: https://github.com/vedang/pdf-tools
- Org-noter: https://github.com/weirdNox/org-noter
- Org-Download: https://github.com/abo-abo/org-download
- Org-Protocol: https://orgmode.org/worg/org-contrib/org-protocol.html
-
+- Eglot: https://github.com/joaotavora/eglot
+ - It's like an auto-completion and helper major mode.