telescope-orgmode.nvim/README.md

49 lines
1.3 KiB
Markdown
Raw Normal View History

2022-11-01 19:17:41 -05:00
# telescope-orgmode.nvim
Integration for [orgmode](https://github.com/nvim-orgmode/orgmode) with
[telescope.nvim](https://github.com/nvim-telescope/telescope.nvim).
## Demo
2022-11-02 18:31:30 -05:00
Jump to to any heading in `org_agenda_files` with `:Telescope orgmode search_headings`
[![asciicast](https://asciinema.org/a/Oko0GT32HS6JCpzuSznUG0D1D.svg)](https://asciinema.org/a/Oko0GT32HS6JCpzuSznUG0D1D)
Refile heading from capture or current file under destination with `:Telescope orgmode refile_heading`
[![asciicast](https://asciinema.org/a/1X4oG6s5jQZrJJI3DfEzJU3wN.svg)](https://asciinema.org/a/1X4oG6s5jQZrJJI3DfEzJU3wN)
2022-11-01 19:17:41 -05:00
## Setup
You can setup the extension by doing:
```lua
require('telescope').load_extension('orgmode')
```
To replace the default refile prompt:
```lua
vim.api.nvim_create_autocmd('FileType', {
pattern = 'org',
2023-03-01 06:15:41 -06:00
group = vim.api.nvim_create_augroup('orgmode_telescope_nvim', { clear = true }),
2022-11-01 19:17:41 -05:00
callback = function()
vim.keymap.set('n', '<leader>or', require('telescope').extensions.orgmode.refile_heading)
end,
})
```
## Available commands
```viml
:Telescope orgmode search_headings
:Telescope orgmode refile_heading
```
## Available functions
```lua
require('telescope').extensions.orgmode.search_headings
require('telescope').extensions.orgmode.refile_heading
```