Crates.io | libswaykbswitch |
lib.rs | libswaykbswitch |
version | 0.2.1 |
created_at | 2023-02-23 10:38:31.415122+00 |
updated_at | 2025-09-03 21:55:55.155104+00 |
description | A shared library for Vim keyboard layout switching via sway IPC |
homepage | |
repository | https://github.com/khaser/sway-vim-kbswitch |
max_upload_size | |
id | 792571 |
size | 8,003 |
A Rust shared library that provides the interface for Vim keyboard layout switch plugin.
git clone https://github.com/khaser/sway-vim-kbswitch && \
cd sway-vim-kbswitch && cargo build -r
g:XkbSwitchLib
in your .vimrc settings.let g:XkbSwitchEnabled = 1
let g:XkbSwitchLib = '<PathToBuildDir>/target/release/libswaykbswitch.so'
For using f and r action with last layout for insert mode you can put following lines into your vimrc:
let g:XkbSwitchAssistNKeymap = 1
set keymap=russian-jcukenwin
let g:XkbSwitchKeymapNames = {'Russian' : 'ru'}
When you run vim with sudo command you should preserve environment variable SWAYSOCK
.
Example of run with sudo:
sudo --preserve-env=SWAYSOCK vim
You can put following line into you sudoers file to fix this problem:
Defaults env_keep += "SWAYSOCK"