Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with vim-plug as plugin manager #29

Open
dsiguero opened this issue Jul 30, 2021 · 3 comments
Open

Not working with vim-plug as plugin manager #29

dsiguero opened this issue Jul 30, 2021 · 3 comments

Comments

@dsiguero
Copy link

Nothing happens when I try to run :Telescope frecency

init.vim

Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-telescope/telescope-fzy-native.nvim'
Plug 'tami5/sql.nvim'
Plug 'nvim-telescope/telescope-frecency.nvim'

telescope.lua

local actions = require('telescope.actions')
local themes = require('telescope.themes')

require('telescope').load_extension('fzy_native')
require('telescope').load_extension('frecency')

require('telescope').setup {
    defaults = {
        file_sorter = require('telescope.sorters').get_fzy_sorter,
        prompt_prefix = '>',
        color_devicons = true,

        file_previewer = require('telescope.previewers').vim_buffer_cat.new,
        grep_previewer = require('telescope.previewers').vim_buffer_vimgrep.new,
        qflist_previewer = require('telescope.previewers').vim_buffer_qflist.new,

        mappings = {
            i = {
                ["<C-x>"] = false,
                ["<C-q>"] = actions.send_to_qflist,
            },
        }
    },
    pickers = {
    },
    extensions = {
        fzy_native = {
            override_generic_sorter = false,
            override_file_sorter = true,
        },
        frecency = {
            show_scores = false,
            show_unindexed = true,
            ignore_patterns = {"*.git/*", "*/tmp/*"},
        }
    }
}
@Conni2461
Copy link
Member

You should load your extensions after require('telescope').setup.
Does :Telescope frecency frecency work? or does :lua require('telescope').extensions.frecency.frecency() work? It might be that the lua dispatcher has some issues.

Other things you should do is in your config is remove the *_previewer options because these are applied on default. You should also not set file_sorter if you load fyz_native because fzy_native does this for you :)

@dsiguero
Copy link
Author

dsiguero commented Aug 4, 2021

Thanks for your reply! I have modified the config according to your comments, so now it looks like this:

local actions = require('telescope.actions')

require('telescope').setup {
    defaults = {
        prompt_prefix = '>',
        color_devicons = true,

        mappings = {
            i = {
                ["<C-x>"] = false,
                ["<C-q>"] = actions.send_to_qflist,
            },
        }
    },
    extensions = {
        fzy_native = {
            override_generic_sorter = false,
            override_file_sorter = true,
        },
        frecency = {
            show_scores = false,
            show_unindexed = true,
            ignore_patterns = {"*.git/*", "*/tmp/*"},
        }
    }
}

require('telescope').load_extension('fzy_native')
require('telescope').load_extension('frecency')

I can open frecency using :Telescope frecency frecency, and after that :Telescope frecency will just work, at least until I close neovim. After closing and reopening it, :Telescope frecency won't work anymore, having to :Telescope frecency frecency to "enable" the "single frecency" version of the command to work again.

@marekdedic
Copy link

Hi, from my experience the installation with vim-plug on linux was as simple as

sudo apt-get install sqlite3 libsqlite3-dev

And adding

Plug('tami5/sqlite.lua')
Plug('nvim-telescope/telescope-frecency.nvim')

...

require('telescope').load_extension('frecency')

to my init.lua

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants