From ab5f31136e149054734e58a3e599e1508f0fe12e Mon Sep 17 00:00:00 2001 From: Cameron Ring Date: Mon, 26 Aug 2024 21:12:05 -0700 Subject: [PATCH] fix: #300 sort picker by newest Also, removing fd and fdfind as we just need a simple directory listing. Keeping ripgrep because having one command that's consistent cross platform is nice. --- lua/auto-session/session-lens/init.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lua/auto-session/session-lens/init.lua b/lua/auto-session/session-lens/init.lua index d8bc0d6..a727a82 100644 --- a/lua/auto-session/session-lens/init.lua +++ b/lua/auto-session/session-lens/init.lua @@ -125,15 +125,11 @@ SessionLens.search_session = function(custom_opts) end return opts.find_command elseif 1 == vim.fn.executable "rg" then - return { "rg", "--files", "--color", "never" } - elseif 1 == vim.fn.executable "fd" then - return { "fd", "--type", "f", "--color", "never" } - elseif 1 == vim.fn.executable "fdfind" then - return { "fdfind", "--type", "f", "--color", "never" } - elseif 1 == vim.fn.executable "ls" and vim.fn.has "win32" == 0 then - return { "ls" } + return { "rg", "--files", "--color", "never", "--sortr", "modified" } + elseif 1 == vim.fn.executable "ls" then + return { "ls", "-t" } elseif 1 == vim.fn.executable "cmd" and vim.fn.has "win32" == 1 then - return { "cmd", "/C", "dir", "/b" } + return { "cmd", "/C", "dir", "/b", "/o-d" } end end)()