Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
replace sidebar, write keybindings
Browse files Browse the repository at this point in the history
  • Loading branch information
sawka committed Sep 22, 2024
1 parent c0290c3 commit 5421d0c
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 25 deletions.
6 changes: 6 additions & 0 deletions docs/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
sidebar_position: 1
id: "index"
title: "Home"
---

import Card from '@site/src/components/card.tsx';
Expand All @@ -10,6 +12,10 @@ import Card from '@site/src/components/card.tsx';

Wave is an open-source terminal that adds the ability to launch graphical widgets, controlled and integrated directly with the CLI.

References:

* [Key Bindings](./keybindings)

## Features

<Card />
55 changes: 55 additions & 0 deletions docs/keybindings.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
sidebar_position: 2
id: "keybindings"
title: "Key Bindings"
---

Here's the set of default keybindings available in Wave. It is split into sections.
Some keybindings are always active. Others are only active for certain types of blocks.

Note that these are the MacOS keybindings (they use "Cmd"). For Windows and Linux
replace "Cmd" with "Alt" (note that "Ctrl" is "Ctrl" on both Mac, Windows, and Linux).

## Global Keybindings

| Key | Function |
|-----|----------|
| Cmd:t | Open a new tab |
| Cmd:n | Open a new terminal block (defaults to the same connection and working directory) |
| Cmd:w | Close the current block |
| Cmd:m | Magnify / Un-Magnify the current block |
| Cmd:g | Open the "connection" switcher |
| Cmd:i | Refocus the current block (useful if the block has lost input focus) |
| Ctrl:Shift | Show block numbers |
| Ctrl:Shift:[number] | Switch to block number |
| Ctrl:Shift:Arrows | Move left, right, up, down between blocks |
| Cmd:[number] | Switch to tab number |
| Cmd:[ | Switch tab left |
| Cmd:] | Siwtch tab right |
| Cmd:Shift:r | Refresh the UI |

## File Preview Keybindings

| Key | Function |
|-----|----------|
| [any character] | any regular character (e.g. "a", "b") will filter the file list |
| Escape | will clear the filter |
| Up/Down Arrow | change file selection up/down |
| Enter | Open the currently selected file/directory |
| Cmd:ArrowUp | move "up" a directory (parent directory) |
| Cmd:ArrowLeft | back, move to the previously selected file/directory |
| Cmd:ArrowRight | forward (opposite of back) |
| Cmd:o | Open a new file (accepts relative paths to the current directory) |
| Cmd:s | When file editor is open, save file |
| Cmd:e | For files that can be previewed or edited (markdown, CSVs), switches between preview and edit mode |
| Cmd:r | When file editor is open, revert changes |

## Web Keybindings

| Key | Function |
|-----|----------|
| Cmd:l | focus the URL input bar |
| Escape | when the URL input bar is focused, will focus the web content |
| Cmd:r | reload webpage |
| Cmd:ArrowLeft | back |
| Cmd:ArrowRight | forward |
1 change: 1 addition & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const config: Config = {
{
path: "docs",
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.ts"),
} as import("@docusaurus/plugin-content-docs").Options,
],
"ideal-image",
Expand Down
37 changes: 12 additions & 25 deletions sidebars.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";

/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/
const sidebars: SidebarsConfig = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{ type: "autogenerated", dirName: "." }],

// But you can create a sidebar manually
/*
tutorialSidebar: [
'intro',
'hello',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
},
],
*/
mainSidebar: [
{
type: "doc",
id: "index",
label: "Home",
},
{
type: "doc",
id: "keybindings",
label: "Keybindings",
},
],
};

export default sidebars;

0 comments on commit 5421d0c

Please sign in to comment.