diff options
author | Teddy Wing | 2023-03-18 17:26:49 +0100 |
---|---|---|
committer | Teddy Wing | 2023-03-19 19:52:34 +0100 |
commit | b26b4c48f6bface96ef0d365d6ed7e89f2ef199c (patch) | |
tree | 11241ca2a373b911171fac34f5b3b152464c33c2 /bundle/insert-layout/plugin | |
parent | 3bc45fa6ac18ad54dd595054b6051df48d4e228c (diff) | |
download | dotvim-b26b4c48f6bface96ef0d365d6ed7e89f2ef199c.tar.bz2 |
insert-layout: Add completion to `InsertLayout` command
This allows us to complete the command's keyboard layout identifier
making it easier to select one.
Diffstat (limited to 'bundle/insert-layout/plugin')
-rw-r--r-- | bundle/insert-layout/plugin/insert_layout.vim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bundle/insert-layout/plugin/insert_layout.vim b/bundle/insert-layout/plugin/insert_layout.vim index 5ca3d7b..2600da1 100644 --- a/bundle/insert-layout/plugin/insert_layout.vim +++ b/bundle/insert-layout/plugin/insert_layout.vim @@ -77,8 +77,11 @@ def InsertLayoutOn(layout: string): void ]) enddef -# TODO: Add layout completion -command! -nargs=1 InsertLayout InsertLayoutOn(<q-args>) +def Complete(arg_lead: string, cmd_line: string, cursor_pos: number): string + return join(keys(layout_names), "\n") +enddef + +command! -nargs=1 -complete=custom,Complete InsertLayout InsertLayoutOn(<q-args>) command! InsertLayoutOff InsertLayoutOff() # SetInputLayout(layout_names['fr']) |