Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto completion for zsh devcontainer #639

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading