Skip to content

A collection of VS Code extensions for hard-wrapping and reflowing prose, with first-class support for Markdown and LaTeX.

License

Notifications You must be signed in to change notification settings

Tosuma/VSCode-Hardwrap-Tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My VS Code Extensions

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.


Requirements

  • VS Code (recent stable)
  • Node.js (LTS recommended)
  • The VS Code CLI available as code on your PATH

Verify the CLI is available:

code --version

On macOS/Linux you can enable this from VS Code:

  • Command Palette -> Shell Command: Install 'code' command in PATH

Install everything (recommended)

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

What these do

  • npm run install:all

    • runs npm install inside gq-reflow/ and hardwrap-on-type/
  • npm run install:local:all

    • runs each extension's install:local script, which:
      1. compiles TypeScript
      2. packages a .vsix
      3. installs/updates it into VS Code using code --install-extension ... --force

After installing, reload or restart VS Code.


Update after changes

When you change extension code:

npm run install:local:all

That will rebuild and reinstall both extensions.


Troubleshooting

The code command is not found

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

Extensions installed but not doing anything

Both extensions are configurable to only run on certain file extensions. Check your VS Code settings:

  • gqReflow.enabledFileExtensions
  • hardwrapOnType.enabledFileExtensions

Development

You can also run each extension in the Extension Development Host:

  1. Open gq-reflow/ or hardwrap-on-type/ in VS Code
  2. Press F5
  3. A second VS Code window opens with the extension loaded for testing

Repository layout

my-extensions/
  package.json
  README.md
  gq-reflow/
  hardwrap-on-type/

License

Add your chosen license here (e.g. MIT).

About

A collection of VS Code extensions for hard-wrapping and reflowing prose, with first-class support for Markdown and LaTeX.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published