From c7b75e13c66b31b83ce93c43b29861c3c2b332ea Mon Sep 17 00:00:00 2001 From: bhagwan Date: Thu, 18 Nov 2021 18:36:32 -0800 Subject: [PATCH] README: default 'rg_opts' corrected (closes #216) --- README.md | 23 +++++++++++++---------- doc/fzf-lua.txt | 23 +++++++++++++---------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index c3c6703..5ef7531 100644 --- a/README.md +++ b/README.md @@ -363,19 +363,19 @@ require'fzf-lua'.setup { }, -- provider setup files = { - -- previewer = "cat", -- uncomment to override previewer + -- previewer = "cat", -- uncomment to override previewer prompt = 'Files❯ ', - cmd = '', -- "find . -type f -printf '%P\n'", git_icons = true, -- show git icons? file_icons = true, -- show file icons? color_icons = true, -- colorize file|git icons - -- if 'cmd' is not specified, 'files' priortizes 'fd' over 'find' - -- 'fd_opts' if using 'fd', 'find_opts' if using 'find' + -- executed command priority is 'cmd' (if exists) + -- otherwise auto-detect prioritizes `fd` over `find` + -- default options are controlled by 'fd|find_opts' -- NOTE: 'find -printf' requires GNU find + -- cmd = "find . -type f -printf '%P\n'", find_opts = [[-type f -not -path '*/\.git/*' -printf '%P\n']], - fd_opts = - [[--color never --type f --hidden --follow ]] .. - [[--exclude .git --exclude node_modules --exclude '*.pyc']], + fd_opts = [[--color never --type f --hidden --follow ]] .. + [[--exclude .git --exclude node_modules --exclude '*.pyc']], actions = { -- set bind to 'false' to disable an action -- default action opens a single selection @@ -448,12 +448,15 @@ require'fzf-lua'.setup { grep = { prompt = 'Rg❯ ', input_prompt = 'Grep For❯ ', - -- cmd = "rg --vimgrep", - rg_opts = "--hidden --column --line-number --no-heading " .. - "--color=always --smart-case -g '!{.git,node_modules}/*'", git_icons = true, -- show git icons? file_icons = true, -- show file icons? color_icons = true, -- colorize file|git icons + -- executed command priority is 'cmd' (if exists) + -- otherwise auto-detect prioritizes `rg` over `grep` + -- default options are controlled by 'rg|grep_opts' + -- cmd = "rg --vimgrep", + rg_opts = "--column --line-number --no-heading --color=always --smart-case --max-columns=512", + grep_opts = "--binary-files=without-match --line-number --recursive --color=auto --perl-regexp", -- 'true' enables file and git icons in 'live_grep' -- degrades performance in large datasets, YMMV experimental = false, diff --git a/doc/fzf-lua.txt b/doc/fzf-lua.txt index 0546506..6834b6c 100644 --- a/doc/fzf-lua.txt +++ b/doc/fzf-lua.txt @@ -397,19 +397,19 @@ Consult the list below for available settings: }, -- provider setup files = { - -- previewer = "cat", -- uncomment to override previewer + -- previewer = "cat", -- uncomment to override previewer prompt = 'Files❯ ', - cmd = '', -- "find . -type f -printf '%P\n'", git_icons = true, -- show git icons? file_icons = true, -- show file icons? color_icons = true, -- colorize file|git icons - -- if 'cmd' is not specified, 'files' priortizes 'fd' over 'find' - -- 'fd_opts' if using 'fd', 'find_opts' if using 'find' + -- executed command priority is 'cmd' (if exists) + -- otherwise auto-detect prioritizes `fd` over `find` + -- default options are controlled by 'fd|find_opts' -- NOTE: 'find -printf' requires GNU find + -- cmd = "find . -type f -printf '%P\n'", find_opts = [[-type f -not -path '*/\.git/*' -printf '%P\n']], - fd_opts = - [[--color never --type f --hidden --follow ]] .. - [[--exclude .git --exclude node_modules --exclude '*.pyc']], + fd_opts = [[--color never --type f --hidden --follow ]] .. + [[--exclude .git --exclude node_modules --exclude '*.pyc']], actions = { -- set bind to 'false' to disable an action -- default action opens a single selection @@ -482,12 +482,15 @@ Consult the list below for available settings: grep = { prompt = 'Rg❯ ', input_prompt = 'Grep For❯ ', - -- cmd = "rg --vimgrep", - rg_opts = "--hidden --column --line-number --no-heading " .. - "--color=always --smart-case -g '!{.git,node_modules}/*'", git_icons = true, -- show git icons? file_icons = true, -- show file icons? color_icons = true, -- colorize file|git icons + -- executed command priority is 'cmd' (if exists) + -- otherwise auto-detect prioritizes `rg` over `grep` + -- default options are controlled by 'rg|grep_opts' + -- cmd = "rg --vimgrep", + rg_opts = "--column --line-number --no-heading --color=always --smart-case --max-columns=512", + grep_opts = "--binary-files=without-match --line-number --recursive --color=auto --perl-regexp", -- 'true' enables file and git icons in 'live_grep' -- degrades performance in large datasets, YMMV experimental = false,