Create New File In fzf-lua #1507
Closed
VioletJewel
started this conversation in
General
Replies: 2 comments 3 replies
-
You can use the query prompt text to create a new file, similar to how git branch add action works, add this to your acrion table: ['ctrl-a'] = function(_, opts)
local query = opts.last_query
vim.cmd('e ' .. query)
end |
Beta Was this translation helpful? Give feedback.
3 replies
-
actions = {
files = {
true,
['alt-e'] = function(_, opts)
local f = vim.fs.joinpath(opts.cwd, opts.last_query)
local e = vim.api.nvim_replace_termcodes('<Esc>:e ', true, true, true)
vim.api.nvim_feedkeys(e..f, 'L', false)
end,
}
}, preferable for me. thanks again. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have keybindings to open fzf-lua with cwd set to some directory. I often realize that I want to make a new file in this cwd. I cannot do this. I would rather not submit a feature request, but I don't know what else to do. I know fzf is not designed to do this. But there is no way that I can find to work around this, and I need this so very often. I would rather not forego fzf because it's so fast.
I always end up doing
<CR>:e %:h/new/file<CR>
, and that isn't the end of the world, but I wish I could just make a new file at will based on the current selected file's parent directory or the cwd of fzf...Beta Was this translation helpful? Give feedback.
All reactions