Skip to content

Commit 3e5d0e6

Browse files
committed
WIP
1 parent 8161cb9 commit 3e5d0e6

File tree

9 files changed

+490
-181
lines changed

9 files changed

+490
-181
lines changed

.luarc.jsonc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
"$VIMRUNTIME/lua",
1616
"${3rd}/luv/library",
1717
"$XDG_DATA_HOME/nvim/lazy/plenary.nvim/lua",
18-
"$LOCALAPPDATA/nvim-data/lazy/plenary.nvim/lua"
18+
"$LOCALAPPDATA/nvim-data/lazy/plenary.nvim/lua",
19+
// For "cmp_src.lua" type resolving
20+
"$XDG_DATA_HOME/nvim/lazy/nvim-cmp/lua",
21+
"$LOCALAPPDATA/nvim-data/lazy/nvim-cmp/lua"
1922
],
2023
"checkThirdParty": false,
2124
"maxPreload": 2000,

OPTIONS.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Fzf-Lua Options
2+
3+
## Setup
4+
5+
---
6+
7+
## Globals
8+
9+
Globals are options that aren't picker-specific and can be used with all fzf-lua commands, for
10+
example, positioning the floating window at the bottom line using `globals.winopts.row`:
11+
12+
> The `globals` prefix denotates the scope of the option and is therefore omitted
13+
14+
Using `FzfLua` user command:
15+
```lua
16+
:FzfLua files winopts.row=1
17+
```
18+
19+
Using Lua:
20+
```lua
21+
:lua require("fzf-lua").files({ winopts = { row = 1 } })
22+
-- Using the recursive option format
23+
:lua require("fzf-lua").files({ ["winopts.row"] = 1 })
24+
```
25+
26+
#### globals.query
27+
28+
Type: `string`, Default: `nil`
29+
30+
Initial query (prompt text), passed to fzf as `--query` flag.
31+
32+
#### globals.header
33+
34+
Type: `string|false`, Default: `nil`
35+
36+
Header line, set to any string to display a header line, set to `false` to disable fzf-lua
37+
interactive headers (e.g. "ctrl-g to disable .gitignore", etc).
38+
39+
#### globals.winopts.row
40+
41+
Type: `number`, Default: `0.35`
42+
43+
Screen row where to place the fzf-lua float window, between 0-1 will represent precentage of `vim.o.lines` (0: top, 1: bottom), if >= 1 will attempt to place the float in the exact screen line.
44+
45+
#### globals.winopts.col
46+
47+
Type: `number`, Default: `0.55`
48+
49+
Screen column where to place the fzf-lua float window, between 0-1 will represent precentage of `vim.o.columns` (0: leftmost, 1: rightmost), if >= 1 will attempt to place the float in the exact screen column.
50+
51+
#### globals.winopts.preview.border
52+
53+
Type: `string`, Default: `border`
54+
55+
Applies only to fzf native previewers (i.e. `bat`, `git_status`), set to `noborder` to hide the preview border, consult `man fzf` for all vailable options.
56+
57+
### Cmd: files
58+
59+
Files picker, will enumrate the filesystem of the current working directory using `fd`, `rg` and `grep` or `dir.exe`.
60+
61+
---
62+
63+
#### files.cwd
64+
65+
Type: `string`, Default: `nil`
66+
67+
Sets the current working directory.
68+
69+
#### files.cwd_prompt
70+
71+
Type: `boolean`, Default: `true`
72+
73+
Display the current working directory in the prompt (`fzf.vim` style).
74+
75+
#### files.cwd_prompt_shorten_len
76+
77+
Type: `number`, Default: `32`
78+
79+
Prompt over this length will be shortened, e.g. `~/.config/nvim/lua/` will be shortened to `~/.c/n/lua/` (for more info see `:help pathshorten`).
80+
81+
<sub><sup>*Requires `cwd_prompt=true`</sup></sub>
82+
83+
#### files.cwd_prompt_shorten_val
84+
85+
Type: `number`, Default: `1`
86+
87+
Length of shortened prompt path parts, e.g. set to `2`, `~/.config/nvim/lua/` will be shortened to `~/.co/nv/lua/` (for more info see `:help pathshorten`).
88+
89+
<sub><sup>*Requires `cwd_prompt=true`</sup></sub>
90+
91+
### Cmd: LSP commands
92+
93+
#### lsp_references
94+
95+
LSP references
96+
97+
#### async_or_timeout
98+
99+
Type: `number|boolean`, Default: `5000`
100+
101+
Whether LSP calls are made block, set to `true` for asynchronous, otherwise defines the timeout
102+
(ms) for the LPS request via `vim.lsp.buf_request_sync`.
103+
104+
<!--- vim: set nospell: -->

