Kinneyzhang / gkroam

A lightweight roam replica on top of emacs org-mode.
GNU General Public License v3.0
193 stars 8 forks source link

[[https://melpa.org/#/gkroam][file:https://melpa.org/packages/gkroam-badge.svg]] [[https://stable.melpa.org/#/gkroam][file:https://stable.melpa.org/packages/gkroam-badge.svg]]

** Introduction Gkroam is a lightweight [[https://roamresearch.com][Roam Research]] replica, built on top of emacs org-mode. It uses 'ripgrep' to search links on pages and insert references at the bottom of org pages automatically. The principle of Gkroam is "Be faithful to Roam Research".

** Demos

** Installation

Clone this repo and add gkroam to your emacs load-path. My configurations are as follows. Feel free to modify them as to however you prefer.

Now, you can also install gkroam from Melpa with =package-install=.

+BEGIN_SRC emacs-lisp

(use-package gkroam :ensure t :hook (after-init . gkroam-mode) :init (setq gkroam-root-dir "~/gkroam/org/") (setq gkroam-prettify-page-flag t gkroam-show-brackets-flag nil gkroam-use-default-filename t gkroam-window-margin 4) :bind (:map gkroam-mode-map (("C-c r I" . gkroam-index) ("C-c r d" . gkroam-daily) ("C-c r D" . gkroam-delete) ("C-c r f" . gkroam-find) ("C-c r i" . gkroam-insert) ("C-c r n" . gkroam-dwim) ("C-c r e" . gkroam-link-edit) ("C-c r u" . gkroam-show-unlinked) ("C-c r p" . gkroam-toggle-prettify) ("C-c r t" . gkroam-toggle-brackets) ("C-c r R" . gkroam-rebuild-caches) ("C-c r g" . gkroam-update))))

+END_SRC

** Dependencies

** Important Tips

** Usage *** Link format

- page link: ={[<title>]}=
- page link with alias: ={[<title>][<alias>]}=

- headline link: ={[<title> » <headline>]}=
- headline link with alias: ={[<title> » <headline>][<alias>]}=

*** Main functions

=gkroam-find=\\
Find a gkroam file and open it. If it does not exist, create a new one. Just like /ido-find-file/.

=gkroam-insert=\\
Insert a page bracket link at point.

=gkroam-delete=\\
Delete one or more gkroam pages.

=gkroam-daily=\\
Create or open 'daily notes' page.

=gkroam-dwim=\\
Smartly create a new file. If in a region, read the text in region as file title. If a word at point, read the text at point as file title. Otherwise, use =gkroam-find=. Finally, insert a file link at point or in region.

=gkroam-index=\\
Show gkroam index buffer. Index buffer includes all gkroam pages' title, word counts, mentions, updated time and created time. You can click mentions number to see all references in a side window.

=gkroam-link-edit=\\
Edit link in minibuffer. This function is very useful when brackets are hidden.

=gkroam-show-unlinked=\\
Show page' unlinked references in a side window. Click link in unlinked references to link it to reference.

=gkroam-toggle-brackets=\\
Hide and show brackets of link and hashtag.

=gkroam-toggle-prettify=\\
Whether to prettify gkroam page.

=gkroam-update=\\
Update current buffer's references. Actually, references are updated automatically.

=gkroam-rebuild-caches=\\
Rebuild all caches, including page and filename cache, headline and headline id cache, page and references cache. It may takes seconds to build all, please be patient.

** ChangeLog

** TodoList

Recently, I have been watching [[https://www.youtube.com/playlist?list=PLwXSqDdn_CpE934BjXMgmzHnlwXMy41TC][videos]] about Roam Research. From these, I have gotten lots of ideas on how to improve gkroam. The ideas are as follows:

** Credits The original idea of Gkroam comes from [[https://github.com/casouri][casouri]]'s [[https://github.com/casouri/lunarymacs/blob/master/site-lisp/bklink.el][bklink.el]].