junegunn / fzf.vim

fzf :heart: vim
MIT License
9.55k stars 583 forks source link

:Rg and :FZF works only on the first time and not any other times #1437

Closed KritPaoIn closed 1 year ago

KritPaoIn commented 1 year ago

https://user-images.githubusercontent.com/92923965/199276288-1ff11dd5-e6c6-45a5-bb39-4f05f3095879.mov

https://user-images.githubusercontent.com/92923965/199277263-a49ebe15-0a02-4d50-9d0b-1ed4b42ec7a8.mov

config:

vim.g.fzf_action = {
    ["ctrl-t"] = "tab split",
    ["ctrl-x"] = "split",
    ["ctrl-v"] = "vsplit",
}

vim.g.fzf_layout = {
    window = {
        width = 0.9,
        height = 0.6,
    },
}

vim.g.fzf_colors = {
    fg = { "fg", "Normal" },
    bg = { "bg", "Normal" },
    hl = { "fg", "Statement" },
    ["hl+"] = { "fg", "Statement" },
    ["fg+"] = { "fg", "Normal" },
    ["bg+"] = { "bg", "CursorLine" },
    info = { "fg", "Comment" },
    border = { "fg", "FloatBorder" },
    prompt = { "fg", "Type" },
    pointer = { "fg", "Exception" },
    marker = { "fg", "Keyword" },
    spinner = { "fg", "Label" },
    header = { "fg", "Comment" },
}

vim.cmd([[
let $FZF_DEFAULT_OPTS='--reverse'
]])

vim.g.fzf_history_dir = "~/.local/share/fzf-history"

vim.keymap.set("n", "<C-p>", "<Cmd>FZF<CR>")
vim.keymap.set("n", "<C-g>", "<Cmd>Rg<CR>")
KritPaoIn commented 1 year ago

Fixed. Apparently, vim-rooter only worked on the second time.