Skip to content

Instantly share code, notes, and snippets.

@jamescherti
Last active December 25, 2022 22:07
Show Gist options
  • Save jamescherti/42d7995184a6ac01175c5e9190763772 to your computer and use it in GitHub Desktop.
Save jamescherti/42d7995184a6ac01175c5e9190763772 to your computer and use it in GitHub Desktop.
Vim input() function: auto-complete from a list.
" Language: Vim script
" Author: James Cherti
" License: MIT
" URL: https://gist.github.com/jamescherti/42d7995184a6ac01175c5e9190763772
" Decsription: Vim input() function: auto-complete from a predefined list
function! AutoCompleteInput(arglead, cmdline, cursorpos)
return ["first_answer", "second_answer"]
endfunction
let answer = input("Question? ", "", "customlist,AutoCompleteInput")
echo "Your answer: " . answer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment