You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+42-22
Original file line number
Diff line number
Diff line change
@@ -120,10 +120,12 @@ Here are some examples using different plugin managers. The full set of [plugin
120
120
121
121
#### Using [`lazy.nvim`](https://github.com/folke/lazy.nvim)
122
122
123
+
<details><summary>Click for install snippet</summary>
124
+
123
125
```lua
124
126
return {
125
127
"obsidian-nvim/obsidian.nvim",
126
-
version="*", -- recommended, use latest release instead of latest commit
128
+
version="*", -- recommended, use latest release instead of latest commit
127
129
lazy=true,
128
130
ft="markdown",
129
131
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
@@ -157,20 +159,36 @@ return {
157
159
}
158
160
```
159
161
162
+
</details>
163
+
164
+
#### Using [`rocks.nvim`](https://github.com/nvim-neorocks/rocks.nvim)
165
+
166
+
<details><summary>Click for install snippet</summary>
167
+
168
+
```vim
169
+
:Rocks install obsidian
170
+
```
171
+
172
+
</details>
173
+
160
174
#### Using [`packer.nvim`](https://github.com/wbthomason/packer.nvim)
161
175
176
+
It is not recommended because packer.nvim is currently unmaintained
177
+
178
+
<details><summary>Click for install snippet</summary>
179
+
162
180
```lua
163
-
use({
181
+
use{
164
182
"obsidian-nvim/obsidian.nvim",
165
-
tag="*", -- recommended, use latest release instead of latest commit
183
+
tag="*", -- recommended, use latest release instead of latest commit
166
184
requires= {
167
185
-- Required.
168
186
"nvim-lua/plenary.nvim",
169
187
170
188
-- see below for full list of optional dependencies 👇
171
189
},
172
190
config=function()
173
-
require("obsidian").setup({
191
+
require("obsidian").setup{
174
192
workspaces= {
175
193
{
176
194
name="personal",
@@ -183,31 +201,34 @@ use({
183
201
},
184
202
185
203
-- see below for full list of options 👇
186
-
})
204
+
}
187
205
end,
188
-
})
206
+
}
189
207
```
190
208
209
+
</details>
210
+
191
211
### Plugin dependencies
192
212
193
213
The only **required** plugin dependency is [plenary.nvim](https://github.com/nvim-lua/plenary.nvim), but there are a number of optional dependencies that enhance the obsidian.nvim experience.
194
214
195
215
**Completion:**
196
216
197
-
-**[recommended]**[hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp): for completion of note references.
198
-
-[blink.cmp](https://github.com/Saghen/blink.cmp) (new): for completion of note references.
-**[recommended]**[nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim): for search and quick-switch functionality.
203
-
-[Mini.Pick](https://github.com/echasnovski/mini.pick) from the mini.nvim library: an alternative to telescope for search and quick-switch functionality.
204
-
-[ibhagwan/fzf-lua](https://github.com/ibhagwan/fzf-lua): another alternative to telescope for search and quick-switch functionality.
205
-
-[Snacks.Picker](https://github.com/folke/snacks.nvim/blob/main/docs/picker.md) from the snacks.nvim library: an alternative to mini and telescope for search and quick-switch functionality.
-[Mini.Pick](https://github.com/echasnovski/mini.pick) from the mini.nvim library
225
+
-[Snacks.Picker](https://github.com/folke/snacks.nvim/blob/main/docs/picker.md) from the snacks.nvim library
206
226
207
227
**Syntax highlighting:**
208
228
209
-
-**[recommended]**[nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter): for base markdown syntax highlighting. See [syntax highlighting](#syntax-highlighting) for more details.
210
-
-[preservim/vim-markdown](https://github.com/preservim/vim-markdown): an alternative to nvim-treesitter for syntax highlighting (see [syntax highlighting](#syntax-highlighting) for more details), plus other cool features.
229
+
-**[recommended]**[nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter): for base markdown syntax highlighting.
- See [syntax highlighting](#syntax-highlighting) for more details.
211
232
212
233
**Miscellaneous:**
213
234
@@ -217,7 +238,7 @@ If you choose to use any of these you should include them in the "dependencies"
217
238
218
239
### Configuration options
219
240
220
-
This is a complete list of all of the options that can be passed to `require("obsidian").setup()`. The settings below are *not necessarily the defaults, but represent reasonable default settings*. Please read each option carefully and customize it to your needs:
241
+
This is a complete list of all of the options that can be passed to `require("obsidian").setup()`. The settings below are _not necessarily the defaults, but represent reasonable default settings_. Please read each option carefully and customize it to your needs:
221
242
222
243
```lua
223
244
{
@@ -564,7 +585,7 @@ config = {
564
585
name="personal",
565
586
path="~/vaults/personal",
566
587
},
567
-
}
588
+
},
568
589
}
569
590
```
570
591
@@ -591,13 +612,12 @@ config = {
591
612
-- ...
592
613
},
593
614
},
594
-
}
615
+
},
595
616
}
596
617
```
597
618
598
619
obsidian.nvim also supports "dynamic" workspaces. These are simply workspaces where the `path` is set to a Lua function (that returns a path) instead of a hard-coded path. This can be useful in several scenarios, such as when you want a workspace whose `path` is always set to the parent directory of the current buffer:
@@ -627,12 +647,12 @@ Note that in order to trigger completion for tags _within YAML frontmatter_ you
627
647
If you're using [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/README.md) you're configuration should include both "markdown" and "markdown_inline" sources:
If you use `vim-markdown` you'll probably want to disable its frontmatter syntax highlighting (`vim.g.vim_markdown_frontmatter = 1`) which I've found doesn't work very well.
@@ -734,7 +754,7 @@ templates = {
734
754
735
755
### Usage outside of a workspace or vault
736
756
737
-
It's possible to configure obsidian.nvim to work on individual markdown files outside of a regular workspace / Obsidian vault by configuring a "dynamic" workspace. To do so you just need to add a special workspace with a function for the `path` field (instead of a string), which should return a *parent* directory of the current buffer. This tells obsidian.nvim to use that directory as the workspace `path` and `root` (vault root) when the buffer is not located inside another fixed workspace.
757
+
It's possible to configure obsidian.nvim to work on individual markdown files outside of a regular workspace / Obsidian vault by configuring a "dynamic" workspace. To do so you just need to add a special workspace with a function for the `path` field (instead of a string), which should return a _parent_ directory of the current buffer. This tells obsidian.nvim to use that directory as the workspace `path` and `root` (vault root) when the buffer is not located inside another fixed workspace.
738
758
739
759
For example, to extend the configuration above this way:
0 commit comments