Skip to content

Instantly share code, notes, and snippets.

@jarrodldavis
Last active December 31, 2021 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jarrodldavis/928c90036273a557848f4c73d5d4e701 to your computer and use it in GitHub Desktop.
Save jarrodldavis/928c90036273a557848f4c73d5d4e701 to your computer and use it in GitHub Desktop.
vscode-devcontainer test
add_newline = false
[git_status]
disabled = true
#!/usr/bin/env bash
# https://github.com/microsoft/vscode-dev-containers/blob/v0.122.1/containers/debian-10-git/.devcontainer/Dockerfile
USERNAME=vscode
USER_UID=1000
USER_GID=$USER_UID
INSTALL_ZSH="true"
UPGRADE_PACKAGES="true"
COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/v0.122.1/script-library/common-debian.sh"
COMMON_SCRIPT_SHA="da956c699ebef75d3d37d50569b5fbd75d6363e90b3f5d228807cff1f7fa211c"
# Configure apt and install packages
apt-get update
export DEBIAN_FRONTEND=noninteractive
# Install man
apt-get -y install man-db
# Verify git, common tools / libs installed, add/modify non-root user, optionally install zsh
apt-get -y install --no-install-recommends curl ca-certificates 2>&1
curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh
([ "${COMMON_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/common-setup.sh" | sha256sum -c -))
/bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}"
rm /tmp/common-setup.sh
## Install Live Share prerequisites
curl -fsSL https://raw.githubusercontent.com/MicrosoftDocs/live-share/master/scripts/linux-prereqs.sh | bash
# Install hub
apt-get -y install hub
# Install starship prompt
curl -fsSL https://starship.rs/install.sh | bash -s -- --yes
# Install diff-so-fancy
mkdir -p /opt/diff-so-fancy/
curl -fsSL https://github.com/so-fancy/diff-so-fancy/archive/v1.3.0.tar.gz | tar -xz -C /opt/diff-so-fancy --strip-components=1
ln -sf /opt/diff-so-fancy/diff-so-fancy /usr/local/bin
# Copy configs
cp ~/.dotfiles/zshrc ~/.zshrc
cp ~/.dotfiles/zprofile ~/.zprofile
cp ~/.dotfiles/starship.toml ~/.starship.toml
sed -i "s/export EDITOR='vim'/export EDITOR='code --wait'/" ~/.zshrc
# Set EDITOR to Visual Studio Code
# Clean up
apt-get autoremove -y
apt-get clean -y
rm -rf /var/lib/apt/lists/*
#!/usr/bin/env zsh
source ~/.zshrc
#!/usr/bin/env zsh
export EDITOR='vim'
# custom functions
fpath+=~/.zshfunctions
autoload -Uz ghq
autoload -Uz upwork
autoload -Uz upgrade-backblaze
autoload -Uz vim-plugin
alias upwork="nocorrect upwork"
# starship prompt
eval "$(starship init zsh)"
export STARSHIP_CONFIG=~/.starship.toml
# hub
eval "$(hub alias -s)"
# man pager
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
# command editing options
setopt NO_CASE_GLOB
setopt AUTO_CD
setopt CORRECT
setopt CORRECT_ALL
export CORRECT_IGNORE_FILE='.*'
# tab completions
setopt COMPLETE_IN_WORD
# history options
setopt SHARE_HISTORY
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_FIND_NO_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_VERIFY
# key bindings
bindkey '^[[A' up-line-or-search
bindkey '^[[B' down-line-or-search
# vim mode
export KEYTIMEOUT=1
bindkey -v
bindkey '^P' up-history
bindkey '^N' down-history
bindkey '^?' backward-delete-char
bindkey '^h' backward-delete-char
bindkey '^w' backward-kill-word
bindkey '^r' history-incremental-search-backward
bindkey -M vicmd '?' history-incremental-search-backward
bindkey -M vicmd '/' history-incremental-search-forward
autoload -Uz surround
zle -N delete-surround surround
zle -N change-surround surround
zle -N add-surround surround
bindkey -M vicmd cs change-surround
bindkey -M vicmd ds delete-surround
bindkey -M vicmd ys add-surround
bindkey -M vicmd S add-surround
# The following lines were added by compinstall
zstyle ':completion:*' completer _expand _complete _ignored _match _correct _approximate _prefix
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:]}={[:upper:]} m:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:]}={[:upper:]} m:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._-]=** r:|=**' 'm:{[:lower:]}={[:upper:]} m:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._-]=** r:|=** l:|=*'
zstyle ':completion:*' max-errors 3
zstyle ':completion:*' menu select=1
zstyle ':completion:*' preserve-prefix '//[^/]##/'
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' verbose true
zstyle :compinstall filename '~/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment