Skip to content

Commit

Permalink
shrc: better handle Cursor.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Oct 14, 2024
1 parent 046ec26 commit 531a581
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions shrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,23 @@ if quiet_which gh; then
fi

# Set up editor
if quiet_which code; then
if quiet_which cursor; then
export EDITOR="cursor"
alias code="cursor"
elif quiet_which code; then
export EDITOR="code"
fi

if quiet_which code; then
export GIT_EDITOR="${EDITOR} -w"
export SVN_EDITOR="${GIT_EDITOR}"

# Edit Rails credentials in VSCode
rails-credentials-edit-production() {
EDITOR="code -w" bundle exec rails credentials:edit --environment production
EDITOR="${EDITOR} -w" bundle exec rails credentials:edit --environment production
}
rails-credentials-edit-development() {
EDITOR="code -w" bundle exec rails credentials:edit --environment development
EDITOR="${EDITOR} -w" bundle exec rails credentials:edit --environment development
}
else
export EDITOR="vim"
Expand Down

0 comments on commit 531a581

Please sign in to comment.