commit 1678c9774799239706e8fb0446158a405eed7c1d parent e3a1f01e1cc0be3584ebbc6aadcecf8a1a267b68 Author: Yohanes Bandung Bondowoso <hi@ybbond.dev> Date: Fri, 26 Jun 2020 23:04:58 +0700 update doom settings and init.vim Diffstat:
| M | .config/nvim/init.vim | | | 18 | +++++++++--------- |
| M | .doom.d/+org.el | | | 60 | +++++++++++++++++++++++++++++++++++++++--------------------- |
| M | .doom.d/+ui.el | | | 44 | ++++++++++++++++++++++++++++++++++++-------- |
| M | .doom.d/config.el | | | 2 | +- |
| M | .doom.d/init.el | | | 7 | +++++-- |
| M | .doom.d/packages.el | | | 9 | +++++++++ |
6 files changed, 99 insertions(+), 41 deletions(-)
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -268,15 +268,15 @@ nnoremap gB :bprevious<cr> map F <Plug>Sneak_F map t <Plug>Sneak_t map T <Plug>Sneak_T - " 2-character Sneak (default) - nmap Q <Plug>Sneak_s - nmap <leader>Q <Plug>Sneak_S - " visual-mode - xmap Q <Plug>Sneak_s - xmap <leader>Q <Plug>Sneak_S - " operator-pending-mode - omap Q <Plug>Sneak_s - omap <leader>Q <Plug>Sneak_S + " " 2-character Sneak (default) + " nmap Q <Plug>Sneak_s + " nmap <leader>Q <Plug>Sneak_S + " " visual-mode + " xmap Q <Plug>Sneak_s + " xmap <leader>Q <Plug>Sneak_S + " " operator-pending-mode + " omap Q <Plug>Sneak_s + " omap <leader>Q <Plug>Sneak_S " |vim-fugitive| map <leader>kp :Gdiff!<cr> diff --git a/.doom.d/+org.el b/.doom.d/+org.el @@ -2,12 +2,12 @@ ;; source https://github.com/theianjones/dotfiles/blob/master/.doom.d/+org.el -;; (setq org_notes "~/Library/Mobile Documents/com\~apple\~CloudDocs/Notes" -(setq org_notes "~/Notes" +(setq org_notes "~/Library/Mobile Documents/com\~apple\~CloudDocs/Notes" +; (setq org_notes "~/Notes" org-directory org_notes deft-directory org_notes org-roam-directory org_notes - org-roam-db-location "~/Notes/org-roam.db" + org-roam-db-location "~/Library/Mobile Documents/com\~apple\~CloudDocs/Notes/org-roam.db" org-id-link-to-org-use-id t org-ellipsis " ▼ ") @@ -30,12 +30,19 @@ (after! org-roam (add-hook 'after-init-hook 'org-roam-mode) + :config (setq org-roam-graph-viewer "/usr/bin/open") (setq org-roam-capture-ref-templates '(("r" "ref" plain (function org-roam-capture--get-point) "%?" :file-name "websites/${slug}" - :head "#+title: ${title}\n#+author: ${author}\n#+roam_key: ${ref}\n#+roam_tags: websites\n- source :: ${ref}" + :head "#+title: ${title} +#+author: ${author} +#+roam_key: ${ref} +#+roam_tags: web_references +- tags :: [[file:../tags/20200626210745-t_web_references.org|t:web_references]] +- saved :: ${savedDate} +- source :: ${ref}\n\n* Highlights\n" :unnarrowed t)))) (setq org-roam-dailies-capture-templates @@ -57,15 +64,26 @@ :file-name "tags/%<%Y%m%d%H%M%S>-${slug}" :head "#+title: ${title}\n#+roam_tags: tags" :unnarrowed t) + ("c" "companies" plain (function org-roam-capture--get-point) + "%?" + :file-name "companies/%<%Y%m%d%H%M%S>-${slug}" + :head "#+title: ${title} +#+roam_tags: companies +- tags :: [[file:../tags/20200626210315-t_companies.org|t:companies]]\n" + :unnarrowed t) ("p" "products" plain (function org-roam-capture--get-point) "%?" :file-name "products/%<%Y%m%d%H%M%S>-${slug}" - :head "#+title: ${title}\n#+roam_tags: products\n" + :head "#+title: ${title} +#+roam_tags: products +- tags :: [[file:../tags/20200626205545-t_products.org|t:products]]\n" :unnarrowed t) ("i" "people" plain (function org-roam-capture--get-point) "%?" :file-name "people/%<%Y%m%d%H%M%S>-${slug}" - :head "#+title: ${title}\n#+roam_tags: people\n" + :head "#+title: ${title} +#+roam_tags: people +- tags :: [[file:../tags/20200626210651-t_people.org|t:people]]\n" :unnarrowed t))) (use-package! deft @@ -83,7 +101,7 @@ :bind ("C-c n j" . org-journal-new-entry) :config - (setq org-journal-dir "~/Notes/journals/") + (setq org-journal-dir "~/Library/Mobile Documents/com\~apple\~CloudDocs/Notes/journals/") (setq org-journal-date-prefix "#+title: ") (setq org-journal-file-format "%Y-%m-%d.org") (setq org-journal-date-format "%A, %d %B %Y\n#+roam_tags: journals\n")) @@ -94,7 +112,7 @@ :n "M-j" #'org-metadown :n "M-k" #'orge-metaup)) -;; (use-package org-roam-server +;; (use-package! org-roam-server ;; :ensure t) ;; (add-hook 'org-roam-server-mode (lambda () (browse-url-chrome "http://localhost:3001"))) @@ -102,18 +120,18 @@ ;; Refile a heading to another buffer ;; Allows you to refile into different files - specifically to ;; create new 'parent' headings -;; (setq org-refile-use-outline-path 'file) +(setq org-refile-use-outline-path 'file) ;; makes org-refile outline working with helm/ivy -;; (setq org-outline-path-complete-in-steps nil) -;; (setq org-refile-allow-creating-parent-nodes 'confirm) -;; (defun +org/opened-buffer-files () +(setq org-outline-path-complete-in-steps nil) +(setq org-refile-allow-creating-parent-nodes 'confirm) +(defun +org/opened-buffer-files () ;; "Return the list of files currently opened in emacs" -;; (delq nil -;; (mapcar (lambda (x) -;; (if (and (buffer-file-name x) -;; (string-match "\\.org$" -;; (buffer-file-name x))) -;; (buffer-file-name x))) -;; (buffer-list)))) - -;; (setq org-refile-targets '((+org/opened-buffer-files :maxlevel . 9))) + (delq nil + (mapcar (lambda (x) + (if (and (buffer-file-name x) + (string-match "\\.org$" + (buffer-file-name x))) + (buffer-file-name x))) + (buffer-list)))) + +(setq org-refile-targets '((+org/opened-buffer-files :maxlevel . 9))) diff --git a/.doom.d/+ui.el b/.doom.d/+ui.el @@ -30,13 +30,41 @@ ;; numbers are disabled. For relative line numbers, set this to `relative'. (setq display-line-numbers-type 'relative) -;; Disable clipboard altogether. -;; Use clipboard register to copy-paste with system clipboard! +;; Emacs Configurations (setq select-enable-clipboard nil) -;; (after! dired -;; ;; (setq dired-listing-switches "-aBhl --group-directories-first" -;; (setq dired-listing-switches "-aBhl" -;; dired-dwim-target t -;; dired-recursive-copies (quote always) -;; dired-recursive-deletes (quote top))) +;; remove hook for clipboard configurations from emacs to command mode +(remove-hook 'tty-setup-hook 'doom-init-clipboard-in-tty-emacs-h) + +;; enable ⌘+c and ⌘+v for clipboard handling +(defun rc-clipboard-yank () + "Copies the active region to the system clipboard." + (interactive) + (when (region-active-p) + (gui-set-selection 'CLIPBOARD + (buffer-substring (region-beginning) (region-end))))) +(defun rc-clipboard-paste () + "Pastes text from the system clipboard." + (interactive) + (let ((text (gui-get-selection 'CLIPBOARD))) + (when text (insert-for-yank text)))) +(map! :v "s-c" #'rc-clipboard-yank + :nvi "s-v" #'rc-clipboard-paste) +(define-key! :keymaps '(evil-ex-completion-map) "s-v" #'rc-clipboard-paste) +(define-key! :keymaps +default-minibuffer-maps "s-v" #'rc-clipboard-paste) + +;; Snipe +(after! evil-snipe + (setq evil-snipe-smart-case t) + (setq evil-snipe-scope 'whole-buffer) + (setq evil-snipe-auto-scroll t) + (setq evil-snipe-repeat-keys t) + (setq evil-snipe-repeat-scope 'whole-buffer)) + +;; Dired +(after! dired + ;; (setq dired-listing-switches "-aBhl --group-directories-first" + (setq dired-listing-switches "-aBhl" + dired-dwim-target t + dired-recursive-copies (quote always) + dired-recursive-deletes (quote top))) diff --git a/.doom.d/config.el b/.doom.d/config.el @@ -36,4 +36,4 @@ ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how ;; they are implemented. -(map! :iv "s-v" (lambda! (evil-paste-from-register ?+))) +;; (map! :iv "s-v" (lambda! (evil-paste-from-register ?+))) diff --git a/.doom.d/init.el b/.doom.d/init.el @@ -178,6 +178,9 @@ ;;literate (default +bindings +smartparens)) - -;; Respects soft line wrapping navigation +;; Evil Configurations (setq evil-respect-visual-line-mode t) +(setq evil-move-cursor-back nil) +(setq evil-esc-delay 1) +(setq evil-kill-on-visual-paste nil) +;; (setq evil-want-minibuffer t) diff --git a/.doom.d/packages.el b/.doom.d/packages.el @@ -48,3 +48,12 @@ ;(unpin! pinned-package another-pinned-package) ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) ;(unpin! t) + +(package! org-journal) +;; (package! org-roam-server +;; :recipe (:host github :repo "org-roam/org-roam-server")) +;; (use-package! easy-hugo +;; :init +;; (setq easy-hugo-basedir "~/projects/bandung/ybbond/") +;; (setq easy-hugo-url "https://ybbond.dev") +;; :bind ("C-c C-e" . easy-hugo))