IntelliJ IDEA: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
|valign='top' style='width:50%'|
|valign='top' style='width:50%'|
<syntaxhighlight style='margin:3px 0' lang='text'>
<syntaxhighlight style='margin:3px 0' lang='text'>
⌘ + 1           » Project
⌘ + 1                     » Project
⌘ + 2           » Favorites
⌘ + 2                     » Favorites
⌘ + 3           » Find
⌘ + 3                     » Find
⌘ + 4           » Run
⌘ + 4                     » Run
⌘ + 5           » Debug
⌘ + 5                     » Debug
⌘ + 6           » Problems
⌘ + 6                     » Problems
⌘ + 7           » Structure
⌘ + 7                     » Structure
⌘ + 8           » Services
⌘ + 8                     » Services
⌘ + 9           » Git
⌘ + 9                     » Git
</syntaxhighlight>
</syntaxhighlight>


|valign='top' style='width:50%'|
|valign='top' style='width:50%'|
<syntaxhighlight style='margin:3px 0' lang='text'>
<syntaxhighlight style='margin:3px 0' lang='text'>
Shift + Shift   » Navigate
Shift + Shift             » Navigate
⌘ + B           » Navigate Usages
⌘ + B                     » Navigate Usages
⌘ + E           » Recent Files
⌘ + E                     » Recent Files
⌘ + E           » Toggle Changes Only Files
⌘ + E                     » Toggle Changes Only Files
⌘ + Shift + F12 » Hide All Windows
⌘ + Shift + F12           » Hide All Windows
⌘ + ,           » Preferences
⌘ + ,                     » Preferences
⌘ + ;           » Project Structures
⌘ + ;                     » Project Structures
⌘ + -           » Folding Collapse
⌘ + -                     » Folding Collapse
⌘ + +           » Folding Expand
⌘ + +                     » Folding Expand
</syntaxhighlight>
</syntaxhighlight>
|-
|-
|valign='top'|
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='text'>
<syntaxhighlight style='margin:3px 0' lang='text'>
Control + N     » New Class, Interface, Enum
Control + N               » New Class, Interface, Enum
⌘ + W           » Extend Selection
⌘ + W                     » Extend Selection
⌘ + Option + V » Extract Variable
⌘ + Option + V             » Extract Variable
⌘ + Option + M » Extract Method
⌘ + Option + M             » Extract Method
⌘ + Option + P » Extract Parameter
⌘ + Option + P             » Extract Parameter
⌘ + Option + N » Inline  Variable
⌘ + Option + N             » Inline  Variable
⌘ + Shift + T   » Navigate Go to Test
⌘ + Shift + T             » Navigate Go to Test
⌘ + F12         » Navigate File Structure
⌘ + F12                   » Navigate File Structure
⌘ + D           » Duplicate Line
⌘ + D                     » Duplicate Line
⌘ + D           » Git Difference
⌘ + D                     » Git Difference
⌘ + Option + Z » Git Undo the Change
⌘ + Option + Z             » Git Undo the Change
</syntaxhighlight>
</syntaxhighlight>


