-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9afe29d
commit 7f78827
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Textmate setup for Java | ||
|
||
<img width="401" alt="image" src="https://github.com/abhinav-nath/all-about-shell/assets/48696735/76b158ff-de30-4835-82b4-072c2d73a80e"> | ||
|
||
go to `Bundles` > `Edit Bundles...` > `Java` > `Menu Actions` > `Compile & Run` | ||
|
||
Update the code: | ||
|
||
```shell | ||
#!/bin/sh | ||
if [ -f "./compile.sh" ]; then | ||
/bin/sh ./compile.sh | ||
else | ||
cd "$TM_DIRECTORY" | ||
javac "$TM_FILENAME" && java "${TM_FILENAME%.java}" | ||
fi | ||
``` | ||
|
||
Change according the picture: | ||
|
||
<img width="1195" alt="image" src="https://github.com/abhinav-nath/all-about-shell/assets/48696735/437f7181-3610-4c8f-ab5e-dca9b1dd1e92"> | ||
|
||
- The script above will look for a `compile.sh` script in the folder of your java file and if found it will run that. | ||
- You can do whatever you like in that `compile.sh` file. If no such file is found it will compile the current java file being edited and run that one. | ||
- Now just `command+R` on a Java file. | ||
- The output will be shown as a tooltip at your cursor. | ||
|
||
## Increase Tooltip size | ||
|
||
Run below command: | ||
|
||
`defaults write com.macromates.TextMate NSToolTipsFontSize 24` |