robin/artio.nvim

minimal ui2 fuzzy finder for Neovim

git clone https://git.robinwobin.dev/robin/artio.nvim

robinfeat!: collapse qflist actions into one8fb9b8a

main
3.0 KiB114 linesraw

artio.nvim

A minimal, nature-infused file picker for Neovim using ui2. Inspired by forest spirits and the calm intuition of hunting, Artio helps you gently select files without the weight of heavy fuzzy-finder dependencies.

preview

features

Requires Neovim >= 0.12

  • Lightweight picker window built on Neovim's ui2
  • Prompt + list UI components - minimal and focused
  • Fuzzy filtering using matchfuzzy (built-in)
  • Icon support for common filetypes through mini.icons (optional)
  • No heavy dependencies - pure Lua

ui2

artio requires ui2 to be enabled.

an example of how to set this up is:

require("vim._core.ui2").enable({ enable = true, msg = {
  target = "msg",
} })

installation

vim.pack

vim.pack.add({{ src = "https://codeberg.org/comfysage/artio.nvim" }})

lazy.nvim

{
  "comfysage/artio.nvim", lazy = false,
}

configuration

require("artio").setup({
  opts = {
    preselect = true, -- whether to preselect the first match
    bottom = true, -- whether to draw the prompt at the bottom
    shrink = true, -- whether the window should shrink to fit the matches
    promptprefix = "", -- prefix for the prompt
    prompt_title = true, -- whether to draw the prompt title
    pointer = "", -- pointer for the selected match
    marker = "│", -- prefix for marked items
    infolist = { "list" }, -- index: [1] list: (4/5)
    use_icons = true, -- requires mini.icons
  },
  win = {
    height = 12,
    hidestatusline = false, -- works best with laststatus=3
  },
  -- NOTE: if you override the mappings, make sure to provide keys for all actions
  mappings = {
    ["<down>"] = "down",
    ["<up>"] = "up",
    ["<cr>"] = "accept",
    ["<esc>"] = "cancel",
    ["<tab>"] = "mark",
    ["<c-g>"] = "togglelive",
    ["<c-l>"] = "togglepreview",
    ["<c-q>"] = "setqflist",
  },
})

-- override built-in ui select with artio
vim.ui.select = require("artio").select

vim.keymap.set("n", "<leader><leader>", "<Plug>(artio-files)")
vim.keymap.set("n", "<leader>fg", "<Plug>(artio-grep)")

-- smart file picker
vim.keymap.set("n", "<leader>ff", "<Plug>(artio-smart)")

-- general built-in pickers
vim.keymap.set("n", "<leader>fh", "<Plug>(artio-helptags)")
vim.keymap.set("n", "<leader>fb", "<Plug>(artio-buffers)")
vim.keymap.set("n", "<leader>f/", "<Plug>(artio-buffergrep)")
vim.keymap.set("n", "<leader>fo", "<Plug>(artio-oldfiles)")

customize builtin pickers

you're able to override the command used to find files:

-- ignore hidden files
vim.keymap.set("n", "<leader>ff", function()
    require('artio.builtins').files({
        findprg = [[ find . -type f -iregex '.*$*.*' -not -path '*/[@.]*' ]],
    })
end)

community

issues are available on github and codeberg.

pr's are limited to codeberg

1# artio.nvim
2
3A minimal, nature-infused file picker for Neovim using ui2.
4Inspired by forest spirits and the calm intuition of hunting, Artio helps you gently select files without the weight of heavy fuzzy-finder dependencies.
5
6![preview](./assets/preview.png)
7
8## features
9
10Requires Neovim `>= 0.12`
11
12- Lightweight picker window built on Neovim's ui2
13- Prompt + list UI components - minimal and focused
14- Fuzzy filtering using matchfuzzy (built-in)
15- Icon support for common filetypes through [mini.icons](https://github.com/echasnovski/mini.nvim) _(optional)_
16- No heavy dependencies - pure Lua
17
18### ui2
19
20artio requires ui2 to be enabled.
21
22an example of how to set this up is:
23
24```lua
25require("vim._core.ui2").enable({ enable = true, msg = {
26  target = "msg",
27} })
28```
29
30## installation
31
32`vim.pack`
33
34```lua
35vim.pack.add({{ src = "https://codeberg.org/comfysage/artio.nvim" }})
36```
37
38`lazy.nvim`
39
40```lua
41{
42  "comfysage/artio.nvim", lazy = false,
43}
44```
45
46## configuration
47
48```lua
49require("artio").setup({
50  opts = {
51    preselect = true, -- whether to preselect the first match
52    bottom = true, -- whether to draw the prompt at the bottom
53    shrink = true, -- whether the window should shrink to fit the matches
54    promptprefix = "", -- prefix for the prompt
55    prompt_title = true, -- whether to draw the prompt title
56    pointer = "", -- pointer for the selected match
57    marker = "│", -- prefix for marked items
58    infolist = { "list" }, -- index: [1] list: (4/5)
59    use_icons = true, -- requires mini.icons
60  },
61  win = {
62    height = 12,
63    hidestatusline = false, -- works best with laststatus=3
64  },
65  -- NOTE: if you override the mappings, make sure to provide keys for all actions
66  mappings = {
67    ["<down>"] = "down",
68    ["<up>"] = "up",
69    ["<cr>"] = "accept",
70    ["<esc>"] = "cancel",
71    ["<tab>"] = "mark",
72    ["<c-g>"] = "togglelive",
73    ["<c-l>"] = "togglepreview",
74    ["<c-q>"] = "setqflist",
75  },
76})
77
78-- override built-in ui select with artio
79vim.ui.select = require("artio").select
80
81vim.keymap.set("n", "<leader><leader>", "<Plug>(artio-files)")
82vim.keymap.set("n", "<leader>fg", "<Plug>(artio-grep)")
83
84-- smart file picker
85vim.keymap.set("n", "<leader>ff", "<Plug>(artio-smart)")
86
87-- general built-in pickers
88vim.keymap.set("n", "<leader>fh", "<Plug>(artio-helptags)")
89vim.keymap.set("n", "<leader>fb", "<Plug>(artio-buffers)")
90vim.keymap.set("n", "<leader>f/", "<Plug>(artio-buffergrep)")
91vim.keymap.set("n", "<leader>fo", "<Plug>(artio-oldfiles)")
92```
93
94### customize builtin pickers
95
96you're able to override the command used to find files:
97
98```lua
99-- ignore hidden files
100vim.keymap.set("n", "<leader>ff", function()
101    require('artio.builtins').files({
102        findprg = [[ find . -type f -iregex '.*$*.*' -not -path '*/[@.]*' ]],
103    })
104end)
105```
106
107# community
108
109issues are available on [github][github issues] and [codeberg][codeberg issues].
110
111pr's are limited to [codeberg](https://codeberg.org/comfysage/artio.nvim/pulls)
112
113[github issues]: https://github.com/comfysage/artio.nvim/issues
114[codeberg issues]: https://codeberg.org/comfysage/artio.nvim/issues