Skip to content

Commit a954102

Browse files
committed
doc: add instruction for rocks.nvim, warning for packer.nvim
doc: remove some verbose description in plugin dependencies
1 parent bacd8b2 commit a954102

File tree

1 file changed

+42
-22
lines changed

1 file changed

+42
-22
lines changed

README.md

+42-22
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@ Here are some examples using different plugin managers. The full set of [plugin
120120
121121
#### Using [`lazy.nvim`](https://github.com/folke/lazy.nvim)
122122

123+
<details><summary>Click for install snippet</summary>
124+
123125
```lua
124126
return {
125127
"obsidian-nvim/obsidian.nvim",
126-
version = "*", -- recommended, use latest release instead of latest commit
128+
version = "*", -- recommended, use latest release instead of latest commit
127129
lazy = true,
128130
ft = "markdown",
129131
-- 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 {
157159
}
158160
```
159161

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+
160174
#### Using [`packer.nvim`](https://github.com/wbthomason/packer.nvim)
161175

176+
It is not recommended because packer.nvim is currently unmaintained
177+
178+
<details><summary>Click for install snippet</summary>
179+
162180
```lua
163-
use({
181+
use {
164182
"obsidian-nvim/obsidian.nvim",
165-
tag = "*", -- recommended, use latest release instead of latest commit
183+
tag = "*", -- recommended, use latest release instead of latest commit
166184
requires = {
167185
-- Required.
168186
"nvim-lua/plenary.nvim",
169187

170188
-- see below for full list of optional dependencies 👇
171189
},
172190
config = function()
173-
require("obsidian").setup({
191+
require("obsidian").setup {
174192
workspaces = {
175193
{
176194
name = "personal",
@@ -183,31 +201,34 @@ use({
183201
},
184202

185203
-- see below for full list of options 👇
186-
})
204+
}
187205
end,
188-
})
206+
}
189207
```
190208

209+
</details>
210+
191211
### Plugin dependencies
192212

193213
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.
194214

195215
**Completion:**
196216

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.
217+
- **[recommended]** [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
218+
- [blink.cmp](https://github.com/Saghen/blink.cmp) (new)
199219

200220
**Pickers:**
201221

202-
- **[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.
222+
- **[recommended]** [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
223+
- [ibhagwan/fzf-lua](https://github.com/ibhagwan/fzf-lua)
224+
- [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
206226

207227
**Syntax highlighting:**
208228

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.
230+
- [preservim/vim-markdown](https://github.com/preservim/vim-markdown)
231+
- See [syntax highlighting](#syntax-highlighting) for more details.
211232

212233
**Miscellaneous:**
213234

@@ -217,7 +238,7 @@ If you choose to use any of these you should include them in the "dependencies"
217238

218239
### Configuration options
219240

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:
221242

222243
```lua
223244
{
@@ -564,7 +585,7 @@ config = {
564585
name = "personal",
565586
path = "~/vaults/personal",
566587
},
567-
}
588+
},
568589
}
569590
```
570591

@@ -591,13 +612,12 @@ config = {
591612
-- ...
592613
},
593614
},
594-
}
615+
},
595616
}
596617
```
597618

598619
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:
599620

600-
601621
```lua
602622
config = {
603623
workspaces = {
@@ -607,7 +627,7 @@ config = {
607627
return assert(vim.fs.dirname(vim.api.nvim_buf_get_name(0)))
608628
end,
609629
},
610-
}
630+
},
611631
}
612632
```
613633

@@ -627,12 +647,12 @@ Note that in order to trigger completion for tags _within YAML frontmatter_ you
627647
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:
628648

629649
```lua
630-
require("nvim-treesitter.configs").setup({
650+
require("nvim-treesitter.configs").setup {
631651
ensure_installed = { "markdown", "markdown_inline", ... },
632652
highlight = {
633653
enable = true,
634654
},
635-
})
655+
}
636656
```
637657

638658
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 = {
734754

735755
### Usage outside of a workspace or vault
736756

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.
738758

739759
For example, to extend the configuration above this way:
740760

0 commit comments

Comments
 (0)