基于VSCode软件的markdown笔记环境配置

前期在CSDN上用markdown写了一些博客,使用时还是觉得不太方便,尤其是在编写公式时,效率十分低下。但Markdown本身还是一款非常不错的笔记撰写工具,所以一直琢磨着怎么改善其使用体验。然后近来无意中发现可以通过配置VSCODE+Markdown+snippet来提高Markdown的工作能力,此篇笔记就来记录下配置过程吧!

vscode下载及安装

VScode下载安装相当简单,直接进入 官网,选择与自己电脑系统相匹配的安装包下载即可。

VScode安装包下载

Fig.1 VScode安装包下载

如图1所示,VScode可安装于windows系统、linux系统以及mac系统。本电脑是windows系统64位的,为了安装方便,就直接选择了红框部分的System Installer 64 bit安装,点击后会自动下载一个exe文件,下载好后,直接双击安装。

markdown环境配置

主要参考这篇 博客 进行配置,博客中提到的插件商店如下图指示位置:
应用商店位置

Fig.2 应用商店位置

主要插件有:

  • Markdown all in one
  • Markdown Preview Enhanced
  • Markdown Preview GitHub styling
  • Markdown Shortcut
  • Auto-open Markdown Preview
  • Markdown Toc

最终效果如下:

markdown环境配置

Fig.3 markdown环境配置

snippets插件配置

Ctrl+shift+P打开配置文件搜索窗口,输入setting,如下图所示:
配置文件搜索

Fig.4 配置文件搜索

选择箭头指向的条目,点击进去,得到下图设置界面,先在框内搜索markdown,然后点击下面的:Edit in settings.json

打开配置文件

Fig.5 打开配置文件

打开后,对于markdown部分改成以下设置:

    "[markdown]": {
        
        "editor.formatOnSave": true,
        "editor.renderWhitespace": "all",
        "editor.quickSuggestions": {
            "other": true,
            "comments": true,
            "strings": true
        },
        "editor.acceptSuggestionOnEnter": "on"
    }

最后尝试自己新建一个snippet片段:

snippet插件

Fig.6 snippet插件

如图6所示步骤,点击User Snippets,得到下面的搜素框:

创建选择

Fig.7 创建选择
可选择`markdown.json`或`new Global snippets file`。本文选择前者,打开后,可在这个`json`文件中添加自己snippet(以下是个人创建的两个简单的snippet):
	// Place your snippets for markdown here. Each snippet is defined under a snippet name and has a prefix, body and 
	// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
	// same ids are connected.
	// Example:
	"markdown website link": {
		"prefix": "mkhttp",
		"body": [
			"[${1:网址}]($2)"
		],
		"description": "Log output to console"
	},	

	"markdown insert figure": {
		"prefix": "mkfig",
		"body": [
			"![${1:picture_name}](./fig/${1:picture_name}.png)",
			"<center>Fig.$2 ${1:picture_name} </center></td>",
			"$3"
		],
		"description": "Log {output to console}"
	},

以第一个为例,snippet的名称是markdown website link,触发关键字是mkhttp,片段内容是"[${1:网址}]($2)"。我们在自己撰写的markdown文件中输入关键字mkhttp,按tab键然后就能弹出相应内容:
snippet使用

Fig.8 snippet使用

后续可以把复杂的公式格式变成特定的snippet来快速调用。

  • 4
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
配置VSCodeMarkdown环境,可以按照以下步骤进行操作: 1. 首先,你需要使用VSCode打开一个Markdown文件。可以通过新建文件并将其后缀名设置为.md来创建一个Markdown文件。 2. 使用Markdown语法编写内容。你可以参考Markdown官方教程来学习和使用Markdown语法。 3. 如果你想导出Markdown文件为PDF格式,可以安装一个名为"Markmap"的插件。 4. 如果你想插入图片,可以选择使用一个名为"Markdown Image"的插件,并按照以下步骤进行配置: a) 安装"Markdown Image"插件,并将其文件存放路径配置为你想要的路径。 b) 在全局的setting.json文件中添以下配置信息: "markdown-image.base.fileNameFormat": "${path}/image/${mdname}/${prompt}", "markdown-image.local.path": "/", "markdown-image.base.codeType": "HTML" c) 这样配置后,你就可以使用HTML语法来插入图片,并且可以通过调整HTML代码来调整图片的大小。 通过以上步骤,你可以成功配置VSCodeMarkdown环境,包括编写Markdown文件、导出为PDF以及插入图片等操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [VScode配置markdown](https://blog.csdn.net/weixin_46372074/article/details/129524819)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [Vscode 搭建舒适的 Markdown 编辑环境](https://blog.csdn.net/Nrush/article/details/124239656)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值