Skip to content

开发相关工具

设置git ssh代理

设置 ~/.ssh/config

text
Host github.com
Hostname ssh.github.com
Port 443
ProxyCommand ncat --proxy ${proxy_host}:${proxy_port} --proxy-type socks5 %h %p

vscode

配置markdown环境

插件

  • Markdown All In One
  • Markdown Preview Enhanced
  • Markdown Preview Github Styling
  • Excalidraw
  • Draw.io integration

配置自定义snippets

snippets是文本生成模板,参考vscode 创建用户自定义的snippets

例如创建@meta生成markdown front matter的模板,通过 File > Preferences > Configure User Snippets, 选择markdown.json. 创建如下的snippets.

json
{
	// 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:
	"Print to console": {
		"prefix": "@meta",
		"body": [
			"---",
			"title: \"NewTitle\"",
			"date: \"2024-01-01\"",
			"draft: false",
			"tags: [\"NewTag\"]",
			"---",
		],
		"description": "add markdown front matter"
	}
}

为了通过键盘快捷生成片段, 在settings中搜索tabComplete, 将enable tab completion 设置为 onlySnippets.

配置python Jupyter Notebook

  1. 安装python.
  2. vscode安装Jupyter插件和python插件.
  3. 安装python的相关包 配置镜像地址(默认地址比较慢)
toml
# linux
# ~/.pip/pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

# windows
# ~/pip/pip.ini
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
shell
python.exe -m pip install numpy
python.exe -m pip install matplotlib
python.exe -m pip install jupyter
  1. vscode通过快捷键ctrl+shift+P, 输入命令Jupyter, 选择Create Notebook. 然后选择Jupyter的内核为安装的python.

vscode主题和美化

安装插件

  • Github Theme: 选择Github Dark Colorblind主题。
  • Material icon theme

技巧和快捷键

  • Ctrl + E: 快速搜索文件
  • Ctrl + ,: 打开设置
  • 比较两个文件: Ctrl选择两个文件, 右键 > Compare Selected
  • Alt + Left: Go Back, 回到上一步的地方. 需要两只手才能操作. 可以设置成`Alt +``, 这样就可以单手操作了.