ivanesmantovich / xkbswitch.nvim Goto Github PK
View Code? Open in Web Editor NEWSmart automatic keyboard layout switching in 110 LOC
License: GNU General Public License v3.0
Smart automatic keyboard layout switching in 110 LOC
License: GNU General Public License v3.0
Hello!
You can use CmdlineLeave
and CmdlineEnter
autocmds if it's possible.
Thank you for your great plugin!
Hi! Thank you for making NeoVim alternative of the original xkbswitch. Love to see people making more and more lua stuff out there.
I tried your plugin, and it didn't work for me, so I decided to give you a couple of suggestions.
When you build vovkasm/input-source-switcher
on MacOS you get libInputSourceSwitcher.dylib
and issw
. That issw
binary is basically xkb-switch
. It also has -l
option, which produces the following on my machine:
com.apple.keylayout.ABC
com.apple.keylayout.Russian
There was also a change on recent MacOS versions on Apple Silicon Macs, which changed permissions for /usr/local/lib
and /usr/local/bin
. I don't want to use sudo, so I put libs and bins into another directory. I think people do the same, but I am not sure. Anyway, it would be great to have an ability to change default paths.
In short, my suggestions are:
issw
Привет!
Плагин не работает на раскладке ru+phonetic_mac
OS: Pop!_OS 22.04 LTS x86_64
Kernel: Linux 6.2.6-76060206-generic
Shell: fish 3.6.1
DE: GNOME 42.5
WM: Mutter
NVIM v0.8.3
Подключение плагина:
│ use {
│ 'ivanesmantovich/xkbswitch.nvim',
│ config = function()
│ require('xkbswitch').setup()
│ end
│ }
Перехожу в insert mode, переключаю раскладку на русскую, возвращаюсь в normal mode, раскладка остается русской.
g3kb-switch -n работает.
❯ g3kb-switch -l
us
ru+phonetic_mac
❯ ls -al /usr/local/lib/
total 132
drwxr-xr-x 3 root root 4096 Apr 14 10:23 ./
drwxr-xr-x 10 root root 4096 Mar 8 20:38 ../
-rwxrwxr-x 1 sts sts 21832 Dec 4 16:19 libg3kbswitch.so*
lrwxrwxrwx 1 root root 17 Dec 4 17:49 libxkbswitch.so -> libxkbswitch.so.1*
lrwxrwxrwx 1 root root 21 Dec 4 17:49 libxkbswitch.so.1 -> libxkbswitch.so.1.8.5*
-rwxrwxr-x 1 sts sts 94544 Dec 4 17:49 libxkbswitch.so.1.8.5*
drwxr-xr-x 3 root root 4096 Mar 8 20:38 python3.10/
I tried out this plugin, and it only works for 1 instance of Neovim. Furthermore, the language persists between buffers. If multiple buffers/instances will be supported, then this plugin will deserve an ultimate status.
looks like you have an extra space in the else if
statement in the latest fix ( # 4 )
see
xkbswitch.nvim/lua/xkbswitch.lua
Line 48 in b3cd50c
....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:172: .../.local/share/nvim/lazy/xkbswitch.nvim/lua/xkbswitch.lua:123: 'end' expected (to close 'for' at line 45) near '<eof>'
# stacktrace:
- ~/.config/nvim/lua/config/lazy.lua:9
- ~/.config/nvim/init.lua:2
On my mac the US layout has a name
com.apple.keylayout.US
.
And i get the following error on neovim start:
Error detected while processing /Users/Emptyfruit/.config/nvim/after/plugin/xkb-switch.lua:
E5113: Error while calling lua chunk: .../site/pack/packer/start/xkbswitch.nvim/lua/xkbswitch.lua:52: (xkbswitch.lua) Error occured: could not find the English layout. Check your layout list. (xkb-switch -l / issw -l / g3kb-switch -l)
stack traceback:
MacOS: 12.6.3
Neovim: 0.8.3
issw: 0.3
Using LazyVim juste create a file
~/.config/nvim/lua/plugins/xkbswitch.lua
with content
return {
{'ivanesmantovich/xkbswitch.nvim' },
}
When I switch from nvim to KDE application with non US layout and switch back, Insert mode uses this non US layout even if it was US before switch to other app. This is misbehavior and I had to comment out FocusGained and FocusLost events in autocmd. Is this logic really needed and works as intended?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.