Skip to content

yorik1984/lualine-xkblayout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Lualine-xkblayout

🌟 Features

Lualine component to show current keymap in statusline.

⚡ Requirements

📦 Installation

Install via your favorite package manager:

require("lazy").setup({
    {
        "yorik1984/lualine-xkblayout",
        dependencies =  {
            "nvim-lualine/lualine.nvim",
            "lyokha/vim-xkbswitch",
        },
    },
})

🚀 Usage

Just install plugin.

⚙ Configuration

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 = "󰥻" },
        },
    },
})

⛩ Inspired by: