Skip to content
Dmytro Halichenko edited this page Feb 18, 2025 · 4 revisions

Purpose

This page intends to teach you how to trigger IWE's features from inside your text editor.

Background

IWE is not a plugin. IWE's features are implemented as Language Server Protocol (LSP) capabilities. This makes IWE editor-agnostic; it's intended to work the same across all text editors that support the LSP standard.

What this means for you is that to interact with IWE from inside your editor, you need to use LSP requests. These may be accessed differently across editors, and it's up to each editor to implement them properly. If you've ever used something like "Find References" or "Go To Definition" before, then you're already familiar with LSP requests.

Cheat Sheet

Here's a cheat sheet connecting each LSP request with the IWE LSP features it triggers.

IWE Feature LSP Request
Extract/Inline Notes Code Action
Go To Definition Follow Link
Go To References List/Follow Backlinks
Document Symbols View Table of Contents
Workspace Symbols Global Search
Format Text Structure Normalization
Rename note Rename Symbol

Usage Example

Most editors have keybindings for LSP requests. Consult their documentation to learn what they are.

Suppose that you have the following in a Markdown file:

# My First Note

There's some content here.

## Another section

With a list inside it:

- list item
- another item

Try moving your cursor to the ## Another section line, and then invoking the "Code Action" command (space + a in Helix). Some options from IWE will appear. Select "Extract section". Now, your file will look like this:

# My First Note

There's some content here.

[Another section](2sbdlvhe)

The 2sbdlvhe refers to the name of a new file IWE just generated for you. Now, move your cursor anywhere on this link, and use the "Go To Definition" (gd in Helix) command. Your editor will open the new file, where you'll find the following:

# Another section

With a list inside it:

- list item
- another item

Now, if you move your cursor to the # Another section line and use the "Go To References" command (gr in Helix), you'll be returned to your original file, the one that links to this one.