From 7a52016eaff478ce8cd55db1314e900f32bf2177 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 18 Mar 2023 13:10:36 +0100 Subject: Add 'insert-layout' plugin idea 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/. --- bundle/insert-layout/plugin/insert_layout.vim | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 bundle/insert-layout/plugin/insert_layout.vim (limited to 'bundle') diff --git a/bundle/insert-layout/plugin/insert_layout.vim b/bundle/insert-layout/plugin/insert_layout.vim new file mode 100644 index 0000000..f271264 --- /dev/null +++ b/bundle/insert-layout/plugin/insert_layout.vim @@ -0,0 +1,7 @@ +" 2023.03.09 + +augroup frinsert + autocmd! + autocmd InsertEnter * :call system('xkbswitch -se French-numerical') + autocmd InsertLeave * :call system('xkbswitch -se US') +augroup END -- cgit v1.2.3