@@ 74,8 74,19 @@ vim.keymap.set("n", "<C-l>", [[:vertical resize +1<CR>]], { silent = true })
-- always included.
--
-- TODO: It'd be great if files in pwd are weighted higher.
--- TODO: Exclude current file from prompt: https://github.com/ibhagwan/fzf-lua/issues/396
-vim.keymap.set("n", "<Leader>p", require("fzf-lua").files, { silent = true })
+vim.keymap.set("n", "<Leader>p", function()
+ -- Exclude currently focused file from the list:
+ local current = vim.fn.expand("%")
+
+ local cmd
+ if current ~= "" then
+ cmd = string.format("fd --exclude %s", vim.fn.shellescape(current))
+ else
+ cmd = "fd"
+ end
+
+ require("fzf-lua").files({ cmd = cmd })
+end)
local function breakPoint()
local ft = vim.bo.filetype