Fuzzy-searchable field completion for editing Faff plan files in Neovim.
Note: This plugin requires Neovim and Telescope. It will not work in regular Vim.
- Fuzzy-search ASTRO field values (action, subject, tracker, role, objective)
- Uses
faff field listto pull real vocabulary from your Faff workspace - Context-aware: detects which field you're editing
- Shows tracker names prominently for easy selection
- Inserts tracker IDs with human-readable comments
Add to your Neovim config:
{
'faffhub/faff-cli-vim',
dependencies = {
'nvim-telescope/telescope.nvim',
},
init = function()
-- Set up filetype detection for .faff.toml files
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = '*.faff.toml',
callback = function()
vim.bo.filetype = 'faff'
end,
})
-- Set up keybindings for Telescope field picker
vim.api.nvim_create_autocmd('FileType', {
pattern = 'faff',
callback = function()
vim.keymap.set({'n', 'i'}, '<C-f>', function()
require('faff.picker').pick_field()
end, { buffer = true, desc = 'Pick ASTRO field value' })
end,
})
end,
config = function()
vim.g.faff_command = '/path/to/your/faff' -- Update this path
end,
}The plugin automatically activates when editing:
- Temporary intent files ending in
.faff.toml(viafaff intent edit,faff intent derive)
-
Position cursor on an ASTRO field line:
role = "" trackers = []
-
Press
Ctrl-F(works in both normal and insert mode) -
Telescope opens with a fuzzy-searchable list:
- For trackers: Shows tracker name prominently with ID
- For other fields: Shows value and usage statistics
- Type to fuzzy-search and filter in real-time
-
Select with Enter:
- Trackers: Inserts
"element:12345", # Customer Name - Other fields: Inserts just the value
- Trackers: Inserts
When completing a tracker field:
trackers = [Press Ctrl-F, type "customer", select from list, and it inserts:
trackers = ["element:2633285", # Customer Supportaction = "..."subject = "..."trackerintrackers = [ "...",]role = "..."objective = "..."
The plugin:
- Detects
.faff.tomlfiles and sets filetype tofaff - Binds
Ctrl-Fto open the Telescope picker - When triggered, detects which ASTRO field you're editing
- Calls
faff field list <field> --plainto get ALL values (used + unused) - For trackers, shows tracker names from plan definitions
- Opens Telescope for fuzzy searching
- Inserts selected value with comments for trackers
If faff is not in your $PATH (e.g., installed in a Python venv), you can specify the full path:
vim.g.faff_command = '/Users/tom/.virtualenvs/faff/bin/faff'If not set, defaults to faff (assumes it's on your PATH).
To change the keybinding from Ctrl-F, update the keymap in your config:
vim.keymap.set({'n', 'i'}, '<leader>ff', function() -- Use leader+ff instead
require('faff.picker').pick_field()
end, { buffer = true, desc = 'Pick ASTRO field value' })- Neovim (tested on v0.10+)
- Telescope
faffCLI must be available (either in$PATHor configured viag:faff_command)- Your current working directory must be a Faff workspace (or set explicitly)