tangled
alpha
login
or
join now
robinwobin.dev
/
artio.nvim
3
fork
atom
minimal extui fuzzy finder for neovim
3
fork
atom
overview
issues
pulls
pipelines
feat(builtins): add buffers picker
robinwobin.dev
4 months ago
2114b777
369b5612
+20
1 changed file
expand all
collapse all
unified
split
lua
artio
builtins.lua
+20
lua/artio/builtins.lua
···
75
75
})
76
76
end
77
77
78
78
+
builtins.buffers = function()
79
79
+
local lst = vim
80
80
+
.iter(vim.api.nvim_list_bufs())
81
81
+
:filter(function(bufnr)
82
82
+
return vim.api.nvim_buf_is_valid(bufnr) and vim.bo[bufnr].buflisted
83
83
+
end)
84
84
+
:totable()
85
85
+
86
86
+
return artio.select(lst, {
87
87
+
prompt = "buffers",
88
88
+
format_item = function(bufnr)
89
89
+
return vim.api.nvim_buf_get_name(bufnr)
90
90
+
end,
91
91
+
}, function(bufnr, _)
92
92
+
vim.schedule(function()
93
93
+
vim.cmd.buffer(bufnr)
94
94
+
end)
95
95
+
end)
96
96
+
end
97
97
+
78
98
return builtins