Getting started
Installation
Install the package with the following commands:
shell
npm i @tabmate/coreshell
yarn add @tabmate/coreshell
pnpm add @tabmate/coreUsage
The simplest way to use TabMate is to attach it to a textarea element:
js
import { tabmate } from "@tabmate/core";
// Get a reference to your textarea
const textarea = document.querySelector("textarea");
// Attach TabMate to the textarea
const instance = tabmate(textarea);
// Now the textarea has enhanced tab behavior!With this basic setup, your textarea will now support:
- Pressing
Tabto insert spaces - Pressing
Shift+Tabto remove indentation - Multi-line indentation when text is selected
If you want to find out about all the configuration options of the tabmate instance you can check it out in the doc.