Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 27, 2024. It is now read-only.

Creating a neorg module for roam features.

License

NotificationsYou must be signed in to change notification settings

Jarvismkennedy/neorg-roam.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ I have stopped using Neorg for the time being and am no longer working on this project.

Like org-roam. But for Neorg.

Install

Install with your plugin manager. Here is an example with packer.

use({"jarvismkennedy/neorg-roam.nvim",requires= {"nvim-telescope/telescope.nvim","nvim-lua/plenary.nvim" }})

And then set it up as a neorg module.

require("neorg").setup({load= {   ["core.defaults"]= {},  ["core.dirman"]= {config= {workspaces= {notes="~/Documents/neorg/notes"roam="~/Documents/neorg/roam"   }default_workspace="roam"   }  },  ["core.integrations.roam"]= {-- default keymapsconfig= {keymaps= {-- select_prompt is used to to create new note / capture from the prompt directly-- instead of the telescope choice.select_prompt="<C-Space>",insert_link="<leader>ni",find_note="<leader>nf",capture_note="<leader>nc",capture_index="<leader>nci",capture_cancel="<C-q>",capture_save="<C-w>",   },-- telescope themetheme="ivy",capture_templates= {   {name="default",file="${title}",lines= {""},    }   },substitutions= {title=function(metadata)returnmetadata.titleend,date=function(metadata)returnos.date("%Y-%m-%d")end   }   }  } }})

Capture templates

Capture templates are defined as a list in the roam config table.

{name="new computer science note",file="classes/computer_science/${title}_${date}",title="${title}"lines= {"","* ${heading1}",""},}

Capture templates have support for substitution with the"${substitution}" syntax. Substitutions are functionsdefined in the config table which take a metadata table as a parameter and return a string. Themetadata table currently only supports thetitle field. The builtin substitutions are${title}, and${date} as above. The${title} substitution is the@document.meta title if the file exists already,or the telescope prompt if it does not exist. The file and title fields are only updated whencapturing a new file. In the above example, if you don't override thetitle field then it willdefault to the filename which is${title}_${date}.

Capture template fields

  • name: identifier for the template
  • file the path where the file will be saved. The norg extension will be added automatically
  • title: the metadata title to inject into the@document.meta tag
  • lines: the list of lines to insert

Capture templates to do

  • Currently capture templates always insert after the metadata. Support a target property toinsert after any tree-sitter node.
  • Support thenarrowed flag to capture in a blank buffer and write lines to file on save.

currently implemented features

  • Find notes.
  • Insert links to norg files.
  • Capture notes.
  • Capture to the index file.
  • Capture templates

TODO:

  • Create sql module.
  • Implement back links.
  • Other types of linkables.
  • Write tests.
  • Insert links is broken when inserting link to a file in a different root directory.
  • Moving files around / renaming them should not break links.

About

Creating a neorg module for roam features.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp