Last active
August 26, 2023 18:53
-
-
Save theoperatore/d685b401e01629dded816bd2af45682e to your computer and use it in GitHub Desktop.
bash_profile, zshrc, and some tips for starting a new computer and installing a good env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export GITAWAREPROMPT=~/.bash/git-aware-prompt | |
source "${GITAWAREPROMPT}/main.sh" | |
PS1='\[\033[01;35m\]\u\[\033[01;33m\]:\[\033[01;34m\]\W\[\033[00;31m\]:$git_branch \[\033[00m\]> ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_git_branch() { | |
local ref=$(git symbolic-ref --short HEAD 2> /dev/null) | |
if [ -n "${ref}" ]; then | |
if [ -n "$(git status --porcelain)" ]; then | |
local gitstatuscolor='%F{red}' | |
else | |
local gitstatuscolor='%F{green}' | |
fi | |
echo "${gitstatuscolor} (${ref})" | |
else | |
echo "" | |
fi | |
} | |
setopt PROMPT_SUBST | |
PROMPT='%F{magenta}%n%F{none}@%F{blue}%~$(parse_git_branch) %F{none}$ ' |
Use Docker for Mac
If using GCP container registery, then allow docker to pull from GCR:
gcloud auth configure-docker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Setting up IntelliJ
Update
/etc/hosts
to improve debugging speedIf you have memory to spare, can give IntelliJ more memory for java apps via flag: 2048m is a good amount
Open application and go to
Project Structure
. Ensure sdkman jdks are listedUsing the fmt-maven-plugin is nice! uses google-java-format-plugin.
To install:
Go to IntelliJ IDEA -> Settings
Select Plugins in the list on the left
Type google-java-format in the search box 3.1. If nothing appears you could be in the Installed tab. Click on Marketplace
You should see the plugin now and when you select it you should be able to install it. You may need to enable the plugin. To enable it by default in new projects, use File > New Projects Setup > Preferences for New Projects. In the popup, select Other Settings dropdown on the left and choose google-java-format Settings. Then check Enable google-java-format.
You also need to install the IntelliJ Java Google Style file to properly fix the import order as pointed out in IntelliJ Configuring Code Style page:
Download the IntelliJ Java Google Style file.
Open Settings -> Editor -> Code Style
Click the gear (⚙) icon at the top next to Scheme: Import Scheme -> IntelliJ IDEA code style xml.
Select the XML file you downloaded in the previous step.
Click OK to import the scheme
In the scheme dropdown, select GoogleStyle
Click Apply to apply the settings
Java 17 breaks the plugin, set some settings.
Upgrade your Intellij to be at least version 2022.2 or newer (Go to menu Intellij IDEA -> Check for updates)
Add extra JVM options to your Intellij by going to Help -> Edit Custom VM Options and add the following flags to it:
You should be able to run google-java-formatter again.