Last active
December 25, 2022 22:07
-
-
Save jamescherti/42d7995184a6ac01175c5e9190763772 to your computer and use it in GitHub Desktop.
Vim input() function: auto-complete from a list.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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