✅ WORKING SOLUTION: Open Java Files in Obsidian
The Solution That Works
Install the VS Code Editor plugin for Obsidian. This embeds VS Code’s editor directly inside Obsidian with full syntax highlighting and code editing features.
Installation Steps
- Open Obsidian Settings (Cmd+,)
- Go to: Community Plugins
- Turn off Restricted Mode (if needed)
- Click: Browse
- Search for: “VS Code Editor”
- Install the plugin by Reorchestrate
- Enable the plugin
Plugin URL: obsidian://show-plugin?id=vscode-editor
What You Get
✅ VS Code editor embedded in Obsidian
- Full syntax highlighting for Java (and all languages)
- Code completion/IntelliSense
- Multiple cursors
- Minimap
- All VS Code editor features
- No external app launches
✅ Seamless workflow
- Click
.javafile → Opens in VS Code editor inside Obsidian - Stay in one app
- Can have markdown notes and code side-by-side
How It Works
When you click on a .java file in Obsidian:
- Opens in an embedded VS Code editor
- Full syntax highlighting
- Proper code formatting
- All VS Code keybindings work
- Stays within Obsidian window
Configuration
After installing, the plugin works automatically for:
- Java (
.java) - JavaScript/TypeScript (
.js,.ts) - Python (
.py) - C/C++ (
.cpp,.c,.h) - And all other code files
No additional configuration needed!
Benefits for DS-Algo Practice
Perfect for studying patterns:
Left Pane: Session-01-TwoPointers.md (markdown)
Right Pane: TwoPointers.java (VS Code editor)
You can:
- Read explanations in markdown
- View code with syntax highlighting
- Make notes alongside code
- Copy code snippets easily
- All in one Obsidian window
Plugin Settings (Optional)
In Obsidian Settings → VS Code Editor:
- Configure theme
- Set font size
- Enable/disable minimap
- Customize keybindings
Alternative Workflows
For Reading: Use VS Code editor in Obsidian ✅
For Coding: Still use IntelliJ IDEA
- Right-click → “Open in default app” → IntelliJ
- Or open directly in IntelliJ for compiling/debugging
Previous Solutions (Didn’t Work)
❌ Adding textFileExtensions to app.json - Didn’t work
❌ Changing system file associations - Didn’t work
❌ Right-click “Open in Obsidian” - Opens plain text editor without syntax highlighting
The Winning Solution
✅ VS Code Editor Plugin - Full featured embedded editor
Now you can study patterns and write code comfortably in Obsidian! 🎯