简体   繁体   English

VSCode 可以显示 Markdown 语法预览窗格吗?

[英]Can VSCode display a Markdown syntax preview pane?

I am typing a README document in Markdown using Visual Studio Code.我正在使用 Visual Studio Code 在 Markdown 中键入自述文件。 I found an online browser-based tool called Markdown Live Preview , but I was wondering if VSCode had any sort of handy split-window pane already built into it.我找到了一个基于浏览器的在线工具,名为Markdown Live Preview ,但我想知道 VSCode 是否已经内置了任何一种方便的拆分窗口窗格。

Make sure that your document is saved as a Markdown file in VSCode: 确保您的文档在VSCode中保存为Markdown文件:

File > Save as > README.md (The text will be color-coded.) 文件>另存为> README.md(文本将采用颜色编码。)

In the top right corner of VSCode, click the "Split Editor" icon to enable side-by-side editing. 在VSCode的右上角,单击“拆分编辑器”图标以启用并排编辑。

Click the "Open Preview" magnifying glass icon to view a live preview of your Markdown syntax that updates as you type! 单击“打开预览”放大镜图标可查看Markdown语法的实时预览,该语法在您键入时更新!

VSCode图标标签

The "Mouse-Clicks" way seems inefficient, try vscode pre-defined keybind as markdown.showPreviewToSide : “鼠标点击”方式似乎效率低下,请尝试使用vscode预定义的keybind作为markdown.showPreviewToSide

ctrl+k v

which means when you are editing a markdown file, press Ctrl+k , then loosen both and press v , it comes a preview of current markdown file in the other splited side. 这意味着当您编辑降价文件时,按Ctrl+k ,然后松开两者并按v ,它会预览另一个分割面中的当前降价文件。

Another command that can be used is "Markdown: Open Preview" which can be called both from intellisence ( ctrl + shift + p , start typing "Markdown" to see available commands) or by a direct keybinding: default is ctrl + shift + v , custom may be set at Keyboard Shortcuts ( ctrl + k ctrl + s ).另一个可以使用的命令是“Markdown:打开预览”,它可以从智能( ctrl + shift + p ,开始键入“Markdown”以查看可用命令)或通过直接键绑定调用:默认为ctrl + shift + v , 可以在键盘快捷键 ( ctrl + k ctrl + s ) 中设置自定义。

However, this command opens the preview in another tab, so if you need splitted window, you'll need to do it manually or by some other hotkeys.但是,此命令会在另一个选项卡中打开预览,因此如果您需要拆分 window,则需要手动或通过其他一些热键进行。

Allow me to point out an alternate way of working with Markdown in vscode. 请允许我指出在vscode中使用Markdown的另一种方法。 The extension "Instant Markdown" will launch a local browser preview on :1090 (I believe) that allows you to position the render wherever you like. 扩展名“Instant Markdown”将在以下位置启动本地浏览器预览:1090(我相信),您可以将渲染放置在任何位置。 This is a pleasant way of watching the document grow in real time in a format that is much more like what you would see on Github for example. 这是一种观看文档实时增长的愉快方式,其格式更像您在Github上看到的格式。 The preview pane in VSCode is a bit too dissimilar to the real thing for my taste. VSCode中的预览窗格与我的品味有点太不相似。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM