aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/insert-layout/plugin
diff options
context:
space:
mode:
authorTeddy Wing2023-03-18 17:26:49 +0100
committerTeddy Wing2023-03-19 19:52:34 +0100
commitb26b4c48f6bface96ef0d365d6ed7e89f2ef199c (patch)
tree11241ca2a373b911171fac34f5b3b152464c33c2 /bundle/insert-layout/plugin
parent3bc45fa6ac18ad54dd595054b6051df48d4e228c (diff)
downloaddotvim-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.vim7
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'])