Skip to content

Commit

Permalink
Auto completion for zsh devcontainer (#639)
Browse files Browse the repository at this point in the history
* auto completion

* update the component in the completion history

---------

Co-authored-by: Andriy Knysh <[email protected]>
  • Loading branch information
osterman and aknysh authored Jun 27, 2024
1 parent 291a782 commit 84bba88
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY --from=confetty /go/bin/confetty /usr/local/bin/confetty

# Install Docker CLI and Docker Compose plugin
RUN apt-get update && \
apt-get install -y ca-certificates curl gnupg lsb-release apt-utils direnv screen && \
apt-get install -y ca-certificates curl gnupg lsb-release apt-utils direnv screen zsh-autosuggestions && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
echo \
Expand Down
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"workspaceFolder": "/workspace/examples",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",

"customizations": {
"vscode": {
"extensions": [
Expand All @@ -56,7 +56,7 @@
"workbench.editor.autoLockGroups": {
"readme": "/welcome.md"
},
"workbench.editorAssociations": {
"workbench.editorAssociations": {
"*.md": "vscode.markdown.preview.editor"
},
"terminal.integrated.tabs.title": "Atmos (${process})",
Expand All @@ -77,4 +77,4 @@
}
}
}
}
}
21 changes: 9 additions & 12 deletions .devcontainer/rootfs/home/vscode/.zsh_history
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
: 1640995200:0;atmos terraform plan myapp --stack dev
: 1640995201:0;atmos terraform plan myapp --stack staging
: 1640995202:0;atmos terraform plan myapp --stack prod
: 1640995203:0;atmos terraform apply myapp --stack dev
: 1640995204:0;atmos terraform apply myapp --stack staging
: 1640995205:0;atmos terraform apply myapp --stack prod
: 1640995206:0;atmos terraform plan myapp --stack dev
: 1640995207:0;atmos terraform plan myapp --stack staging
: 1640995208:0;atmos terraform plan myapp --stack prod
: 1640995209:0;atmos terraform deploy myapp --stack dev
: 1640995210:0;atmos terraform deploy myapp --stack staging
: 1640995211:0;atmos terraform deploy myapp --stack prod
: 1640995200:0;atmos terraform deploy station --stack prod
: 1640995201:0;atmos terraform deploy station --stack staging
: 1640995202:0;atmos terraform deploy station --stack dev
: 1640995203:0;atmos terraform apply station --stack prod
: 1640995204:0;atmos terraform apply station --stack staging
: 1640995205:0;atmos terraform apply station --stack dev
: 1640995206:0;atmos terraform plan station --stack prod
: 1640995207:0;atmos terraform plan station --stack staging
: 1640995208:0;atmos terraform plan station --stack dev
10 changes: 9 additions & 1 deletion .devcontainer/rootfs/home/vscode/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ export CODESPACE_HTTPS_URL="http://${CODESPACE_HTTPS_HOSTNAME}"
# Install atmos completion
eval $(atmos completion zsh)

# Enable zsh autosuggestions
autoload -Uz compinit
compinit

export ZSH_AUTOSUGGEST_STRATEGY=(history completion)
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
bindkey '\t' end-of-line

# Setup some aliases
alias tree='tree -CAF --gitignore -I ".git" -I "terraform.tfstate*"'
alias bat='bat --style header,numbers --theme="GitHub"'
Expand All @@ -26,7 +34,7 @@ export DIRENV_LOG_FORMAT=""
find /workspace/examples -name '.envrc' -execdir direnv allow \;

# Enable Starship prompt
eval "$(starship init zsh)"
eval "$(starship init zsh)"

# Celebrate! 🎉
if [ "${TERM}" != "screen.xterm-256color" ]; then
Expand Down

0 comments on commit 84bba88

Please sign in to comment.