/telescope-manix

A telescope.nvim extension for Manix - A fast documentation searcher for Nix

Primary LanguageLuaGNU General Public License v2.0GPL-2.0

telescope-manix

Neovim Lua Nix

LuaRocks

A telescope.nvim extension for Manix

A fast documentation searcher for Nix

Quick links

Features

Nix fuzzy search

asciicast

Search for the word under the cursor

asciicast

Prerequisites

Note

  • This plugin may work with older Neovim versions, but is only tested with the latest stable version and nightly.

Installation

Using rocks.nvim:

:Rocks install telescope-manix

Using lazy.nvim:

{
  'nvim-telescope/telescope.nvim',
  branch = '0.1.x', -- Recommended
  dependencies = {
    'nvim-lua/plenary.nvim',
    'mrcjkb/telescope-manix',
    -- ...
  },
}

Configuration

Add the following to your telescope config:

local telescope = require('telescope')
telescope.setup {
  -- opts...
}
telescope.load_extension('manix')

Usage

:Telescope manix
require('telescope-manix').search()
-- or
require('telescope').extensions.manix.manix()

Customisation

default_opts = {
  -- CLI arguments to pass to manix, see `manix --help`
  -- for example: `{'--source', 'nixpkgs_doc', '--source', 'nixpkgs_comments'}`
  -- will restrict search to nixpkgs docs and comments.
  manix_args = {},
  -- Set to true to search for the word under the cursor
  cword = false,
}
require('telescope-manix').search(default_opts)
-- or
require('telescope').extensions.manix.manix(default_opts)

Troubleshooting

If you are not seeing any search results, you may need to run manix --update-cache <query>, to initialise the cache.