https://github.com/nvim-neorg/neorg-telescope
Telescope.nvim integration for Neorg
https://github.com/nvim-neorg/neorg-telescope
neovim-plugin
Last synced: over 1 year ago
JSON representation
Telescope.nvim integration for Neorg
- Host: GitHub
- URL: https://github.com/nvim-neorg/neorg-telescope
- Owner: nvim-neorg
- License: gpl-3.0
- Created: 2021-07-28T15:40:24.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-17T05:12:50.000Z (over 1 year ago)
- Last Synced: 2025-04-17T19:51:14.948Z (over 1 year ago)
- Topics: neovim-plugin
- Language: Lua
- Homepage:
- Size: 130 KB
- Stars: 197
- Watchers: 5
- Forks: 25
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-neorg - neorg-telescope - Telescope.nvim integration for Neorg. (Integrations)
README
# Neorg Telescope
This repo hosts a 3rd party module for [Neorg](https://github.com/nvim-neorg/neorg) to integrate with [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
# 🌟 Showcase
### Fuzzy Searching Any Linkable
Simply jump to any important element in the workspace. This includes headings, drawers, markers.
The command for this is `Telescope neorg find_linkable`
Demo

### Automatic Link Insertion
Simply press a key (`` in insert mode by default) and select what you want to link to.
`insert_link` only works for elements in the current workspace.
Demo

### Automatic File Link Insertion
You can use `Telescope neorg insert_file_link` to insert a link to a neorg file.
Notice that this only works for files in the current workspace.
Note: If no file is selected a link to a file with the name of the prompt value
will be inserted. This file will be created if you use the link with

Demo

### Fuzzy Searching Headings
With `Telescope neorg search_headings` you can search through all the headings in the current file.
Demo

### Search File and Heading Backlinks
- `Telescope neorg find_backlinks` - find every line in your workspace that links^* to the current file
- `Telescope neorg find_header_backlinks` - same but with links to the current file _and_ heading
These are limited to workspace relative links (ie.
`{:$/worspace/relative/path:}`) for the sake of simplicity. Both exact
(`{:$/path:** lvl 2 heading}`) and fuzzy (`{:$/path:# heading}`) links are
found.
Demo

## Gtd Pickers
### Those pickers are all broken since gtd was removed in core
The removed pickers
### Find Project Tasks
Use `Telescope neorg find_project_tasks` to pick a project and then the tasks inside it.
You can then jump to those tasks.
If you select and empty project (colored gray) then you'll jump to the project.
### Find Context Tasks
With `Telescope neorg find_context_tasks` you pick a context and then tasks.
### Find AOF Tasks
You can use `Telescope neorg find_aof_tasks` to pick an aof and then search through the tasks of it.
### Find AOF Project Tasks
When you use `Telescope neorg find_aof_project_tasks` you can pick an area of focus, then a project inside it and last but not least you can search for tasks inside the project.
Until the new GTD infrastructure arrives, you could collect all your todo items with a regex, for example:
```lua
-- Make sure you have ripgrep installed.
-- Add the following function to your `~/.config/nvim/init.lua`:
do
local _, neorg = pcall(require, "neorg.core")
local dirman = neorg.modules.get_module("core.dirman")
local function get_todos(dir, states)
local current_workspace = dirman.get_current_workspace()
local dir = current_workspace[2]
require('telescope.builtin').live_grep{ cwd = dir }
vim.fn.feedkeys('^ *([*]+|[-]+) +[(]' .. states .. '[)]')
end
-- This can be bound to a key
vim.keymap.set('n', '', function() get_todos('~/notes', '[^x_]') end)
end
```
# 🔧 Installation
First, make sure to pull this plugin down. This plugin does not run any code in of itself. It requires Neorg
to load it first:
You can install it through your favorite plugin manager:
```lua
use {
"nvim-neorg/neorg",
config = function()
require('neorg').setup {
load = {
["core.defaults"] = {},
...
["core.integrations.telescope"] = {}
},
}
end,
requires = { "nvim-lua/plenary.nvim", "nvim-neorg/neorg-telescope" },
}
```
-
vim-plug
```vim
Plug 'nvim-neorg/neorg' | Plug 'nvim-lua/plenary.nvim' | Plug 'nvim-neorg/neorg-telescope'
```
You can then put this initial configuration in your `init.vim` file:
```vim
lua << EOF
require('neorg').setup {
load = {
["core.defaults"] = {},
...
["core.integrations.telescope"] = {}
},
}
EOF
```
```lua
require("lazy").setup({
{
"nvim-neorg/neorg",
opts = {
load = {
["core.defaults"] = {},
...
["core.integrations.telescope"] = {},
},
},
dependencies = { { "nvim-lua/plenary.nvim" }, { "nvim-neorg/neorg-telescope" } },
}
})
```
# Configuration
This module accepts the following configuration with the shown defaults:
```lua
{
...
["core.integrations.telescope"] = {
config = {
insert_file_link = {
-- Whether to show the title preview in telescope. Affects performance with a large
-- number of files.
show_title_preview = true,
},
}
}
}
```
# Usage
You can define keybindings like this:
```lua
vim.keymap.set("n", "", "(neorg.telescope.search_headings)")
```
List of all available plug mappings:
- `neorg.telescope.backlinks.file_backlinks`
- `neorg.telescope.backlinks.header_backlinks`
- `neorg.telescope.find_linkable`
- `neorg.telescope.find_norg_files`
- `neorg.telescope.insert_file_link`
- `neorg.telescope.insert_link`
- `neorg.telescope.search_headings`
- `neorg.telescope.switch_workspace`
# Support Welcome
If it's not clear by the code already, I'm a solid noob at telescope related things :)
If you have any awesome ideas or any code you want to contribute then go ahead!
Any sort of help is appreciated :heart:
#### Some Ideas Right Off The Top Of My Head
- Fuzzy searching content in paragraphs only
- Fuzzy searching content in the current heading
# GIFs
### Insert Link
