diff options
author | Teddy Wing | 2023-03-19 05:21:40 +0100 |
---|---|---|
committer | Teddy Wing | 2023-03-19 19:52:34 +0100 |
commit | dde1eb51b366d3b8820c3eba0e0676db907ef4bd (patch) | |
tree | fa1fdba3d3e3b2c2cf7d547ebfc75167d59a0413 /bundle/insert-layout | |
parent | 744e5df5cbf66e6f7fcab7920de2eee12e3456cd (diff) | |
download | dotvim-dde1eb51b366d3b8820c3eba0e0676db907ef4bd.tar.bz2 |
insert-layout: Add comments for documentation
Diffstat (limited to 'bundle/insert-layout')
-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 |