|valign='top'|
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='text'>
<syntaxhighlight style='margin:3px 0' lang='text'>
Control + Shift + Down» Line Move Down
Control + Shift + Down    » Line Move Down
Control + Shift + Up » Line Move Up
Control + Shift + Up       » Line Move Up
Control + Shift + F10 » Run Unit Test
Control + Shift + F10     » Run Unit Test
Control + Shift + F   » Find or Search
Control + Shift + F       » Find or Search
Control + V           » VCS Operation
Control + V               » VCS Operation
⌘ + Shift + G         » Go to Folder
⌘ + Shift + G             » Go to Folder
⌘ + X                 » Cut Line
⌘ + X                     » Cut Line
Control + F11         » Toggle Bookmark
Control + F11             » Toggle Bookmark
F11                   » Toggle Bookmark
F11                       » Toggle Bookmark
Shift + F9           » Debug Application
Shift + F9                 » Debug Application
Shift + F10           » Run Application
Shift + F10               » Run Application
</syntaxhighlight>
</syntaxhighlight>
|-
|-
|valign='top'|
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='text'>
<syntaxhighlight style='margin:3px 0' lang='text'>
Control + Option + [ » Previous Project Window
Control + Option + [       » Previous Project Window
Control + Option + ] » Next Project Window
Control + Option + ]       » Next Project Window
Control + Option + F12» Terminal
Control + Option + F12    » Terminal
Option  + F4         » Close Idea Window
Option  + F4               » Close Idea Window
Control + F4         » Close Tab Window
Control + F4               » Close Tab Window
Control + F2         » Stop
Control + F2               » Stop
Control + Shift + U   » Toggle Upper Case
Control + Shift + U       » Toggle Upper Case
Control + Shift + R   » Find Replace in Folder
Control + Shift + R       » Find Replace in Folder
Control + R           » Find and Replace
Control + R               » Find and Replace
Control + F           » Find
Control + F               » Find
</syntaxhighlight>
</syntaxhighlight>


|valign='top'|
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='text'>
<syntaxhighlight style='margin:3px 0' lang='text'>
⌘ + Option + L       » Reformat Code
⌘ + Option + L             » Reformat Code
⌘ + Option + O       » Optimize Import
⌘ + Option + O             » Optimize Import
⌘ + R                 » Find and Replace
⌘ + R                     » Find and Replace
⌘ + F                 » Find
⌘ + F                     » Find


Option + Shift + M   » Toggle Maven Window
Option + Shift + M         » Toggle Maven Window
Alt + Insert         » Generate
Alt + Insert               » Generate
⌘ + N                 » Generate
⌘ + N                     » Generate
⌘ + L                 » Find Line Number
⌘ + L                     » Find Line Number
Control + G           » Find Line Number
Control + G               » Find Line Number
</syntaxhighlight>
</syntaxhighlight>
|}
|}
Line 96: Line 96:
|valign='top' style='width:50%'|
|valign='top' style='width:50%'|
<syntaxhighlight style='margin:3px 0' lang='text'>
<syntaxhighlight style='margin:3px 0' lang='text'>
⌘ + W                 » Close a Tab
⌘ + W                     » Close a Tab
⌘ + T                 » Open New Tab
⌘ + T                     » Open New Tab
⌘ + Shift + [ | Left » Move to Left
⌘ + Shift + [ | Left       » Move to Left
⌘ + Shift + ] | Right » Move to Right
⌘ + Shift + ] | Right     » Move to Right






⌘ + 1..9             » Switch Between
⌘ + 1..9                   » Switch Between
⌘ + N                 » Open New Window
⌘ + N                     » Open New Window
</syntaxhighlight>
</syntaxhighlight>


|valign='top' style='width:50%'|
|valign='top' style='width:50%'|
<syntaxhighlight style='margin:3px 0' lang='text'>
<syntaxhighlight style='margin:3px 0' lang='text'>
Control + Shift + W   » Close a Tab
Control + Shift + W       » Close a Tab
Control + Shift + T   » Open New Tab
Control + Shift + T       » Open New Tab
Control + Shift + P.Up» Move to Left
Control + Shift + P.Up    » Move to Left
Control + Shift + P.Dn» Move to Right
Control + Shift + P.Dn    » Move to Right
Control + P.Up       » Move to Previous
Control + P.Up             » Move to Previous
Control + P.Dn       » Move to Next
Control + P.Dn             » Move to Next
Alter  + 1..9       » Switch Between
Alter  + 1..9             » Switch Between
Control + Alter + T   » Open New Window
Control + Alter + T       » Open New Window
Enter  +  ~  + .   » Exit an SSH Session
Enter  +  ~  + .       » Exit an SSH Session
</syntaxhighlight>
</syntaxhighlight>
|}
|}

Latest revision as of 12:44, 16 January 2026

Shortcuts

Shortcuts

