Lualine component to show current keymap in statusline.
- Neovim ⪖ 0.7.0
- lualine.nvim
- vim-xkbswitch
Install via your favorite package manager:
require("lazy").setup({
{
"yorik1984/lualine-xkblayout",
dependencies = {
"nvim-lualine/lualine.nvim",
"lyokha/vim-xkbswitch",
},
},
})
Just install plugin.
Change default layout code. Add any string. Icon can be set by lualine settings. See bellow.
-- Default
vim.g.lualine_xkblayout_codes = {
["2SetKorean"] = "KR",
["Chinese"] = "CN",
["Japanese"] = "JP",
["us"] = "ENG",
["ru"] = "РУС",
["ua"] = "УКР",
}
Show current keymap by command:
:echo libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '')
-- Set before lualine init
vim.g.lualine_xkblayout_codes = {
["de"] = "GER",
}
-- Add component to any lualine section
require("lualine").setup({
sections = {
lualine_a = {
{ "xkblayout", icon = "" },
},
},
})