minimal extui fuzzy finder for neovim
1if vim.g.loaded_artio then
2 return
3end
4
5vim.g.loaded_artio = true
6
7local augroup = vim.api.nvim_create_augroup("artio:hl", {})
8
9vim.api.nvim_create_autocmd("ColorScheme", {
10 group = augroup,
11 callback = function()
12 local normal_hl = vim.api.nvim_get_hl(0, { name = "Normal" })
13 local msgarea_hl = vim.api.nvim_get_hl(0, { name = "MsgArea" })
14
15 vim.api.nvim_set_hl(0, "ArtioNormal", { fg = normal_hl.fg, bg = msgarea_hl.bg, default = true })
16 vim.api.nvim_set_hl(0, "ArtioPrompt", { link = "Title", default = true })
17
18 local cursor_hl = vim.api.nvim_get_hl(0, { name = "Cursor" })
19 local cursorline_hl = vim.api.nvim_get_hl(0, { name = "CursorLine" })
20 vim.api.nvim_set_hl(0, "ArtioSel", { fg = cursor_hl.bg, bg = cursorline_hl.bg, default = true })
21 vim.api.nvim_set_hl(0, "ArtioPointer", { fg = cursor_hl.bg, default = true })
22
23 vim.api.nvim_set_hl(0, "ArtioMatch", { link = "PmenuMatch", default = true })
24 end,
25})
26
27vim.api.nvim_create_autocmd("ColorSchemePre", {
28 group = augroup,
29 callback = function()
30 vim.api.nvim_set_hl(0, "ArtioNormal", {})
31 vim.api.nvim_set_hl(0, "ArtioPrompt", {})
32 vim.api.nvim_set_hl(0, "ArtioSel", {})
33 vim.api.nvim_set_hl(0, "ArtioPointer", {})
34 vim.api.nvim_set_hl(0, "ArtioMatch", {})
35 end,
36})
37
38vim.keymap.set("n", "<Plug>(artio-files)", function()
39 return require("artio.builtins").files()
40end)