doc/fzf-lua-opts.txt

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
*fzf-lua-opts.txt* For Neovim >= 0.8.0 Last change: 2024 April 06
2+
3+
==============================================================================
4+
Table of Contents *fzf-lua-opts-table-of-contents*
5+
6+
Setup ................................................... |fzf-lua-opts-setup|
7+
Globals ............................................... |fzf-lua-opts-globals|
8+
Cmd: files ......................................... |fzf-lua-opts-cmd:-files|
9+
Cmd: LSP commands ........................... |fzf-lua-opts-cmd:-lsp-commands|
10+
11+
==============================================================================
12+
FZF-LUA OPTIONS *fzf-lua-opts-fzf-lua-options*
13+
14+
15+
16+
------------------------------------------------------------------------------
17+
SETUP *fzf-lua-opts-setup*
18+
19+
20+
21+
------------------------------------------------------------------------------
22+
GLOBALS *fzf-lua-opts-globals*
23+
24+
25+
26+
27+
winopts.row *fzf-lua-opts-winopts.row*
28+
29+
Type: `number`, Default: `0.35`
30+
31+
Screen row where to place the fzf-lua float window, between 0-1 will represent
32+
precentage of `vim.o.lines` (0: top, 1: bottom), if >= 1 will attempt to place
33+
the float in the exact screen line.
34+
35+
36+
37+
winopts.col *fzf-lua-opts-winopts.col*
38+
39+
Type: `number`, Default: `0.55`
40+
41+
Screen column where to place the fzf-lua float window, between 0-1 will
42+
represent precentage of `vim.o.columns` (0: leftmost, 1: rightmost), if >= 1
43+
will attempt to place the float in the exact screen column.
44+
45+
46+
47+
winopts.preview.border *fzf-lua-opts-winopts.preview.border*
48+
49+
Type: `string`, Default: `border`
50+
51+
Applies only to fzf native previewers (i.e. `bat`, `git_status`), set to
52+
`noborder` to hide the preview border, consult `man fzf` for all vailable
53+
options.
54+
55+
56+
57+
CMD: FILES *fzf-lua-opts-cmd:-files*
58+
59+
Files picker, will enumrate the filesystem of the current working directory
60+
using `fd`, `rg` and `grep` or `dir.exe`.
61+
62+
63+
64+
files.cwd *fzf-lua-opts-files.cwd*
65+
66+
Type: `string`, Default: `nil`
67+
68+
Sets the current working directory.
69+
70+
71+
72+
files.cwd_prompt *fzf-lua-opts-files.cwd_prompt*
73+
74+
Type: `boolean`, Default: `true`
75+
76+
Display the current working directory in the prompt (`fzf.vim` style).
77+
78+
79+
80+
files.cwd_prompt_shorten_len *fzf-lua-opts-files.cwd_prompt_shorten_len*
81+
82+
Type: `number`, Default: `32`
83+
84+
Prompt over this length will be shortened, e.g. `~/.config/nvim/lua/` will be
85+
shortened to `~/.c/n/lua/` (for more info see `:help pathshorten`).
86+
87+
<sub><sup>*Requires `cwd_prompt=true`</sup></sub>
88+
89+
90+
91+
files.cwd_prompt_shorten_val *fzf-lua-opts-files.cwd_prompt_shorten_val*
92+
93+
Type: `number`, Default: `1`
94+
95+
Length of shortened prompt path parts, e.g. set to `2`, `~/.config/nvim/lua/`
96+
will be shortened to `~/.co/nv/lua/` (for more info see `:help pathshorten`).
97+
98+
<sub><sup>*Requires `cwd_prompt=true`</sup></sub>
99+
100+
101+
102+
CMD: LSP COMMANDS *fzf-lua-opts-cmd:-lsp-commands*
103+
104+
105+
106+
lsp_references *fzf-lua-opts-lsp_references*
107+
108+
LSP references
109+
110+
111+
112+
async_or_timeout *fzf-lua-opts-async_or_timeout*
113+
114+
Type: `number|boolean`, Default: `5000`
115+
116+
Whether LSP calls are made block, set to `true` for asynchronous, otherwise
117+
defines the timeout (ms) for the LPS request via `vim.lsp.buf_request_sync`.
118+
119+
120+
vim:tw=78:ts=8:ft=help:norl:

0 commit comments

Comments
 (0)