Giter VIP home page Giter VIP logo

telescope-luasnip.nvim's Introduction

telescope-luasnip

This plugin adds a LuaSnip snippet picker to the already-awesome Neovim Telescope plugin.

This is a port of fhill2/telescope-ultisnips.nvim from Ultisnips to LuaSnip. Thanks for the simple great idea!

NOTE: This plugin is fairly new. If you find something wrong, please raise an issue or better yet, raise a PR.

telescope-luasnip.nvim in action

Requirements

Setup

Install the plugin using your favourite package manager.

use {
    "benfowler/telescope-luasnip.nvim",
    module = "telescope._extensions.luasnip",  -- if you wish to lazy-load
}

Then, you need to tell Telescope about this extension somewhere after your require('telescope').setup(), by calling:

require('telescope').load_extension('luasnip')

Usage

require'telescope'.extensions.luasnip.luasnip{}
vim.cmd [[ Telescope luasnip ]]

or

:Telescope luasnip

Configuration

This Telescope plugin works fine as-is, and requires no further configuration.

However, if you want, you can customise its search behaviour if you wish:

local lst = require('telescope').extensions.luasnip
local luasnip = require('luasnip')

require('telescope').setup {
    extensions = {
        ...
        luasnip = {
                search = function(entry)
                        return lst.filter_null(entry.context.trigger) .. " " ..
                               lst.filter_null(entry.context.name) .. " " ..
                               entry.ft .. " " ..
                               lst.filter_description(entry.context.name, entry.context.description) ..
                               lst.get_docstring(luasnip, entry.ft, entry.context)[1]
                end
        },
       ...
    }
}

Help!

Is there something not quite right or could be improved? Log an issue with a minimal reproduction, or better yet, raise a PR.

telescope-luasnip.nvim's People

Contributors

benfowler avatar ben-fowler-rft avatar zigius avatar timhemel avatar patrick96 avatar shlemiel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.