Skip to content

Commit

Permalink
Added emphasis shortcuts and toggle list command
Browse files Browse the repository at this point in the history
- Toggle Bold, Italics, and Underline (`ctrl/cmd + b|i|u`)
- Increase and decrease header level (`ctrl/cmd + shift + ]|[`)
- Added 'Typst Companion: Toggle List' command to command palette.
  • Loading branch information
CFiggers committed Sep 2, 2023
1 parent 3094454 commit b1c8b92
Show file tree
Hide file tree
Showing 5 changed files with 434 additions and 4 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Change Log

All notable changes to Typst Companion will be documented in this file.
All notable changes to Typst Companion will be documented here.

## 0.0.3

- Added toggle Bold with `ctrl/cmd + b`.
- Added toggle Italic with `ctrl/cmd + i`.
- Added toggle Underline with `ctrl/cmd + u`.
- Added increase/decrease Header level with `ctrl/cmd + shift + ]` and `ctrl/cmd + shift + ]`, respectively.
- Added 'Typst Companion: Toggle List' command to command palette.

## 0.0.2

- New logo.

## 0.0.1

Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ A VS Code extension that adds Markdown-like editing niceties **on top of and in
- `Enter` while in a list context (either ordered or unordered) continues the existing list at the current level of indentation (with correct numbering, if ordered).
- `Tab` and `Shift+Tab` while in a list context (either ordered or unordered) indents and out-dents bullets intuitively (and re-numbers ordered lists if appropriate).
- Reordering lines inside an ordered list automatically updates the list numbers accordingly.
- Keyboard Shortcuts for:
- Toggle Bold, Italics, and Underline (`ctrl/cmd + b|i|u`)
- Increase and decrease header level (`ctrl/cmd + shift + ]|[`)

## Requirements

Expand All @@ -16,9 +19,15 @@ I *strongly* encourage installing Nathan Varner's [Typst LSP](https://github.com

## Release Notes

### 0.0.1
### 0.0.3

Initial release of Typst Companion.
- Added toggle Bold with `ctrl/cmd + b`.
- Added toggle Italic with `ctrl/cmd + i`.
- Added toggle Underline with `ctrl/cmd + u`.
- Added increase/decrease Header level with `ctrl/cmd + shift + ]` and `ctrl/cmd + shift + ]`, respectively.
- Added 'Typst Companion: Toggle List' command to command palette.

For previous versions, see the [CHANGELOG on GitHub](https://github.com/CFiggers/typst-companion/blob/main/CHANGELOG.md).

## Prior Art

Expand Down
39 changes: 38 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "typst-companion",
"displayName": "Typst Companion",
"description": "Adds Markdown-like editing niceties on top of Typst LSP.",
"version": "0.0.2",
"version": "0.0.3",
"author": "Caleb Figgers",
"publisher": "CalebFiggers",
"icon": "icons/typst-companion-icon.png",
Expand Down Expand Up @@ -78,6 +78,13 @@
}
}
],
"commands": [
{
"command": "typst-companion.extension.editing.toggleList",
"enablement": "editorLangId == typst",
"title": "Typst Companion: Toggle List"
}
],
"keybindings": [
{
"command": "typst-companion.extension.onEnterKey",
Expand Down Expand Up @@ -145,6 +152,36 @@
"key": "ctrl+[",
"mac": "cmd+[",
"when": "editorTextFocus && editorLangId == typst && !suggestWidgetVisible"
},
{
"command": "typst-companion.extension.editing.toggleBold",
"key": "ctrl+b",
"mac": "cmd+b",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst"
},
{
"command": "typst-companion.extension.editing.toggleItalic",
"key": "ctrl+i",
"mac": "cmd+i",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst"
},
{
"command": "typst-companion.extension.editing.toggleUnderline",
"key": "ctrl+u",
"mac": "cmd+u",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst"
},
{
"command": "typst-companion.extension.editing.toggleHeadingUp",
"key": "ctrl+shift+]",
"mac": "ctrl+shift+]",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst"
},
{
"command": "typst-companion.extension.editing.toggleHeadingDown",
"key": "ctrl+shift+[",
"mac": "ctrl+shift+[",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst"
}
]
},
Expand Down
4 changes: 4 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as vscode from 'vscode';
import { contextServiceManager } from "./editor-context-service/manager"
import * as listEditing from './listEditing';
import * as formatting from './format';

export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(
Expand All @@ -13,6 +14,9 @@ export function activate(context: vscode.ExtensionContext) {
// Override `Enter`, `Tab` and `Backspace` keys
listEditing.activate(context);

// Shortcuts
formatting.activate(context);

}

export function deactivate() {}
Loading

0 comments on commit b1c8b92

Please sign in to comment.