🐻 minimal ui2 fuzzy finder for Neovim codeberg.org/comfysage/artio.nvim
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

doc: add api section

robin e3e76740 9f4dd183

+128 -1
+102 -1
doc/artio.txt
··· 135 135 136 136 API *artio-api* 137 137 138 - artio.resume() *artio-resume* 138 + artio.pick({opts}) *artio.pick()* 139 + 140 + create a new picker |artio.Picker| and start it. 141 + 142 + >lua 143 + artio.pick({ 144 + items = { 'a', 'b', 'c' }, 145 + fn = artio.sorter, 146 + }) 147 + < 148 + 149 + artio.generic({items}, {props}) *artio.generic()* 150 + 151 + creates a generic picker from the given items and props. 152 + uses the default |artio.sorter| function. 153 + 154 + *artio.select()* 155 + artio.select({items}, {opts}, {on_choice}, {start_opts?}) 156 + 157 + the |vim.ui.select| interface implemented for artio. 158 + adds an optional `{start_opts?}` argument that accepts artio specific 159 + options. 160 + 161 + artio.resume() *artio.resume()* 139 162 140 163 resume the last closed picker. does not work across neovim 141 164 restarts/sessions. 142 165 143 166 Plug: `<Plug>(artio-resume)`. 167 + 168 + API-PICKER *artio-api-picker* 169 + 170 + *artio.Picker* 171 + a picker is a special table that holds the state of the picker. 172 + the current active picker is stored in 173 + `require('artio.picker').active_picker`. 174 + 175 + Fields: ~ 176 + - {items} (`artio.Picker.item[]|string[]`) 177 + array of |artio.Picker.item| or strings. an array of 178 + strings will be converted to items. 179 + - {fn} (`artio.Picker.sorter`) 180 + an instance of |artio.Picker.sorter|. 181 + - {on_close} (`fun(text: string, idx: integer)`) 182 + callback function for when the picker closes (after 183 + accepting a match). gets the `item.text` field as the 184 + first argument and the item id as the second. 185 + - {get_items}? (`fun(input: string): artio.Picker.item[]`) 186 + - {format_item}? (`fun(item: any): string`) 187 + - {preview_item}? (`fun(item: any): integer, fun(win: integer)`) 188 + - {get_icon}? (`fun(item: artio.Picker.item): string, string`) 189 + - {hl_item}? (`fun(item: artio.Picker.item): artio.Picker.hl[]`) 190 + - {on_quit}? (`fun()`) 191 + callback function for when the picker closes before 192 + choosing a match. 193 + - {prompt}? (`string`) 194 + text before prompt prefix. can be disabled with 195 + `config.opts.prompt_title = false`. 196 + - {defaulttext}? (`string`) 197 + start input for picker. 198 + - {prompttext}? (`string`) 199 + defaults to prompt title combined with prompt prefix. 200 + - {opts}? (`artio.config.opts`) 201 + picker options combined with the user config. 202 + - {win}? (`artio.config.win`) 203 + picker window options combined with the user config. 204 + - {actions}? (`table<string, artio.Picker.action>`) 205 + picker specific actions. 206 + - {mappings}? (`table<string, string>`) 207 + mappings from the user config. 208 + 209 + API-SORTER *artio-api-sorter* 210 + 211 + *artio.Picker.sorter* 212 + a function that takes an array of |artio.Picker.item| and an input string 213 + and returns a table of matches |artio.Picker.matches|. 214 + 215 + *artio.Picker.matches* 216 + a table where each key is the id of the item and each value is of 217 + |artio.Picker.match|. 218 + 219 + *artio.Picker.match* 220 + 221 + Fields: ~ 222 + - {1} (`integer`) 223 + id of the item 224 + - {2} (`any`) 225 + array of ' matching ' hls. these correspond to chars of the 226 + `item.text` field. this is based on the output of 227 + |matchfuzzypos|. 228 + - {3} (`integer`) 229 + the score of the match. 230 + 231 + *artio.Picker.item* 232 + 233 + Fields: ~ 234 + - {id} (`integer`) 235 + - {v} (`any`) 236 + - {text} (`string`) 237 + 238 + artio.sorter({items}, {input}) *artio.sorter()* 239 + 240 + the default sorter provides support for pattern matching. a `/.../` match at 241 + the start of the input will limit the fuzzy sorter to items matching the 242 + pattern. if you want to use `/.../` in your fuzzy matches, make sure to 243 + escape it by starting the input with an empty space (` /.../`). fuzzy 244 + sorting will be done on the input with the pattern removed. 144 245 145 246 API-BUILTINS 146 247
+26
doc/tags
··· 1 + artio-api artio.txt /*artio-api* 2 + artio-api-picker artio.txt /*artio-api-picker* 3 + artio-api-sorter artio.txt /*artio-api-sorter* 4 + artio-buffergrep artio.txt /*artio-buffergrep* 5 + artio-buffers artio.txt /*artio-buffers* 6 + artio-builtins artio.txt /*artio-builtins* 7 + artio-colorschemes artio.txt /*artio-colorschemes* 1 8 artio-config artio.txt /*artio-config* 9 + artio-diagnostics artio.txt /*artio-diagnostics* 10 + artio-diagnostics-buffer artio.txt /*artio-diagnostics-buffer* 2 11 artio-features artio.txt /*artio-features* 12 + artio-files artio.txt /*artio-files* 13 + artio-grep artio.txt /*artio-grep* 14 + artio-helptags artio.txt /*artio-helptags* 15 + artio-highlights artio.txt /*artio-highlights* 16 + artio-keymaps artio.txt /*artio-keymaps* 17 + artio-oldfiles artio.txt /*artio-oldfiles* 18 + artio-smart artio.txt /*artio-smart* 19 + artio.Picker artio.txt /*artio.Picker* 20 + artio.Picker.item artio.txt /*artio.Picker.item* 21 + artio.Picker.match artio.txt /*artio.Picker.match* 22 + artio.Picker.matches artio.txt /*artio.Picker.matches* 23 + artio.Picker.sorter artio.txt /*artio.Picker.sorter* 24 + artio.generic() artio.txt /*artio.generic()* 25 + artio.pick() artio.txt /*artio.pick()* 26 + artio.resume() artio.txt /*artio.resume()* 27 + artio.select() artio.txt /*artio.select()* 28 + artio.sorter() artio.txt /*artio.sorter()* 3 29 artio.txt artio.txt /*artio.txt*