Home

Awesome

Telescope recent files extension

This is an extension for the Telescope plugin which implements a picker for the recent files.

The picker presents all files from :h v:oldfiles + the files which have been opened in the current session. There are also a couple of useful options.

How does it differ from:

Installation

With packer.nvim:

-- Required.
use {"nvim-telescope/telescope.nvim"}
-- This extension.
use {"smartpde/telescope-recent-files"}

Usage

Once installed, the extension has to be loaded using standard Telescope's API:


-- Load extension.
require("telescope").load_extension("recent_files")

An example of the shortcut to open recent files:

-- Map a shortcut to open the picker.
vim.api.nvim_set_keymap("n", "<Leader><Leader>",
  [[<cmd>lua require('telescope').extensions.recent_files.pick()<CR>]],
  {noremap = true, silent = true})

Options

Extension options can be configured in the Telescope's setup:

require("telescope").setup {
  defaults = {
    -- Your regular Telescope's options.
  },
  extensions = {
    recent_files = {
      -- This extension's options, see below.
    }
  }
}

The extension provides the following options: