Update org with capture and org-roam

This commit is contained in:
Lucas Barbieri 2024-04-24 23:21:08 -03:00
parent 0eb8525371
commit 46c798a58c
2 changed files with 205 additions and 120 deletions

View File

@ -5,10 +5,18 @@
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(helm-minibuffer-history-key "M-p") '(helm-minibuffer-history-key "M-p")
'(package-selected-packages '(package-selected-packages
'(org-modern-mode org-agenda-category-icons org-roam yasnippet-snippets which-key vue-mode projectile powerline-evil paredit magit lsp-ui lsp-pyright helm-xref golint flycheck flx evil-collection doom-themes dap-mode corfu company-go company-fuzzy beacon all-the-icons))) '(helm-rg helm-projectile yasnippet-snippets which-key vue-mode projectile powerline-evil paredit org-super-agenda org-roam org-modern magit lsp-ui lsp-pyright kaolin-themes helm-xref golint flycheck flx evil-collection doom-themes dap-mode corfu company-go company-fuzzy comment-tags beacon all-the-icons)))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
) '(org-document-title ((t (:inherit default :weight bold :foreground "black" :font "CartographCF Nerd Font" :height 1.7 :underline nil))))
'(org-level-1 ((t (:inherit default :weight bold :foreground "black" :font "CartographCF Nerd Font" :height 1.6))))
'(org-level-2 ((t (:inherit default :weight bold :foreground "black" :font "CartographCF Nerd Font" :height 1.4))))
'(org-level-3 ((t (:inherit default :weight bold :foreground "black" :font "CartographCF Nerd Font" :height 1.3))))
'(org-level-4 ((t (:inherit default :weight bold :foreground "black" :font "CartographCF Nerd Font" :height 1.2))))
'(org-level-5 ((t (:inherit default :weight bold :foreground "black" :font "CartographCF Nerd Font"))))
'(org-level-6 ((t (:inherit default :weight bold :foreground "black" :font "CartographCF Nerd Font"))))
'(org-level-7 ((t (:inherit default :weight bold :foreground "black" :font "CartographCF Nerd Font"))))
'(org-level-8 ((t (:inherit default :weight bold :foreground "black" :font "CartographCF Nerd Font")))))

View File

@ -96,153 +96,216 @@
:ensure t) :ensure t)
(use-package org-roam (use-package org-roam
:ensure t) :ensure t
:init
(setq org-roam-v2-ack t)
:custom
(org-roam-directory "~/org-roam")
:bind (("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n i" . org-roam-node-insert))
:config
(org-roam-setup))
(use-package org-modern (use-package org-modern
:config :config
(add-hook 'org-mode-hook #'org-modern-mode) (add-hook 'org-mode-hook #'org-modern-mode)
(add-hook 'org-agenda-finalize-hook #'org-modern-agenda) (add-hook 'org-agenda-finalize-hook #'org-modern-agenda)
:ensure t) :ensure t)
(modify-all-frames-parameters ;; Must do this so the agenda knows where to look for my files
'((right-divider-width . 40) (setq org-agenda-files '("~/org"))
(internal-border-width . 40)))
(dolist (face '(window-divider
window-divider-first-pixel
window-divider-last-pixel))
(face-spec-reset-face face)
(set-face-foreground face (face-attribute 'default :background)))
(set-face-background 'fringe (face-attribute 'default :background))
(setq ;; When a TODO is set to a done state, record a timestamp
;; Edit settings (setq org-log-done 'time)
org-auto-align-tags nil
org-tags-column 0
org-catch-invisible-edits 'show-and-error
org-special-ctrl-a/e t
org-insert-heading-respect-content t
;; Org styling, hide markup etc. ;; Follow the links
org-hide-emphasis-markers t (setq org-return-follows-link t)
org-pretty-entities t
org-ellipsis ""
;; Agenda styling ;; Associate all org files with org mode
org-agenda-tags-column 0 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
org-agenda-block-separator ?─
org-agenda-time-grid
'((daily today require-timed)
(800 1000 1200 1400 1600 1800 2000)
" ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄")
org-agenda-current-time-string
"◀── now ─────────────────────────────────────────────────")
(global-org-modern-mode) ;; Make the indentation look nicer
(add-hook 'org-mode-hook 'org-indent-mode)
;; Remap the change priority keys to use the UP or DOWN key
(define-key org-mode-map (kbd "C-c <up>") 'org-priority-up)
(define-key org-mode-map (kbd "C-c <down>") 'org-priority-down)
;; Shortcuts for storing links, viewing the agenda, and starting a capture
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(define-key global-map "\C-cc" 'org-capture)
;; When you want to change the level of an org item, use SMR
(define-key org-mode-map (kbd "C-c C-g C-r") 'org-shiftmetaright)
;; Hide the markers so you just see bold text as BOLD-TEXT and not *BOLD-TEXT*
(setq org-hide-emphasis-markers t)
;; Wrap the lines in org mode so that things are easier to read
(add-hook 'org-mode-hook 'visual-line-mode)
(let* ((variable-tuple
(cond ((x-list-fonts "CartographCF Nerd Font") '(:font "CartographCF Nerd Font"))
((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
((x-list-fonts "Lucida Grande") '(:font "Lucida Grande"))
((x-list-fonts "Verdana") '(:font "Verdana"))
((x-family-fonts "Sans Serif") '(:family "Sans Serif"))
(nil (warn "Cannot find a Sans Serif Font. Install Source Sans Pro."))))
(base-font-color (face-foreground 'default nil 'default))
(headline `(:inherit default :weight bold :foreground ,base-font-color)))
(custom-theme-set-faces
'user
`(org-level-8 ((t (,@headline ,@variable-tuple))))
`(org-level-7 ((t (,@headline ,@variable-tuple))))
`(org-level-6 ((t (,@headline ,@variable-tuple))))
`(org-level-5 ((t (,@headline ,@variable-tuple))))
`(org-level-4 ((t (,@headline ,@variable-tuple :height 1.2))))
`(org-level-3 ((t (,@headline ,@variable-tuple :height 1.3))))
`(org-level-2 ((t (,@headline ,@variable-tuple :height 1.4))))
`(org-level-1 ((t (,@headline ,@variable-tuple :height 1.6))))
`(org-document-title ((t (,@headline ,@variable-tuple :height 1.7 :underline nil))))))
(use-package org-super-agenda
:ensure t)
(use-package comment-tags
:ensure t)
(setq org-capture-templates
'(
("j" "Work Log Entry"
entry (file+datetree "~/org/work-log.org")
"* %?"
:empty-lines 0)
("n" "Note"
entry (file+headline "~/org/notes.org" "Random Notes")
"** %?"
:empty-lines 0)
("g" "General To-Do"
entry (file+headline "~/org/todos.org" "General Tasks")
"* TODO [#B] %?\n:Created: %T\n "
:empty-lines 0)
))
;; TODO states
(setq org-todo-keywords
'((sequence "TODO(t)" "PLANNING(p)" "IN-PROGRESS(i@/!)" "VERIFYING(v!)" "BLOCKED(b@)" "|" "DONE(d!)" "OBE(o@!)" "WONT-DO(w@/!)" )
))
(use-package powerline-evil (use-package powerline-evil
:ensure t) :ensure t)
(powerline-evil-vim-theme) (powerline-evil-vim-theme)
(powerline-evil-vim-color-theme) (powerline-evil-vim-color-theme)
(define-key evil-ex-map "e" 'find-file) (define-key evil-ex-map "e" 'find-file)
(define-key evil-ex-map "W" 'save-buffer) (define-key evil-ex-map "W" 'save-buffer)
(use-package company (use-package company
:ensure t :ensure t
:init :init
(setq company-require-match nil ; Don't require match, so you can still move your cursor as expected. (setq company-require-match nil ; Don't require match, so you can still move your cursor as expected.
company-tooltip-align-annotations t ; Align annotation to the right side. company-tooltip-align-annotations t ; Align annotation to the right side.
company-eclim-auto-save nil ; Stop eclim auto save. company-eclim-auto-save nil ; Stop eclim auto save.
company-dabbrev-downcase nil company-dabbrev-downcase nil
company-idle-delay 0.2) ; No downcase when completion. company-idle-delay 0.2) ; No downcase when completion.
:config :config
(global-company-mode t)) (global-company-mode t))
(use-package which-key (use-package which-key
:config :config
(setq which-key-idle-delay 0.3) (setq which-key-idle-delay 0.3)
(setq which-key-popup-type 'frame) (setq which-key-popup-type 'frame)
(which-key-mode) (which-key-mode)
(which-key-setup-minibuffer) (which-key-setup-minibuffer)
(set-face-attribute 'which-key-local-map-description-face nil (set-face-attribute 'which-key-local-map-description-face nil
:weight 'bold) :weight 'bold)
:ensure t) :ensure t)
(use-package magit (use-package magit
:ensure t :ensure t
:bind ("C-x g" . magit-status)) :bind ("C-x g" . magit-status))
(use-package paredit (use-package paredit
:ensure t :ensure t
:init :init
(add-hook 'clojure-mode-hook #'enable-paredit-mode) (add-hook 'clojure-mode-hook #'enable-paredit-mode)
(add-hook 'cider-repl-mode-hook #'enable-paredit-mode) (add-hook 'cider-repl-mode-hook #'enable-paredit-mode)
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) (add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode) (add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
(add-hook 'ielm-mode-hook #'enable-paredit-mode) (add-hook 'ielm-mode-hook #'enable-paredit-mode)
(add-hook 'lisp-mode-hook #'enable-paredit-mode) (add-hook 'lisp-mode-hook #'enable-paredit-mode)
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) (add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
(add-hook 'scheme-mode-hook #'enable-paredit-mode) (add-hook 'scheme-mode-hook #'enable-paredit-mode)
:config :config
(show-paren-mode t) (show-paren-mode t)
:bind (("M-[" . paredit-wrap-square) :bind (("M-[" . paredit-wrap-square)
("M-{" . paredit-wrap-curly)) ("M-{" . paredit-wrap-curly))
:diminish nil) :diminish nil)
(use-package yasnippet (use-package yasnippet
:ensure t :ensure t
:config :config
(yas-global-mode 1)) (yas-global-mode 1))
(use-package all-the-icons (use-package all-the-icons
:if (display-graphic-p) :if (display-graphic-p)
:ensure t) :ensure t)
(use-package company-fuzzy (use-package company-fuzzy
:hook (company-mode . company-fuzzy-mode) :hook (company-mode . company-fuzzy-mode)
:init :init
(setq company-fuzzy-sorting-backend 'flx (setq company-fuzzy-sorting-backend 'flx
company-fuzzy-prefix-on-top nil company-fuzzy-prefix-on-top nil
company-fuzzy-trigger-symbols '("." "->" "<" "\"" "'" "@"))) company-fuzzy-trigger-symbols '("." "->" "<" "\"" "'" "@")))
;; other configs ;; other configs
(global-hl-line-mode t) ;; This highlights the current line in the buffer (global-hl-line-mode t) ;; This highlights the current line in the buffer
(use-package beacon ;; This applies a beacon effect to the highlighted line (use-package beacon ;; This applies a beacon effect to the highlighted line
:ensure t :ensure t
:config :config
(beacon-mode 1)) (beacon-mode 1))
(use-package doom-themes ;; (use-package doom-themes
:ensure t ;; :ensure t
:config ;; :config
;; Global settings (defaults) ;; ;; Global settings (defaults)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled ;; (setq doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t) ; if nil, italics is universally disabled ;; doom-themes-enable-italic t) ; if nil, italics is universally disabled
(load-theme 'doom-sourcerer t) ;; (load-theme 'doom-sourcerer t)
;; Enable flashing mode-line on errors ;; ;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config) ;; (doom-themes-visual-bell-config)
;; Enable custom neotree theme (all-the-icons must be installed!) ;; ;; Enable custom neotree theme (all-the-icons must be installed!)
(doom-themes-neotree-config) ;; (doom-themes-neotree-config)
;; or for treemacs users ;; ;; or for treemacs users
(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme ;; (setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme
(doom-themes-treemacs-config) ;; (doom-themes-treemacs-config)
;; Corrects (and improves) org-mode's native fontification. ;; ;; Corrects (and improves) org-mode's native fontification.
(doom-themes-org-config)) ;; (doom-themes-org-config))
(use-package kaolin-themes
:ensure t
:config
(load-theme 'kaolin-dark t)
(kaolin-treemacs-theme))
(global-display-line-numbers-mode) (global-display-line-numbers-mode)
(setq display-line-numbers-type 'relative) (setq display-line-numbers-type 'relative)
(use-package projectile (use-package projectile
:ensure t :ensure t
:init :init
(projectile-mode +1) (projectile-mode +1)
:bind (:map projectile-mode-map :bind (:map projectile-mode-map
("C-c p" . projectile-command-map)) ("C-c p" . projectile-command-map))
:config :config
(setq projectile-project-search-path '("~/repos/" "~/work/" ))) (setq projectile-project-search-path '("~/repos/" "~/work/" )))
;; keybindings ;; keybindings
@ -250,7 +313,7 @@
(global-set-key (kbd "M->") 'next-buffer) (global-set-key (kbd "M->") 'next-buffer)
(evil-set-leader nil (kbd "SPC")) (evil-set-leader nil (kbd "SPC"))
(evil-define-key 'normal 'global (kbd "<leader>pv") (evil-define-key 'normal 'global (kbd "<leader>pv")
(lambda () (interactive) (dired default-directory))) (lambda () (interactive) (dired default-directory)))
(evil-define-key 'visual 'global (kbd "J") 'evil-collection-unimpaired-move-text-down) (evil-define-key 'visual 'global (kbd "J") 'evil-collection-unimpaired-move-text-down)
(evil-define-key 'visual 'global (kbd "K") 'evil-collection-unimpaired-move-text-up) (evil-define-key 'visual 'global (kbd "K") 'evil-collection-unimpaired-move-text-up)
@ -259,17 +322,31 @@
;; helm ;; helm
(use-package helm (use-package helm
:ensure t :ensure t
:config :config
(helm-mode 1) (helm-mode 1)
(global-set-key (kbd "C-x b") 'helm-buffers-list) (global-set-key (kbd "C-x b") 'helm-buffers-list)
(global-set-key (kbd "C-x r b") 'helm-boormarks) (global-set-key (kbd "C-x r b") 'helm-boormarks)
(global-set-key (kbd "C-x C-f") 'helm-find-files) (global-set-key (kbd "C-x C-f") 'helm-find-files)
(global-set-key (kbd "M-c") 'helm-calcul-expression) (global-set-key (kbd "M-c") 'helm-calcul-expression)
(global-set-key (kbd "C-x b") 'helm-buffers-list) (global-set-key (kbd "C-x b") 'helm-buffers-list)
(global-set-key (kbd "C-s") 'helm-occur) (global-set-key (kbd "C-s") 'helm-occur)
(global-set-key (kbd "M-x") 'helm-M-x) (global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "M-y") 'helm-show-kill-ring) (global-set-key (kbd "M-y") 'helm-show-kill-ring)
(global-set-key (kbd "C-h a") 'helm-apropos) (global-set-key (kbd "C-h a") 'helm-apropos)
(setq helm-split-window-in-side-p t (setq helm-split-window-in-side-p t
helm-move-to-line-cycle-in-source t)) helm-move-to-line-cycle-in-source t))
(defun my-switch-to-fzf (arg)
(interactive "p")
(let ((helm-current-dir (file-name-directory (helm-get-selection))))
(run-at-time nil nil
(lambda (dir)
(fzf/start dir)) helm-current-dir)
(helm-keyboard-quit)))
(use-package helm-projectile
:ensure t)
(evil-define-key 'normal 'global (kbd "<leader>sf")
(lambda () (interactive) (helm-projectile)))