|
1 | 1 | # telescope-orgmode.nvim
|
2 | 2 |
|
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 |
4 | 5 | [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim).
|
5 | 6 |
|
6 | 7 | ## Demo
|
@@ -69,3 +70,47 @@ require('telescope').extensions.orgmode.search_headings
|
69 | 70 | require('telescope').extensions.orgmode.refile_heading
|
70 | 71 | require('telescope').extensions.orgmode.insert_link
|
71 | 72 | ```
|
| 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