Skip to content

Commit

Permalink
feat: support vscode shell module
Browse files Browse the repository at this point in the history
  • Loading branch information
Avivbens committed Jan 17, 2024
1 parent 5075eae commit 5f2b932
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ shell-config update --target {version}
### Modules

- [Git](zsh/extends/.zshrc.extends.git.sh)
- [VSCode](zsh/extends/.zshrc.extends.vscode.sh)
- [Npm](zsh/extends/.zshrc.extends.npm.sh)
- [Angular](zsh/extends/.zshrc.extends.angular.sh)
- [MongoDB](zsh/extends/.zshrc.extends.mongo.sh)
Expand Down
5 changes: 5 additions & 0 deletions src/commands/shell/config/shell-modules.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export const SHELL_MODULES_OPTIONS: IShellModule[] = [
path: `${EXTENDS_MODULES_DIR_PATH}/.zshrc.extends.git.sh`,
description: 'Git aliases and functions',
},
{
name: 'VSCode',
path: `${EXTENDS_MODULES_DIR_PATH}/.zshrc.extends.vscode.sh`,
description: 'VSCode aliases and functions',
},
{
name: 'NPM',
path: `${EXTENDS_MODULES_DIR_PATH}/.zshrc.extends.npm.sh`,
Expand Down
7 changes: 0 additions & 7 deletions zsh/.entry-point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,6 @@ add-zsh-hook -Uz chpwd (){ ls; }
PROMPT='%F{yellow}%(4~|.../%3~|%~) %F{red}: ${vcs_info_msg_0_} %F{reset_color}$ '


# vscode
VSCODE="/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code"
alias code="$VSCODE"
alias v="code ."
alias vall="ls -d */ | xargs -I {} sh -c '$VSCODE ./{}'"


# github-copilot-cli alias setup
if command -v github-copilot-cli &> /dev/null
then
Expand Down
14 changes: 14 additions & 0 deletions zsh/extends/.zshrc.extends.vscode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /usr/bin/env zsh

echo "extends.vscode.sh loaded"

export VSCODE="/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code"

# open vscode
alias code="$VSCODE"

# open vscode in current directory
alias v="code ."

# open vscode for all directories in current directory
alias vall="ls -d */ | xargs -I {} sh -c '$VSCODE ./{}'"

0 comments on commit 5f2b932

Please sign in to comment.