- Enable External Tools: Edit –> Preferences –> Plugins
- Create a New External Tool: Tools -> Manage External Tools -> Hit the Plus sign
- Name the tool whatever you would like
- Assign it a shortcut key (optional)
- Set the following options on the bottom right
- Save: All Documents
- Input: Current Document
- Output: None
- Applicability: All Documents
- In the script editor, enter the following short script. This script will open the current document in your default web browser.
#!/bin/sh x-www-browser $GEDIT_CURRENT_DOCUMENT_PATH
- Close, and you are done!
You should now be able to use whichever shortcut you created to save all documents that you are working on, and open the current document in a web browser. This makes debugging much easier for web applications, and makes gedit a perfect lightweight web IDE.
If you have some handy tips and tricks for gedit custom tools, please share in the comments below!