Making a custom Neovim filetype picker with mini.pick 0 ▲ Sal's Blog 150 days ago · Tech · hide · Fediverse post It took me a minute to find a good example, so I’ll post this in case it helps anyone else. For you Vimmers out there, here’s an example of how to make your own custom picker using Neovim and mini.pick, part of the very popular mini.nvim plugin. In this case, I’m adding a picker to set the active buffer’s filetype. local function pick_filetype() -- Grab the current buffer before firing the picker -- so we can update it later when we're inside -- the picker's buffer. local current_buf = vim.api.nvim_get_current_buf() -- Get the choices for the picker. In this case, -- all available filetypes. local filetypes = vim.fn.getcompletion('', 'filetype') -- Launch the picker with our custom choices and -- handler. require('mini.pick').start({ source = { name = 'Filetypes', items = filetypes, choose = function(item) -- Handle the user's choice. vim.bo[current_buf].filetype = item -- (Optional) Pop a notification to help us -- know it's working. vim.notify("Set filetype to " .. item) end, }, })… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town