代码分享 | Stata 大纲(Stata Outline)
logo
目录
Stata Outline / Stata 大纲
Version / 版本: 0.1.3
Author / 作者: Zihao Viston Wang / 王梓豪
New Features / 新功能
- Add shortcut key function. 添加快捷键功能。

Example of Outline or Bookmark with hierarchical sections in a Stata
.dofile. (Left: VS Code, Right: Stata)Stata
.do文件中具有层次结构的大纲(书签)视图。(左侧:VS Code,右侧:Stata)
Introduction / 介绍
-
This VS Code extension adds Outline support for Stata
.dofiles. -
It automatically recognizes comment lines with multiple
#symbols as section headers, supporting hierarchical structure in the Outline view.**#→ Level 1**##→ Level 2**###→ Level 3- and so on…
-
Supports shortcut keys:
Ctrl+1/2/3/4/5/6(Windows) orCmd+1/2/3/4/5/6(Mac): Convert the current line to the corresponding level header.Ctrl+0(Windows) orCmd+0(Mac): Convert the current line to a normal line.
-
此VS Code扩展添加了对Stata
.do文件的大纲支持。 -
它自动识别带有多个“#”符号的注释行作为节头,支持Outline视图中的层次结构。
**#→ 一级标题**##→ 二级标题**###→ 三级标题- 依此类推…
-
支持快捷键:
Ctrl+1/2/3/4/5/6(Windows) 或Cmd+1/2/3/4/5/6(Mac): 将当前行转换为对应级别标题。Ctrl+0(Windows) 或Cmd+0(Mac): 将当前行转换为普通行。
Features / 特点
- Display hierarchical sections in Outline view based on comment markers.
- Supports unlimited levels by adding more
#. - Easy to navigate large
.dofiles.
- 在大纲视图中根据注释标记显示层次结构部分。
- 通过添加更多的“#”支持无限级别。
- 便于浏览大型
.do文件。
Installation / 安装
Extension Market Installation / 拓展市场安装
- Search for “Stata Outline” in the VS Code extensions and install it.
- Open any
.dofile and open the Outline panel (Explorer → Outline) to see the hierarchical sections.
- 在VS Code扩展中搜索“Stata Outline”并安装。
- 打开任何
.do文件并打开大纲面板(资源管理器 → 大纲)以查看层次结构部分。
Manual Installation / 手动安装
- Download the
stata-outline-x.x.x.vsixfile from this releases page. - Open VS Code → Extensions panel → Click
...→Install from VSIX... - Select the downloaded
stata-outline-x.x.x.vsixfile. - Open any
.dofile and open the Outline panel (Explorer → Outline) to see the hierarchical sections.
- 从此发布页面下载
stata-outline-x.x.x.vsix文件。 - 打开 VS Code → 扩展面板 → 点击
...→从 VSIX 安装... - 选择下载的
stata-outline-x.x.x.vsix文件。 - 打开任何
.do文件并打开大纲面板(资源管理器 → 大纲)以查看层次结构部分。
Usage Example / 使用案例
**# Data Processing
**## Cleaning
**### Remove duplicates
**# Model Estimation
***## Regression Analysis
...
版本记录
| Version 版本 |
Note 内容 |
Date 发布时间 |
|---|---|---|
| 0.1.3 | Fixed the problem that **#,**##(that is, there is no space between ** and #) are not displayed in the outline修复 **#、**##(即 **与 #之间没空格) |
2025-12-30 |
| 0.1.2 | Add shortcut key function. 添加快捷键功能。 |
2025-12-26 |
| 0.1.0 - 0.1.1 | Matches Stata’s bookmark style, with comment lines starting with **#, etc. as section titles.匹配Stata的书签风格,以 **#等开头的注释行作为节标题。 |
2025-12-25 |