This repository contains two separate VS Code extensions for writing prose/LaTeX/Markdown with consistent hard-wrapping:
- gq-reflow - a Vim
gq-style command to reflow text to a target column (default 80). - hardwrap-on-type - automatically hard-wraps while typing when your cursor exceeds the target column (default 80).
Both extensions can be configured to only activate for certain file extensions (e.g. .md, .tex) so you don't affect source code files.
- VS Code (recent stable)
- Node.js (LTS recommended)
- The VS Code CLI available as
codeon your PATH
Verify the CLI is available:
code --versionOn macOS/Linux you can enable this from VS Code:
- Command Palette -> Shell Command: Install 'code' command in PATH
This repo includes a root package.json with scripts that install dependencies for both extensions and then package + install them into your local VS Code.
From the repository root:
npm run install:all
npm run install:local:all-
npm run install:all- runs
npm installinsidegq-reflow/andhardwrap-on-type/
- runs
-
npm run install:local:all- runs each extension's
install:localscript, which:- compiles TypeScript
- packages a
.vsix - installs/updates it into VS Code using
code --install-extension ... --force
- runs each extension's
After installing, reload or restart VS Code.
When you change extension code:
npm run install:local:allThat will rebuild and reinstall both extensions.
Make sure the VS Code CLI is on your PATH (see Requirements above).
If your CLI binary is not named code, you can usually set an environment variable used by the install script:
- PowerShell:
$env:VSCODE_CLI="C:\Path\To\code.cmd" npm run install:local:all
- Bash/zsh:
VSCODE_CLI=/path/to/code npm run install:local:all
Both extensions are configurable to only run on certain file extensions. Check your VS Code settings:
gqReflow.enabledFileExtensionshardwrapOnType.enabledFileExtensions
You can also run each extension in the Extension Development Host:
- Open
gq-reflow/orhardwrap-on-type/in VS Code - Press F5
- A second VS Code window opens with the extension loaded for testing
my-extensions/
package.json
README.md
gq-reflow/
hardwrap-on-type/
Add your chosen license here (e.g. MIT).