libswaykbswitch

Crates.iolibswaykbswitch
lib.rslibswaykbswitch
version0.2.0
sourcesrc
created_at2023-02-23 10:38:31.415122
updated_at2023-12-17 13:50:04.623757
descriptionA library for controlling sway through its IPC interface
homepage
repositoryhttps://github.com/khaser/sway-vim-kbswitch
max_upload_size
id792571
size10,235
Andrey Khorokhorin (khaser)

documentation

README

sway-vim-kbswitch   Version Badge License Badge

A Rust shared library that provides the interface for Vim keyboard layout switch plugin.

Usage

git clone https://github.com/khaser/sway-vim-kbswitch && \
cd sway-vim-kbswitch && cargo build -r
  • Write the path to the library to the variable g:XkbSwitchLib in your .vimrc settings.
let g:XkbSwitchEnabled = 1
let g:XkbSwitchLib = '<PathToBuildDir>/target/release/libswaykbswitch.so'

Optional(f and r action)

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'}

Troubleshooting

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"
Commit count: 18

cargo fmt