diff options
-rw-r--r-- | bundle/insert-layout/autoload/insert_layout.vim | 4 | ||||
-rw-r--r-- | bundle/insert-layout/plugin/insert_layout.vim | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/bundle/insert-layout/autoload/insert_layout.vim b/bundle/insert-layout/autoload/insert_layout.vim index e9f53b4..8d7263c 100644 --- a/bundle/insert-layout/autoload/insert_layout.vim +++ b/bundle/insert-layout/autoload/insert_layout.vim @@ -1,5 +1,7 @@ vim9script +# Friendly names for the ones used by 'xkbswitch'. The keys are used as +# arguments to the `:InsertLayout` command. const layout_names = { us: 'US', qwazerty: 'QWAZERTY2', @@ -7,6 +9,8 @@ const layout_names = { dvorak: 'Dvorak', } +# Used to store the current layout prior to insertion so it can be restored +# when leaving insert mode. var normal_layout: string def IsLayoutSwitcherAvailable(): number diff --git a/bundle/insert-layout/plugin/insert_layout.vim b/bundle/insert-layout/plugin/insert_layout.vim index 62c27f5..f15878d 100644 --- a/bundle/insert-layout/plugin/insert_layout.vim +++ b/bundle/insert-layout/plugin/insert_layout.vim @@ -6,6 +6,11 @@ endif g:loaded_insert_layout = 1 +# insert-layout +# Set a different keyboard layout to use in insert mode. Allows a familiar +# layout to be used in narmal and other modes while being able to write in a +# different layout at the same time. + import autoload '../autoload/insert_layout.vim' command! -nargs=1 -complete=custom,insert_layout.Complete |