RTFM Checklist
Operating system
Linux
Shell
zsh
Neovim version (nvim --version)
v0.11.0-dev-1649+gc47496791a
Fzf version (fzf --version)
0.60.2 (c0d407f7)
Output of :lua print(os.getenv('FZF_DEFAULT_OPTS'))
nil
Is the problem reproducible with mini.sh?
Fzf-lua configuration
require("fzf-lua").setup({
actions = {
files = {
["default"] = actions.file_edit_or_qf,
["ctrl-x"] = actions.file_split,
["ctrl-v"] = actions.file_vsplit,
["ctrl-t"] = actions.file_tabedit,
-- ["ctrl-t"] = file_tabedit_with_cwd,
-- ["alt-q"] = actions.file_sel_to_qf, -- dunno what this does
-- ["alt-l"] = actions.file_sel_to_ll, -- dunno what this does
["ctrl-l"] = require'fzf-lua.actions'.arg_add, -- dunno what this does
},
buffers = {
["default"] = actions.buf_edit,
["ctrl-x"] = actions.buf_split,
["ctrl-v"] = actions.buf_vsplit,
["ctrl-t"] = actions.buf_tabedit,
}
},
buffers = {
actions = {
["ctrl-x"] = actions.buf_split,
["ctrl-d"] = actions.buf_del,
}
},
tabs = {
actions = {
["ctrl-x"] = actions.buf_split,
["ctrl-d"] = actions.buf_del,
}
},
-- See https://github.com/ibhagwan/fzf-lua/wiki#can-i-use-ripgreps---globiglob-option-with-live_grep
grep = {
rg_glob = true
}
})
-- Set up keyboard shortbuts for fzf, the fuzzy finder
-- This one searches all the files in the current git repo:
map('n', '<c-k>', '<cmd>lua require("fzf-lua").git_files()<CR>', { silent = true })
map('n', '<leader>h', '<cmd>lua require("fzf-lua").oldfiles()<CR>', { silent = true })
map('n', '<leader>t', '<cmd>lua require("fzf-lua").tabs()<CR>', { silent = true })
map('n', '<leader><Tab>', '<cmd>lua require("fzf-lua").buffers()<CR>', { silent = true })
-- Unmap center/<CR> from launching fzf which appears to be mapped by default.
-- unmap <CR>
-- map('n', '<leader>g', '<cmd>lua require("fzf-lua").grep_project()<CR>', { silent = true, debug = true })
map('n', '<leader>g', '<cmd>lua require("fzf-lua").live_grep()<CR>', { silent = true })
-- map('n', '<leader>g', '<cmd>lua require("fzf-lua").grep_project({ rg_opts = "--glob \'!**/unittest*/**\'", debug = True })<CR>', { silent = true })
-- map('n', '<leader>g', '<cmd>lua require("fzf-lua").live_grep({ rg_opts = "--glob \'!**/unittest*/**\'", debug = True })<CR>', { silent = true })
-- map('n', '<leader>g', '<cmd>lua require("fzf-lua").live_grep()<CR>', { silent = true })
vim.keymap.set("n", "gsiw",
function()
local fzf_lua = require("fzf-lua")
local current_word = vim.api.nvim_command_output([[ echo expand('<cword>') ]])
fzf_lua.live_grep({
cmd = grep_cmd,
query = current_word,
cwd = fzf_lua.path.git_root(),
})
end,
{ silent = true }
)
map('n', '<leader>l', '<cmd>lua require("fzf-lua").lines()<CR>', { silent = true })
-- map('n', '<leader>w', '<cmd>lua require("fzf-lua").Windows()<CR>', { silent = true })
end,
Describe the bug / steps to reproduce
Sometime in the last few weeks, actions.file_tabedit has stopped working. Now when I hit ctrl-tab, it opens a new tab for the file but at the wrong directory.
e.g. If I'm editing a file, I can see with echo getcwd() that I'm at /path/to/base/path/to/project. Say I attempt to open include/file.hpp with ctrl-t (file_tabedit), it SHOULD open:
/path/to/base/path/to/project/include/file.hpp
But instead it opens:
/path/to/base/include/file.hpp
which doesn't exist.
file_split and file_vsplit and work as expected, it's only file_tabedit that stopped working.
Steps to reproduce
- Use fzf-lua at a commit that includes 9dd089f
- Open nvim in
/path/to/base
- Somehow open a file deeper in the path, i.e.
/path/to/base/path/to/project/include/file.hpp. Use tcd to set your current directory to to /path/to/base/path/to/project. - I think tcd is correct, in my case I use nvim-rooter to handle this, as in this example /path/to/base/path/to/project would be a git repo
- Attempt to open another file in this git repo using fzf-lua using the
file_tabedit actions
Speculation
I assume it's related to 9dd089f changing from tab split to tabnew. When I jump back to 562593a the function works as expected.
I use nvim-rooter as well to set my path as my work is spread through many different git repos. Perhaps it's only setting the tab's cwd, and tabnew creates a tab with the original cwd? Just speculating.
RTFM Checklist
man fzf/ I am well versed in shell fzfOperating system
Linux
Shell
zsh
Neovim version (
nvim --version)v0.11.0-dev-1649+gc47496791a
Fzf version (
fzf --version)0.60.2 (c0d407f7)
Output of
:lua print(os.getenv('FZF_DEFAULT_OPTS'))nil
Is the problem reproducible with
mini.sh?mini.shmini.shmini.sh(not relevant, requires LSP, Windows, etc)Fzf-lua configuration
Describe the bug / steps to reproduce
Sometime in the last few weeks,
actions.file_tabedithas stopped working. Now when I hit ctrl-tab, it opens a new tab for the file but at the wrong directory.e.g. If I'm editing a file, I can see with
echo getcwd()that I'm at/path/to/base/path/to/project. Say I attempt to openinclude/file.hppwith ctrl-t (file_tabedit), it SHOULD open:But instead it opens:
which doesn't exist.
file_splitandfile_vsplitand work as expected, it's onlyfile_tabeditthat stopped working.Steps to reproduce
/path/to/base/path/to/base/path/to/project/include/file.hpp. Usetcdto set your current directory to to/path/to/base/path/to/project. - I thinktcdis correct, in my case I use nvim-rooter to handle this, as in this example/path/to/base/path/to/projectwould be a git repofile_tabeditactionsSpeculation
I assume it's related to 9dd089f changing from
tab splittotabnew. When I jump back to 562593a the function works as expected.I use nvim-rooter as well to set my path as my work is spread through many different git repos. Perhaps it's only setting the tab's cwd, and
tabnewcreates a tab with the original cwd? Just speculating.