Autocomplete

2 snippets across 2 stacks — Bash & Linux, HTML & CSS

SHBash & Linux

Tab Completion

SH · Shortcuts & Productivity
syntax
Tab       # complete
Tab Tab   # show all possibilities
example
cd /etc/ng<Tab>
# Completes to: cd /etc/nginx/

git che<Tab><Tab>
# Shows: checkout  cherry  cherry-pick

Note Tab completion works for commands, file paths, and (with bash-completion or zsh plugins) for subcommands and flags of many tools including git, docker, kubectl, and ssh hosts. Install bash-completion for enhanced support in Bash.

HCHTML & CSS

Datalist (Autocomplete Suggestions)

HC · Forms
syntax
<input list="list-id">
<datalist id="list-id">
  <option value="suggestion">
</datalist>
example
<label for="framework">Framework:</label>
<input type="text" id="framework" name="framework" list="frameworks">
<datalist id="frameworks">
  <option value="React">
  <option value="Vue">
  <option value="Angular">
  <option value="Svelte">
  <option value="Solid">
</datalist>

Note Unlike select, datalist allows free-text entry in addition to the suggestions. The user is not forced to pick from the list. Browser rendering of suggestions varies.