Age | Commit message (Collapse) | Author |
|
Since this plugin is written in Vim9script, it won't work in any earlier
version. Add a guard to prevent the plugin from loading in earlier Vim
versions.
|
|
|
|
Clean up the plugin file and move the bulk of the work to autoload.
|
|
|
|
If the 'xkbswitch' command isn't available, we shouldn't be adding any
autocmds.
|
|
I assumed that I should be removing existing autocmds before adding new
ones. If you ran the `:InsertLayout` command more than once, I didn't
want old autocmds to stick around.
The line was commented out because it fails on the first call to
`:InsertLayout`, since at that point the `insert_layout` augroup doesn't
exist.
On closer inspection, however, it turns out that the old autocmds are
not retained when running `:InsertLayout` subsequent times. Rather, the
newly-defined ones are overwriting the old ones. So we don't need to
worry about removing the old autocmds before adding new ones.
|
|
This allows us to complete the command's keyboard layout identifier
making it easier to select one.
|
|
Add two new commands, `InsertLayout` and `InsertLayoutOff`, which allow
us to activate a different keyboard layout for insert mode and restore
the previous layout when leaving insert wode.
Works reasonably well, but needs a bit of cleaning up now.
|
|
This uses `xkbswitch` to change keyboard layouts on insert enter and
leave. For now it's only a proof of concept.
The plan is to make an `:InsertLayout` command that takes an argument
defining the keyboard layout to use in insert mode. When returning to
normal mode, it should switch back to the previous layout.
This uses https://github.com/myshov/xkbswitch-macosx/.
|