Telescope Setup and Flow#
This page explains how lua/plugins/expedition/telescope.lua resolves
filters, builds runtime state, and wires picker actions and keymaps.
High-level structure#
lua/plugins/expedition/telescope.lua
|-- filter argument helpers
| |-- to_rg_glob_args()
| `-- to_fd_exclude_args()
|-- runtime and action builders
| |-- build_telescope_runtime()
| `-- create_telescope_actions()
|-- setup sections
| |-- setup_telescope_plugin()
| |-- setup_uncategorized_keymaps()
| |-- setup_standard_keymaps()
| `-- setup_favourite_location_keymaps()
`-- telescope_setup() as plugin config callback
High-level flow#
The module reads telescope filter settings from
vvn.profile_config.It builds
rgandfdcommand arguments from those filters.It creates one runtime context that shares telescope dependencies.
It registers picker defaults and custom picker actions.
It applies keymaps in focused groups (general, standard, and favorite paths).
Profile-driven filter wiring#
Profile config import#
telescope.lua#
1local pathutil = require("vvn.pathutil")
2local profile_config = require("vvn.profile_config")
The module imports vvn.profile_config as the source for telescope filter
values.
Filter values into picker commands#
telescope.lua#
28local telescope_filters = profile_config.get_telescope_filters()
29local rg_glob_exclusions = vim.deepcopy(telescope_filters.rg_globs)
30local rg_cmd =
31 vim.list_extend({ "rg", "--files", "--hidden" }, to_rg_glob_args(rg_glob_exclusions))
32
33local fd_exclusions = vim.deepcopy(telescope_filters.fd_excludes)
34local fd_cmd =
35 vim.list_extend({ "fd", "--type", "file", "--hidden" }, to_fd_exclude_args(fd_exclusions))
36local fd_cmd_dir = vim.list_extend(
37 { "fd", "--type", "directory", "--hidden" },
38 to_fd_exclude_args(fd_exclusions)
39)
40local fd_cmd_d1 = vim.list_extend(vim.deepcopy(fd_cmd), { "--max-depth", "1" })
The highlighted lines build rg and fd command arguments from profile
filter values.