⌘ + 1                      » Project
⌘ + 2                      » Favorites
⌘ + 3                      » Find
⌘ + 4                      » Run
⌘ + 5                      » Debug
⌘ + 6                      » Problems
⌘ + 7                      » Structure
⌘ + 8                      » Services
⌘ + 9                      » Git
Shift + Shift              » Navigate
⌘ + B                      » Navigate Usages
⌘ + E                      » Recent Files
⌘ + E                      » Toggle Changes Only Files
⌘ + Shift + F12            » Hide All Windows
⌘ + ,                      » Preferences
⌘ + ;                      » Project Structures
⌘ + -                      » Folding Collapse
⌘ + +                      » Folding Expand
Control + N                » New Class, Interface, Enum
⌘ + W                      » Extend Selection
⌘ + Option + V             » Extract Variable
⌘ + Option + M             » Extract Method
⌘ + Option + P             » Extract Parameter
⌘ + Option + N             » Inline  Variable
⌘ + Shift + T              » Navigate Go to Test
⌘ + F12                    » Navigate File Structure
⌘ + D                      » Duplicate Line
⌘ + D                      » Git Difference
⌘ + Option + Z             » Git Undo the Change
Control + Shift + Down     » Line Move Down
Control + Shift + Up       » Line Move Up
Control + Shift + F10      » Run Unit Test
Control + Shift + F        » Find or Search
Control + V                » VCS Operation
⌘ + Shift + G              » Go to Folder
⌘ + X                      » Cut Line
Control + F11              » Toggle Bookmark
F11                        » Toggle Bookmark
Shift + F9                 » Debug Application
Shift + F10                » Run Application
Control + Option + [       » Previous Project Window
Control + Option + ]       » Next Project Window
Control + Option + F12     » Terminal
Option  + F4               » Close Idea Window
Control + F4               » Close Tab Window
Control + F2               » Stop
Control + Shift + U        » Toggle Upper Case
Control + Shift + R        » Find Replace in Folder
Control + R                » Find and Replace
Control + F                » Find
⌘ + Option + L             » Reformat Code
⌘ + Option + O             » Optimize Import
⌘ + R                      » Find and Replace
⌘ + F                      » Find

Option + Shift + M         » Toggle Maven Window
Alt + Insert               » Generate
⌘ + N                      » Generate
⌘ + L                      » Find Line Number
Control + G                » Find Line Number

Terminal

Terminal

⌘ + W                      » Close a Tab
⌘ + T                      » Open New Tab
⌘ + Shift + [ | Left       » Move to Left
⌘ + Shift + ] | Right      » Move to Right



⌘ + 1..9                   » Switch Between
⌘ + N                      » Open New Window
Control + Shift + W        » Close a Tab
Control + Shift + T        » Open New Tab
Control + Shift + P.Up     » Move to Left
Control + Shift + P.Dn     » Move to Right
Control + P.Up             » Move to Previous
Control + P.Dn             » Move to Next
Alter   + 1..9             » Switch Between
Control + Alter + T        » Open New Window
Enter   +   ~   + .        » Exit an SSH Session

Redis Cli

Redis Cli

redis-cli flushall async
redis-cli flushall
redis-cli flushdb

Evaluation

Evaluation

Ubuntu
rm -rf ~/.config/JetBrains/*/eval
rm ~/.config/JetBrains/*/options/other.xml
rm -rf ~/.local/share/JetBrains/consentOptions
rm -rf ~/.java/..userPrefs

File Types

File Types

Control + Alter + S » Editor » File Types » Recognized File Types » JSON » File Name Patterns » {Add Your Pattern}

Knowledge

Knowledge

# disk usage
du -h /var
du -sh /var
du -csh ~/Do*
du -csh /var/log /var/lib
du -sh --apparent-size /var/lib
du -h /var/ | sort -rh | head -5


