nvim-telescope / telescope-frecency.nvim

A telescope.nvim extension that offers intelligent prioritization when selecting files from your editing history.
MIT License
777 stars 37 forks source link

Allow configuring the location of the database #22

Closed clason closed 3 years ago

clason commented 3 years ago

It'd be nice if we could specify the location (and name) of the database file in the telescope setup; something like

telescope.setup {
  extensions = {
    frecency = {
       frecency_location = '~/.local/share/nvim/telescope/frecency.sqlite3'
    }
  },
}

(Rationale: with https://github.com/nvim-telescope/telescope-smart-history.nvim, I might wish to move all my telescope files into one single directory.)

sunjon commented 3 years ago

It's been a while since I've looked at the code. It appears that there's an opts.docs_root (not the best name) parameter that it should respect. Let me know if that does what you want.

clason commented 3 years ago

No, that doesn't seem to do anything for me.

sunjon commented 3 years ago

can you try it again. The config option is now db_root

clason commented 3 years ago

Yep, works -- for others, the db_root is the directory (so vim.fn.stdpath('data') .. '/telescope' in my case) not the file.