Skip to content

mollerhoj/telescope-recent-files.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

telescope-recent-files

An extension for telescope.nvim that combines the results from builtin.oldfiles({cwd_only = true}) with builtin.find_files

In other words, it searches for files in the current directory, and displays files in order of how recently they were opened.

Setup

Lazy:

{
 'nvim-telescope/telescope.nvim',
 tag = '0.1.5',
 dependencies = {
   'mollerhoj/telescope-recent-files.nvim',
 },
 config = function()
   require("telescope").load_extension("recent-files")
 end
},

-- A keymap
vim.keymap.set('n', '<leader>f', function()
  require('telescope').extensions['recent-files'].recent_files({})
end, { noremap = true, silent = true })

Alternatives

I made this because I could find a plugin that did exactly what I needed.

I would suggest this functionality be builtin to telescope (It would be quite simple, I would be happy to make a PR).

But based on this discussion, nvim-telescope/telescope.nvim#2109, it seems the maintainers doesn't want it.

There are other plugins that tackles this, but have their issues:

Run on startup

The first thing I do is usually open a file within the current project I'm working in.

Thus, I've set this to run on startup:

vim.api.nvim_create_autocmd('VimEnter',{
  callback=function()
    if vim.fn.argc() == 0 then
      require('telescope').extensions['recent-files'].recent_files({})
    end
  end
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages