Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating abbrevations for commonly used commands in Intellij Idea Terminal

I have seen some developers use abbrevations for commands in Intellij IDEA Terminal (may be it could be done in any Terminal, just saw it in Intellij) and would like to know how it is done. For example instead of

~/IdeaProjects/MyProject someBranch > mvn clean install

they used just

~/IdeaProjects/MyProject someBranch > mci

I have watched some tutorials how to define variables in a shell, but I am not sure either defining variables is the way how above is made to work, nor how to do it in Intellij. Any idea how it is realised? Not sure with what searchterm I should google.

like image 787
wannaBeDev Avatar asked Jul 01 '21 10:07

wannaBeDev


People also ask

How do I customize shortcuts in IntelliJ?

Configure keyboard shortcuts IntelliJ IDEA includes several predefined keymaps and lets you customize frequently used shortcuts. To view the keymap configuration, open the Settings/Preferences dialog Ctrl+Alt+S and select Keymap. IntelliJ IDEA automatically suggests a predefined keymap based on your environment.

How do I memorize shortcuts in IntelliJ?

Learn shortcuts as you workPress Ctrl+Shift+A and start typing to get a list of suggested actions. Then select the necessary action and press Enter to execute it.

How do I run a command in IntelliJ terminal?

Open the Log tab of the Git tool window from the terminal Type a supported command in the terminal and notice how it is highlighted. Instead of pressing Enter , which runs the command in the terminal, press Ctrl+Enter to open the corresponding GUI element.


1 Answers

If you are on a UNIX-like system (e.g. Linux or MacOS), you can define so called "aliases" for commands in your shell.

If you are using the Bash shell for example, you can define aliases in it's configuration file ~/.bashrc like so:

alias mci="maven clean install"

Just add this line, restart your terminal and typing mci will to exactly the same as maven clean install. This article gives some more information about aliases in the Bash shell if you want to learn more.

like image 103
be-rty Avatar answered Oct 07 '22 08:10

be-rty