return { -- auto-cd to root of git project -- 'airblade/vim-rooter' { "notjedi/nvim-rooter.lua", config = function() require("nvim-rooter").setup() end, }, { "junegunn/fzf.vim", dependencies = { { "junegunn/fzf", dir = "~/.fzf", build = "./install --all" }, }, config = function() -- stop putting a giant window over my editor vim.g.fzf_layout = { down = "~20%" } -- when using :Files, pass the file list through -- -- !!!! https://github.com/jonhoo/proximity-sort -- -- to prefer files closer to the current file. function list_cmd() local base = vim.fn.fnamemodify(vim.fn.expand("%"), ":h:.:S") if base == "." then -- if there is no current file, -- proximity-sort can't do its thing return "fd --type file --follow" else return vim.fn.printf( "fd --type file --follow | proximity-sort %s", vim.fn.shellescape(vim.fn.expand("%")) ) end end -- vim.keymap.set("n", "ps", function() -- builtin.grep_string({ search = vim.fn.input("Grep > ") }) -- end) vim.api.nvim_create_user_command("MyFiles", function(arg) vim.fn["fzf#vim#files"](arg.qargs, { source = list_cmd(), options = "--tiebreak=index" }, arg.bang) end, { bang = true, nargs = "?", complete = "dir" }) -- vim.keymap.set("n", "pf", "MyFiles") -- vim.keymap.set("n", "fg", "GFiles") -- vim.keymap.set("n", "bb", "Buffers") -- vim.keymap.set("n", "ps", ":Rg ") end, }, }