# comment and uncomment sql
sed -i -e 's|postgres|chorke|g' *.sql
sed -i -e 's|^|-- |g' src/main/resources/db/migration/*.sql
sed -i -e 's|^-- ||g' src/main/resources/db/migration/*.sql


# ubuntu
Ctrl + Alt + F5 » Switch Desktop  to Terminal
Crtl + Alt + F1 » Switch Terminal to Desktop
Crtl + Alt +   » Switch Desktop
Crtl + Alt +   » Switch Desktop

sudo update-alternatives --config javac
sudo update-alternatives --config java
ls -lah /usr/share/maven/
sudo dpkg -l | grep openjdk

git config --global user.name "Full Name"
git config --global user.email "email.id@academia.chorke.org"


# undo assume unchanged or assume unchanged'
git update-index --no-assume-unchanged src/main/resources/application.properties
git update-index --assume-unchanged src/main/resources/application.properties
# list of files assume unchanged
git ls-files -v|grep '^h'

# create and checkout a new branch
git checkout -b new_branch_name base_branch_name
git checkout -b new_branch_name

# renaming and delete branch
git branch -m old_branch_name new_branch_name
git branch -D branch_to_delete_without_merge_status

git branch -d branch_to_delete
git push origin --delete branch_to_delete

# discard changes
git checkout master -f

# git stashing
git stash; git checkout -b new_branch; git stash pop
git add .; git commit -m "new feature added"; git push 

# rebase vs merge
git rebase master #all the updated commits of master will be available in the feature branch
git merge --squash feature #all the feature commits replaced by a new commit in the master
git commit -m 'feature merged with master branch'

# nodejs
sudo npm install -g npm

# vs code
sudo snap install code --classic
sudo snap refresh code --classic
code ./my_project
-- mysql root@localhost user
SELECT user, plugin, host FROM mysql.user WHERE user = 'root';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'p@$$w0rd';
UPDATE mysql.user SET plugin = 'mysql_native_password', authentication_string = PASSWORD('p@$$w0rd') WHERE User = 'root';
-- postgresql public role
-- revoke public connect from specific database after creation
REVOKE CONNECT ON DATABASE academia_ebis_dev FROM PUBLIC;
-- revoke public connect for all future databases
REVOKE CONNECT ON DATABASE template1 FROM PUBLIC;

-- liquibase unlock database migration
UPDATE databasechangeloglock SET locked = false;
COMMIT;
du -h /usr/local/var/postgres/{base,pg_wal}
sudo du -h /var/lib/postgresql/11/main/{base,pg_wal}
sudo du -h /var/lib/postgresql/12/main/{base,pg_wal}
#nano ~/.bashrc
#nano ~/.zshenv
#nano ~/.profile
#nano ~/.bash_profile
export ACADEMIA_WSS="$HOME/chorke/academia"
export ACADEMIA_LOG_PATH="$HOME/.chorke/academia/var/http/logs"
source ~/.bashrc
source ~/.profile
source ~/.bash_profile

source ~/.zshrc
source ~/.zshenv
source ~/.zprofile/.zlogin

[[ -s "$HOME/.chorke/academia/etc/staging.sh" ]] && source "$HOME/.chorke/academia/etc/staging.sh"

Git Ignore

Git Ignore

out/
*.iml
*.ipr
*.iws
.idea/*
cmake-build-*/
.idea_modules/
fabric.properties
crashlytics.properties
atlassian-ide-plugin.xml
crashlytics-build.properties
com_crashlytics_export_strings.xml
# clear metadata
rm -rf */out */*.iml */*.ipr */*.iws */.idea */cmake-build-* */.idea_modules

git remote -v;mv src/main/resources/application.properties ..;cd ..
mv ../application.properties src/main/resources/
# delete and recreate
git branch -d staging
git branch -D staging
git fetch origin staging
git checkout -b staging origin/staging
git merge develop

Serial UID

Serial UID

A faster way to find this setting - you might use hotkey Ctrl+Shift+A (find action), type Serializable class without 'serialVersionUID'

Alter  + Enter  » serialVersionUID =
Option + Enter  » serialVersionUID =

References

References