README update

main
bhagwan 2 years ago
parent f452111888
commit 782b8599fd

@ -69,6 +69,7 @@ Using [vim-plug](https://github.com/junegunn/vim-plug)
```vim ```vim
Plug 'ibhagwan/fzf-lua' Plug 'ibhagwan/fzf-lua'
" optional for icon support
Plug 'kyazdani42/nvim-web-devicons' Plug 'kyazdani42/nvim-web-devicons'
``` ```
@ -213,6 +214,8 @@ Consult the list below for available settings:
```lua ```lua
local actions = require "fzf-lua.actions" local actions = require "fzf-lua.actions"
require'fzf-lua'.setup { require'fzf-lua'.setup {
-- fzf_bin = 'sk', -- use skim instead of fzf?
-- https://github.com/lotabout/skim
global_resume = true, -- enable global `resume`? global_resume = true, -- enable global `resume`?
-- can also be sent individually: -- can also be sent individually:
-- `<any_function>.({ gl ... })` -- `<any_function>.({ gl ... })`
@ -224,7 +227,7 @@ require'fzf-lua'.setup {
-- "belowright vnew" : split right -- "belowright vnew" : split right
-- "aboveleft vnew : split left -- "aboveleft vnew : split left
-- Only valid when using a float window -- Only valid when using a float window
-- (i.e. when 'split' is not defined) -- (i.e. when 'split' is not defined, default)
height = 0.85, -- window height height = 0.85, -- window height
width = 0.80, -- window width width = 0.80, -- window width
row = 0.35, -- window row position (0=top, 1=bottom) row = 0.35, -- window row position (0=top, 1=bottom)
@ -320,9 +323,6 @@ require'fzf-lua'.setup {
["shift-up"] = "preview-page-up", ["shift-up"] = "preview-page-up",
}, },
}, },
-- use skim instead of fzf?
-- https://github.com/lotabout/skim
-- fzf_bin = 'sk',
fzf_opts = { fzf_opts = {
-- options are sent as `<left>=<right>` -- options are sent as `<left>=<right>`
-- set to `false` to remove a flag -- set to `false` to remove a flag
@ -336,19 +336,19 @@ require'fzf-lua'.setup {
}, },
-- fzf '--color=' options (optional) -- fzf '--color=' options (optional)
--[[ fzf_colors = { --[[ fzf_colors = {
["fg"] = { "fg", "CursorLine" }, ["fg"] = { "fg", "CursorLine" },
["bg"] = { "bg", "Normal" }, ["bg"] = { "bg", "Normal" },
["hl"] = { "fg", "Comment" }, ["hl"] = { "fg", "Comment" },
["fg+"] = { "fg", "Normal" }, ["fg+"] = { "fg", "Normal" },
["bg+"] = { "bg", "CursorLine" }, ["bg+"] = { "bg", "CursorLine" },
["hl+"] = { "fg", "Statement" }, ["hl+"] = { "fg", "Statement" },
["info"] = { "fg", "PreProc" }, ["info"] = { "fg", "PreProc" },
["prompt"] = { "fg", "Conditional" }, ["prompt"] = { "fg", "Conditional" },
["pointer"] = { "fg", "Exception" }, ["pointer"] = { "fg", "Exception" },
["marker"] = { "fg", "Keyword" }, ["marker"] = { "fg", "Keyword" },
["spinner"] = { "fg", "Label" }, ["spinner"] = { "fg", "Label" },
["header"] = { "fg", "Comment" }, ["header"] = { "fg", "Comment" },
["gutter"] = { "bg", "Normal" }, ["gutter"] = { "bg", "Normal" },
}, ]] }, ]]
previewers = { previewers = {
cat = { cat = {
@ -382,7 +382,9 @@ require'fzf-lua'.setup {
}, },
-- provider setup -- provider setup
files = { files = {
-- previewer = "cat", -- uncomment to override previewer -- previewer = "bat", -- uncomment to override previewer
-- (name from 'previewers' table)
-- set to 'false' to disable
prompt = 'Files ', prompt = 'Files ',
multiprocess = true, -- run command in a separate process multiprocess = true, -- run command in a separate process
git_icons = true, -- show git icons? git_icons = true, -- show git icons?
@ -400,7 +402,7 @@ require'fzf-lua'.setup {
-- set bind to 'false' to disable an action -- set bind to 'false' to disable an action
-- default action opens a single selection -- default action opens a single selection
-- or sends multiple selection to quickfix -- or sends multiple selection to quickfix
-- replace the default aciton with the below -- replace the default action with the below
-- to open all files whether single or multiple -- to open all files whether single or multiple
-- ["default"] = actions.file_edit, -- ["default"] = actions.file_edit,
["default"] = actions.file_edit_or_qf, ["default"] = actions.file_edit_or_qf,
@ -471,9 +473,9 @@ require'fzf-lua'.setup {
["A"] = { icon = "A", color = "green" }, ["A"] = { icon = "A", color = "green" },
["?"] = { icon = "?", color = "magenta" }, ["?"] = { icon = "?", color = "magenta" },
-- override git icons? -- override git icons?
-- ["M"] = { icon = "★", color = "red" }, -- ["M"] = { icon = "★", color = "red" },
-- ["D"] = { icon = "✗", color = "red" }, -- ["D"] = { icon = "✗", color = "red" },
-- ["A"] = { icon = "+", color = "green" }, -- ["A"] = { icon = "+", color = "green" },
}, },
}, },
grep = { grep = {
@ -496,17 +498,14 @@ require'fzf-lua'.setup {
args = { args = {
prompt = 'Args ', prompt = 'Args ',
files_only = true, files_only = true,
actions = { -- added on top of regular file actions
-- added on top of regular file actions actions = { ["ctrl-x"] = actions.arg_del }
["ctrl-x"] = actions.arg_del,
}
}, },
oldfiles = { oldfiles = {
prompt = 'History ', prompt = 'History ',
cwd_only = false, cwd_only = false,
}, },
buffers = { buffers = {
-- previewer = false, -- disable the builtin previewer?
prompt = 'Buffers ', prompt = 'Buffers ',
file_icons = true, -- show file icons? file_icons = true, -- show file icons?
color_icons = true, -- colorize file|git icons color_icons = true, -- colorize file|git icons
@ -563,14 +562,8 @@ require'fzf-lua'.setup {
colorschemes = { colorschemes = {
prompt = 'Colorschemes ', prompt = 'Colorschemes ',
live_preview = true, -- apply the colorscheme on preview? live_preview = true, -- apply the colorscheme on preview?
actions = { actions = { ["default"] = actions.colorscheme, },
["default"] = actions.colorscheme, winopts = { height = 0.55, width = 0.30, },
["ctrl-y"] = function(selected) print(selected[1]) end,
},
winopts = {
height = 0.55,
width = 0.30,
},
post_reset_cb = function() post_reset_cb = function()
-- reset statusline highlights after -- reset statusline highlights after
-- a live_preview of the colorscheme -- a live_preview of the colorscheme
@ -578,13 +571,11 @@ require'fzf-lua'.setup {
end, end,
}, },
quickfix = { quickfix = {
-- cwd = vim.loop.cwd(),
file_icons = true, file_icons = true,
git_icons = true, git_icons = true,
}, },
lsp = { lsp = {
prompt = ' ', prompt = ' ',
-- cwd = vim.loop.cwd(),
cwd_only = false, -- LSP/diagnostics for cwd only? cwd_only = false, -- LSP/diagnostics for cwd only?
async_or_timeout = 5000, -- timeout(ms) or 'true' for async calls async_or_timeout = 5000, -- timeout(ms) or 'true' for async calls
file_icons = true, file_icons = true,
@ -599,7 +590,7 @@ require'fzf-lua'.setup {
}, },
}, },
-- uncomment to disable the previewer -- uncomment to disable the previewer
-- nvim = { marks = { previewer = { _ctor = false } } }, -- nvim = { marks = { previewer = { _ctor = false } } },
-- helptags = { previewer = { _ctor = false } }, -- helptags = { previewer = { _ctor = false } },
-- manpages = { previewer = { _ctor = false } }, -- manpages = { previewer = { _ctor = false } },
-- uncomment to set dummy win location (help|man bar) -- uncomment to set dummy win location (help|man bar)

@ -84,6 +84,7 @@ Using vim-plug <https://github.com/junegunn/vim-plug>
> >
Plug 'ibhagwan/fzf-lua' Plug 'ibhagwan/fzf-lua'
" optional for icon support
Plug 'kyazdani42/nvim-web-devicons' Plug 'kyazdani42/nvim-web-devicons'
< <
Using packer.nvim <https://github.com/wbthomason/packer.nvim> Using packer.nvim <https://github.com/wbthomason/packer.nvim>
@ -251,6 +252,8 @@ Consult the list below for available settings:
> >
local actions = require "fzf-lua.actions" local actions = require "fzf-lua.actions"
require'fzf-lua'.setup { require'fzf-lua'.setup {
-- fzf_bin = 'sk', -- use skim instead of fzf?
-- https://github.com/lotabout/skim
global_resume = true, -- enable global `resume`? global_resume = true, -- enable global `resume`?
-- can also be sent individually: -- can also be sent individually:
-- `<any_function>.({ gl ... })` -- `<any_function>.({ gl ... })`
@ -262,7 +265,7 @@ Consult the list below for available settings:
-- "belowright vnew" : split right -- "belowright vnew" : split right
-- "aboveleft vnew : split left -- "aboveleft vnew : split left
-- Only valid when using a float window -- Only valid when using a float window
-- (i.e. when 'split' is not defined) -- (i.e. when 'split' is not defined, default)
height = 0.85, -- window height height = 0.85, -- window height
width = 0.80, -- window width width = 0.80, -- window width
row = 0.35, -- window row position (0=top, 1=bottom) row = 0.35, -- window row position (0=top, 1=bottom)
@ -358,9 +361,6 @@ Consult the list below for available settings:
["shift-up"] = "preview-page-up", ["shift-up"] = "preview-page-up",
}, },
}, },
-- use skim instead of fzf?
-- https://github.com/lotabout/skim
-- fzf_bin = 'sk',
fzf_opts = { fzf_opts = {
-- options are sent as `<left>=<right>` -- options are sent as `<left>=<right>`
-- set to `false` to remove a flag -- set to `false` to remove a flag
@ -374,19 +374,19 @@ Consult the list below for available settings:
}, },
-- fzf '--color=' options (optional) -- fzf '--color=' options (optional)
--[[ fzf_colors = { --[[ fzf_colors = {
["fg"] = { "fg", "CursorLine" }, ["fg"] = { "fg", "CursorLine" },
["bg"] = { "bg", "Normal" }, ["bg"] = { "bg", "Normal" },
["hl"] = { "fg", "Comment" }, ["hl"] = { "fg", "Comment" },
["fg+"] = { "fg", "Normal" }, ["fg+"] = { "fg", "Normal" },
["bg+"] = { "bg", "CursorLine" }, ["bg+"] = { "bg", "CursorLine" },
["hl+"] = { "fg", "Statement" }, ["hl+"] = { "fg", "Statement" },
["info"] = { "fg", "PreProc" }, ["info"] = { "fg", "PreProc" },
["prompt"] = { "fg", "Conditional" }, ["prompt"] = { "fg", "Conditional" },
["pointer"] = { "fg", "Exception" }, ["pointer"] = { "fg", "Exception" },
["marker"] = { "fg", "Keyword" }, ["marker"] = { "fg", "Keyword" },
["spinner"] = { "fg", "Label" }, ["spinner"] = { "fg", "Label" },
["header"] = { "fg", "Comment" }, ["header"] = { "fg", "Comment" },
["gutter"] = { "bg", "Normal" }, ["gutter"] = { "bg", "Normal" },
}, ]] }, ]]
previewers = { previewers = {
cat = { cat = {
@ -420,7 +420,9 @@ Consult the list below for available settings:
}, },
-- provider setup -- provider setup
files = { files = {
-- previewer = "cat", -- uncomment to override previewer -- previewer = "bat", -- uncomment to override previewer
-- (name from 'previewers' table)
-- set to 'false' to disable
prompt = 'Files ', prompt = 'Files ',
multiprocess = true, -- run command in a separate process multiprocess = true, -- run command in a separate process
git_icons = true, -- show git icons? git_icons = true, -- show git icons?
@ -438,7 +440,7 @@ Consult the list below for available settings:
-- set bind to 'false' to disable an action -- set bind to 'false' to disable an action
-- default action opens a single selection -- default action opens a single selection
-- or sends multiple selection to quickfix -- or sends multiple selection to quickfix
-- replace the default aciton with the below -- replace the default action with the below
-- to open all files whether single or multiple -- to open all files whether single or multiple
-- ["default"] = actions.file_edit, -- ["default"] = actions.file_edit,
["default"] = actions.file_edit_or_qf, ["default"] = actions.file_edit_or_qf,
@ -509,9 +511,9 @@ Consult the list below for available settings:
["A"] = { icon = "A", color = "green" }, ["A"] = { icon = "A", color = "green" },
["?"] = { icon = "?", color = "magenta" }, ["?"] = { icon = "?", color = "magenta" },
-- override git icons? -- override git icons?
-- ["M"] = { icon = "★", color = "red" }, -- ["M"] = { icon = "★", color = "red" },
-- ["D"] = { icon = "✗", color = "red" }, -- ["D"] = { icon = "✗", color = "red" },
-- ["A"] = { icon = "+", color = "green" }, -- ["A"] = { icon = "+", color = "green" },
}, },
}, },
grep = { grep = {
@ -534,17 +536,14 @@ Consult the list below for available settings:
args = { args = {
prompt = 'Args ', prompt = 'Args ',
files_only = true, files_only = true,
actions = { -- added on top of regular file actions
-- added on top of regular file actions actions = { ["ctrl-x"] = actions.arg_del }
["ctrl-x"] = actions.arg_del,
}
}, },
oldfiles = { oldfiles = {
prompt = 'History ', prompt = 'History ',
cwd_only = false, cwd_only = false,
}, },
buffers = { buffers = {
-- previewer = false, -- disable the builtin previewer?
prompt = 'Buffers ', prompt = 'Buffers ',
file_icons = true, -- show file icons? file_icons = true, -- show file icons?
color_icons = true, -- colorize file|git icons color_icons = true, -- colorize file|git icons
@ -601,14 +600,8 @@ Consult the list below for available settings:
colorschemes = { colorschemes = {
prompt = 'Colorschemes ', prompt = 'Colorschemes ',
live_preview = true, -- apply the colorscheme on preview? live_preview = true, -- apply the colorscheme on preview?
actions = { actions = { ["default"] = actions.colorscheme, },
["default"] = actions.colorscheme, winopts = { height = 0.55, width = 0.30, },
["ctrl-y"] = function(selected) print(selected[1]) end,
},
winopts = {
height = 0.55,
width = 0.30,
},
post_reset_cb = function() post_reset_cb = function()
-- reset statusline highlights after -- reset statusline highlights after
-- a live_preview of the colorscheme -- a live_preview of the colorscheme
@ -616,13 +609,11 @@ Consult the list below for available settings:
end, end,
}, },
quickfix = { quickfix = {
-- cwd = vim.loop.cwd(),
file_icons = true, file_icons = true,
git_icons = true, git_icons = true,
}, },
lsp = { lsp = {
prompt = ' ', prompt = ' ',
-- cwd = vim.loop.cwd(),
cwd_only = false, -- LSP/diagnostics for cwd only? cwd_only = false, -- LSP/diagnostics for cwd only?
async_or_timeout = 5000, -- timeout(ms) or 'true' for async calls async_or_timeout = 5000, -- timeout(ms) or 'true' for async calls
file_icons = true, file_icons = true,
@ -637,7 +628,7 @@ Consult the list below for available settings:
}, },
}, },
-- uncomment to disable the previewer -- uncomment to disable the previewer
-- nvim = { marks = { previewer = { _ctor = false } } }, -- nvim = { marks = { previewer = { _ctor = false } } },
-- helptags = { previewer = { _ctor = false } }, -- helptags = { previewer = { _ctor = false } },
-- manpages = { previewer = { _ctor = false } }, -- manpages = { previewer = { _ctor = false } },
-- uncomment to set dummy win location (help|man bar) -- uncomment to set dummy win location (help|man bar)

Loading…
Cancel
Save