A third-party plug-in of Obsidian that provides viewing and editing functions for files in various code formats
简体中文
·
English
Obsidian by default does not support the viewing and editing of various code files, and Obsidian VSCode Editor was created to solve this problem.
It is based on Monaco Editor (VSCode Editor kernel) development, support for viewing and editing of various code format files, including but not limited to: C
, C++
, C#
, CSS
, Go
, HTML
, Java
, JavaScript
, JSON
, Python
, Ruby
, Rust
, Shell
, XML
, YAML
, ini
, etc.
You no longer have to open another editor just to view or edit a certain code file, everything is done in Obsidian.
Ctrl + mouse wheel
.alt + z
.The default support code file's extensions is ts, js, py, css, c, cpp, go, rs, java, lua, php
. you can configure for which file extensions to support in the plugin's setting panel.
Most of the shortcuts are consistent with VS Code. Here are some of the supported shortcuts:
Category | Shortcut | Action |
---|---|---|
Ctrl | ctrl + c |
Copy |
ctrl + x |
Cut | |
ctrl + v |
Paste | |
ctrl + s |
Save | |
ctrl + a |
Select All | |
ctrl + f |
Find | |
ctrl + h |
Replace | |
ctrl + z |
Undo | |
ctrl + y |
Redo | |
ctrl + / |
Toggle Comment | |
ctrl + d |
Duplicate Line | |
ctrl + [ |
Decrease Indent | |
ctrl + ] |
Increase Indent | |
ctrl + ↑ |
Move Line Up | |
ctrl + ↓ |
Move Line Down | |
ctrl + ← |
Move Cursor Left by Word | |
ctrl + → |
Move Cursor Right by Word | |
ctrl + Backspace |
Delete Word Left | |
ctrl + Delete |
Delete Word Right | |
Ctrl + Shift | ctrl + shift + z |
Redo |
ctrl + shift + k |
Delete Current Line | |
ctrl + shift + [ |
Fold Code Block | |
ctrl + shift + ] |
Unfold Code Block | |
ctrl + shift + enter |
Insert Line Above | |
ctrl + enter |
Insert Line Below | |
Alt | alt + z |
Toggle Word Wrap |
Light color theme
Dark color theme
Create code file
This plugin also supports editing individual code blocks from any Markdown document in the editor. You can just right click on any code block and click on "Edit Code Block in VSCode Editor Plugin".
This will open a new modal with a Monaco Editor instance in which you can edit the code block, which will automatically sync back to the block in your document when you close the modal.
You can add a internal link to a code file in obsidian, and hovering the cursor over the link for quick preview.
Code file will not appear in file prompt list when intert Internal links. You need open Detect all file extensions
setting.
Installation from Obsidian's community plugins:
Manual installation:
obsidian-vscode-editor-x.y.z.zip
file, where x.y.z
is the version number<vault>/.obsidian/plugins/
(Note: .obsidian
folder may be hidden, you need to show it firstly)If you've got any kind of feedback or questions, feel free to reach out via GitHub issues.