declare-option completions line1 declare-option completions line2 set-option global completers \ option=line1 \ option=line2 \ define-command update-completions %{ set-option global line1 "1.1@%val{timestamp}" foo()|| set-option global line2 "2.1@%val{timestamp}" foo()|| } hook global InsertCompletionHide .+ %{ evaluate-commands -draft %{ select %val{hook_param} execute-keys ia execute-keys i "accepted completion: " } } hook global InsertCompletionHide '' %{ evaluate-commands -draft %{ execute-keys i "rejected completion " } }