diff --git a/lua/telescope/builtin.lua b/lua/telescope/builtin.lua index 33728b2..c63fda9 100644 --- a/lua/telescope/builtin.lua +++ b/lua/telescope/builtin.lua @@ -233,29 +233,19 @@ builtin.grep_string = function(opts) } end -builtin.fzf_history = function() - local history_lines = table.concat(vim.v.oldfiles, '\n') - - local fzf = finders.new { - maximum_results = 1000, - fn_command = function(self, prompt) - return { - command = 'fzf', - args = {'--no-sort', '--filter', prompt}, - - writer = { - command = 'echo', - args = {history_lines}, - } - } - end +builtin.oldfiles = function() + local oldfiles_finder = finders.new { + results = vim.tbl_map( + function(x) return (x:gsub('\n', '')) end, + vim.v.oldfiles + ) } - - local file_picker = pickers.new { } + local file_picker = pickers.new{} file_picker:find { - prompt = 'FZF History', - finder = fzf, + prompt = 'Oldfiles', + finder = oldfiles_finder, + sorter = sorters.get_norcalli_sorter() } end