Skip to content

Commit

Permalink
[docgen] CI: autogenerate vimdoc
Browse files Browse the repository at this point in the history
skip-checks: true
  • Loading branch information
Github Actions committed Oct 7, 2023
1 parent 434cacd commit c1de84f
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions doc/fzf-lua.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*fzf-lua.txt* For Neovim >= 0.5.0 Last change: 2023 October 04
*fzf-lua.txt* For Neovim >= 0.5.0 Last change: 2023 October 07

==============================================================================
Table of Contents *fzf-lua-table-of-contents*
Expand Down Expand Up @@ -409,7 +409,6 @@ COMPLETION FUNCTIONS *fzf-lua-completion-functions*

| Command | List |
| -------------------- | ------------------------------------------ |
| `fzf_complete` | custom completion (see below) |
| `complete_path` | complete path under cursor (incl dirs) |
| `complete_file` | complete file under cursor (excl dirs) |
| `complete_line` | complete line (all open buffers) |
Expand Down Expand Up @@ -536,11 +535,35 @@ Or with a custom command and preview:

CUSTOM COMPLETION *fzf-lua-custom-completion*

Custom completion is also possible using `fzf_complete`, the signature for
`fzf_complete` is equivalent to `fzf_exec = function(contents, [opts])`, for
more info how to use the API, please refer to Wiki/ADVANCED
<https://github.com/ibhagwan/fzf-lua/wiki/Advanced>.
Every fzf-lua function can be easily converted to a completion function by
sending `complete = true` in the options:

By default fzf-lua will insert the entry at the cursor location as if you used
`p` to paste the selected entry.

>lua
require("fzf-lua").fzf_exec({"foo", "bar"}, {complete = true})
<
Custom completion is possible using a custom completion callback, the example
below will replace the text from the current cursor column with the selected
entry:

>lua
require("fzf-lua").fzf_exec({"foo", "bar"}, {
-- @param selected: the selected entry or entries
-- @param opts: fzf-lua caller/provider options
-- @param line: originating buffer completed line
-- @param col: originating cursor column location
-- @return newline: will replace the current buffer line
-- @return newcol?: optional, sets the new cursor column
complete = function(selected, opts, line, col)
local newline = line:sub(1, col) .. selected[1]
-- set cursor to EOL, since `nvim_win_set_cursor`
-- is 0-based we have to lower the col value by 1
return newline, #newline - 1
end
})
<


DEFAULT OPTIONS *fzf-lua-default-options*
Expand Down Expand Up @@ -1235,15 +1258,15 @@ open an issue and I'll be more than happy to help.**
},
complete_path = {
cmd = nil, -- default: auto detect fd|rg|find
actions = { ["default"] = actions.complete_insert },
complete = { ["default"] = actions.complete },
},
complete_file = {
cmd = nil, -- default: auto detect rg|fd|find
file_icons = true,
color_icons = true,
git_icons = false,
-- actions inherit from 'actions.files' and merge
actions = { ["default"] = actions.complete_insert },
actions = { ["default"] = actions.complete },
-- previewer hidden by default
winopts = { preview = { hidden = "hidden" } },
},
Expand Down

0 comments on commit c1de84f

Please sign in to comment.