Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andvarfolomeev/obsidian
:book: Base Obsidian functionality in your Neovim
https://github.com/andvarfolomeev/obsidian
neovim neovim-plugin note-taking obsidian simple
Last synced: 18 days ago
JSON representation
:book: Base Obsidian functionality in your Neovim
- Host: GitHub
- URL: https://github.com/andvarfolomeev/obsidian
- Owner: andvarfolomeev
- Created: 2023-07-27T16:14:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-26T15:55:02.000Z (3 months ago)
- Last Synced: 2025-01-23T00:01:40.591Z (30 days ago)
- Topics: neovim, neovim-plugin, note-taking, obsidian, simple
- Language: Lua
- Homepage: https://dotfyle.com/plugins/ada0l/obsidian
- Size: 53.7 KB
- Stars: 40
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Obsidian for Neovim (WIP)
I often use Obsidian to take daily notes and maintain my knowledge base.
This plugin allows you to use the basic functionality to work with Obsidian vaults.For full experience needs [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) plugin, [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) plugin. And it also needs CLI tools like [ripgrep](https://github.com/BurntSushi/ripgrep), [fd](https://github.com/sharkdp/fd) and [sd](https://github.com/chmln/sd).
See more details in [Features](#features) and [help file](doc/obsidian.txt).
## Features
- [x] Opening vault
- [x] Creating new notes
- [x] Creating/Opening daily notes
- [x] Selecting and inserting templates to buffer with support placeholders like: `{{title}}`, `{{date}}`, `{time}}`
- [x] Searching notes with Telescope integration
- [x] Searching backlinks of the current note
- [x] Going to file via wiki link
- [x] Renaming current note with updating wiki links
- [x] Autocomplete of wiki links with cmp integration
- [x] Multi vault## Configuration example with lazy.nvim
You do not need to decorate functions in keys if you have only one vault in opts.vaults.
```lua
{
'ada0l/obsidian',
lazy = 'VeryLazy',
keys = {
{ 'ov', 'lua require("obsidian").vault_prompt()', desc = 'Vault prompt' },
{ 'oc', 'lua require("obsidian").cd_vault()', desc = 'Cd vault' },
{ 'on', 'lua require("obsidian").new_note_prompt()', desc = 'New note' },
{ 'ot', 'lua require("obsidian").open_today()', desc = 'Open today' },
{ 'oT', 'lua require("obsidian").open_today_prompt()', desc = 'Open today (shift)' },
{ 'oi', 'lua require("obsidian").template_picker()', desc = 'Template picker' },
{ 'of', 'lua require("obsidian").note_picker()', desc = 'Note picker' },
{ 'ob', 'lua require("obsidian").backlinks_picker()', desc = 'Backlinks picker' },
{ 'or', 'lua require("obsidian").rename_prompt()', desc = 'Rename prompt' },
{
'gf',
function()
if require('obsidian').found_wikilink_under_cursor() ~= nil then
return 'lua require("obsidian").go_to()'
else
return 'gf'
end
end,
noremap = false,
expr = true,
},
},
---@type ObsidianOptions
opts = {
extra_fd_opts = '--exclude assets --exclude journals --exclude _debug_remotely_save',
vaults = {
{
dir = '~/Knowledge/',
daily = {
dir = 'journals',
format = '%Y-%m-%d',
},
note = {
dir = '.',
transformator = function(filename)
if filename ~= nil and filename ~= '' then
return filename
end
return string.format('%d', os.time())
end,
},
templates = {
dir = 'templates',
date = '%Y-%d-%m',
time = '%Y-%d-%m',
},
},
},
},
}
```### Cmp integration
```lua
{
'hrsh7th/nvim-cmp',
dependencies = {
'ada0l/obsidian',
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local cmp = require('cmp')
local obsidian = require('obsidian')
cmp.register_source('obsidian', obsidian.get_cmp_source().new())
table.insert(opts.sources, { name = 'obsidian' })
end,
},
```## Similar plugins
- [epwalsh/obsidian.nvim](https://github.com/epwalsh/obsidian.nvim)