-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfzf.lua
52 lines (50 loc) · 2.42 KB
/
fzf.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
return {
"ibhagwan/fzf-lua",
cmd = "FzfLua",
dependencies = { "echasnovski/mini.icons" },
keys = {
-- stylua: ignore start
{"<leader>/", "<cmd>FzfLua live_grep<cr>", desc = "grep"},
{"<leader><space>", "<cmd>FzfLua files<cr>", desc = "files"},
{"<leader>fb", "<cmd>FzfLua buffers<cr>", desc = "buffers"},
{"<leader>fc", "<cmd>FzfLua git_commits<cr>", desc = "commits"},
{"<leader>ff", "<cmd>FzfLua files<cr>", desc = "files"},
{"<leader>fg", "<cmd>FzfLua git_files<cr>", desc = "git files"},
{"<leader>fp", "<cmd>FzfLua files cwd=" .. require("lazy.core.config").options.root .. "<cr>", desc = "files"},
{"<leader>sh", "<cmd>FzfLua helptags<cr>", desc = "help"},
{"<leader>sk", "<cmd>FzfLua keymaps<cr>", desc = "keymaps"},
{"<leader>sw", "<cmd>FzfLua grep_cword<cr>", desc = "keymaps"},
-- stylua: ignore end
},
opts = function()
local config = require("fzf-lua.config")
-- Quickfix
-- stylua: ignore start
config.defaults.keymap.fzf["ctrl-q"] = "select-all+accept"
config.defaults.keymap.fzf["ctrl-u"] = "half-page-up"
config.defaults.keymap.fzf["ctrl-d"] = "half-page-down"
config.defaults.keymap.fzf["ctrl-x"] = "jump"
config.defaults.keymap.fzf["ctrl-f"] = "preview-page-down"
config.defaults.keymap.fzf["ctrl-b"] = "preview-page-up"
config.defaults.keymap.builtin["<c-f>"] = "preview-page-down"
config.defaults.keymap.builtin["<c-b>"] = "preview-page-up"
-- stylua: ignore end
return {
"default-title",
fzf_colors = true,
fzf_opts = {
["--no-scrollbar"] = true,
},
defaults = {
formatter = "path.filename_first",
},
files = {
prompt = "F❯ ",
cwd_prompt = false,
},
grep = {
rg_opts = "--column --line-number --no-heading --color=always --smart-case --hidden --glob '!.git/**' --max-columns=4096 -e ",
},
}
end,
}