Skip to content

Commit ea8cb45

Browse files
committed
docs: add configuration and describe features
1 parent 47a7221 commit ea8cb45

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# telescope-orgmode.nvim
22

3-
Integration for [orgmode](https://github.com/nvim-orgmode/orgmode) with
3+
Provides integration for [orgmode](https://github.com/nvim-orgmode/orgmode) and
4+
[org-roam.nvim](https://github.com/chipsenkbeil/org-roam.nvim) with
45
[telescope.nvim](https://github.com/nvim-telescope/telescope.nvim).
56

67
## Demo
@@ -69,3 +70,47 @@ require('telescope').extensions.orgmode.search_headings
6970
require('telescope').extensions.orgmode.refile_heading
7071
require('telescope').extensions.orgmode.insert_link
7172
```
73+
74+
## Toggle between headline and org file search
75+
76+
By pressing `<C-Space>` the picker state can be toggled between two modes.
77+
Every mode is available in every function.
78+
79+
### Search headlines
80+
81+
This is the first and default mode. It shows all the headlines, initially
82+
sorted by most recently changed org file. The level of headlines can be
83+
[configured](#Configuration).
84+
85+
### Search org files
86+
87+
This is the second mode, which shows only org files. If the org file has a
88+
title, it is shown (and used for filtering) instead of the filename. This is
89+
particular useful in connection with
90+
[org-roam.nvim](https://github.com/chipsenkbeil/org-roam.nvim) to fuzzy search
91+
for roam nodes.
92+
93+
## Configuration
94+
95+
You can limit the maximum headline level included in the search. `nil` means
96+
unlimited level, `0` means only search for whole org files. The later is
97+
equivalent with [org file mode](#search-org-files)
98+
99+
To enable the configuration for all commands, you pass the option to the setup
100+
function of telescope:
101+
102+
```lua
103+
require('telescope').setup({
104+
extensions = {
105+
orgmode = {
106+
max_depth = 3
107+
}
108+
}
109+
})
110+
```
111+
112+
For a particular command you can pass it directly in your key mapping to the function:
113+
114+
```lua
115+
require('telescope').extension.orgmode.search_headings({ max_depth = 3 })
116+
```

0 commit comments

Comments
 (0)