Quickly set encoding for current buffer by telescope.
Using your favorate plugin manager, for example lazy.nvim.
{ "sjjwantfish/encodings.nvim" }
You don't have to config encodings.nvim
unless you need to custom encodings or telescope action.
Here is a configuration example.
local telescope = require("telescope")
telescope.setup({
extensions = {
encodings = {
action = function(encoding) end, -- see `:help telescope.actions`
-- @param encoding table
encodings = {
{
value = "gbk", -- required
description = "custom encodin GBK",
category = "",
},
},
}
},
})
telescope.load_extension("encodings")
Load encodings.nvim
as a telescope extension.
local telescope = require("telescope")
telescope.load_extension("encodings")
Type this in nvim's cmdline.
Telescope encodings