aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/insert-layout
AgeCommit message (Collapse)Author
2023-03-19insert-layout: Don't load in Vim <9Teddy Wing
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.
2023-03-19insert-layout: Add comments for documentationTeddy Wing
2023-03-19insert-layout: Move functions to autoloadTeddy Wing
Clean up the plugin file and move the bulk of the work to autoload.
2023-03-19insert-layout: Remove old commented in-progress codeTeddy Wing
2023-03-19insert-layout: Error when 'xkbswitch' command not availableTeddy Wing
If the 'xkbswitch' command isn't available, we shouldn't be adding any autocmds.
2023-03-19insert-layout: Don't remove autocmds in `InsertLayoutOn`Teddy Wing
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.
2023-03-19insert-layout: Add completion to `InsertLayout` commandTeddy Wing
This allows us to complete the command's keyboard layout identifier making it easier to select one.
2023-03-19insert-layout: Add commands to turn insert layout on and offTeddy Wing
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.
2023-03-19Add 'insert-layout' plugin ideaTeddy Wing
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/.