Skip to content

Commit

Permalink
Merge pull request #49 from jsonreeder/develop
Browse files Browse the repository at this point in the history
Prep for deployment
  • Loading branch information
jsonreeder committed Apr 8, 2017
2 parents 2213786 + 29df579 commit b8bbd4d
Show file tree
Hide file tree
Showing 11 changed files with 398 additions and 152 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
@@ -1,7 +1,9 @@
# Change Log
All notable changes to the "org-mode" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
All notable changes to VS Code Org Mode will be documented in this file.

## [Unreleased]
### Added
### Changed

## [0.0.1]
- Initial release
112 changes: 41 additions & 71 deletions README.md
@@ -1,88 +1,70 @@
# VS Code Org Mode

![unicorn logo](docs/img/logo.png)
VS Code Org Mode is an extension for Visual Studio Code inspired by the venerable [Org mode for Emacs](http://orgmode.org/). Org lets you keep notes, maintain TODO lists, and author documents, all in plain text.

VS Code Org Mode (`vscode-org-mode`) is an extension for Visual Studio Code that allows users to read and write `.org` files.

The extension is currently in development and has not yet been released to the VS Code Marketplace. The development docs are available [here](docs/README.org).

Initial release is estimated for `[2017-04-10 Mon]`. For updates, star this repo.
The extension is currently in alpha. We welcome issues, feature requests, and contributions to the [repo](https://github.com/jsonreeder/vscode-org-mode).

## How to

The extension can be activated in two ways:
1. Save a file with the extension `.org`
2. Change the language mode to `Org` by either
- Click in the lower right corner to the left of the smiley face
- Type `change language mode` into the command palette
- Using the default shortcut <kbd>cmd</kbd>+<kbd>k</kbd> <kbd>m</kbd>
- Clicking in the lower right corner to the left of the smiley face
- Typing `change language mode` into the command palette
- Using the default shortcut
- Linux / Windows: <kbd>ctrl</kbd>+<kbd>k</kbd> <kbd>m</kbd>
- Mac: <kbd>cmd</kbd>+<kbd>k</kbd> <kbd>m</kbd>

## Features

### Keep Notes
[examples coming soon]

### Maintain TODO Lists
[examples coming soon]

### Author Documents
[examples coming soon]

### Snippets

The extension comes preloaded with a few snippets (try typing `link` and hitting <kbd>tab</kbd>, for example).

## Settings

### Keybindings

We recommend the following keybindings. To set them, add them to your `keybindings.json` file.
All actions in VS Code Org mode come packaged with default keybindings. These can be modified in your `keybindings.json` file.

### Custom TODO Keywords

TODO keywords can be customized in `settings.json`. For example:
```json
[
{
"key": "shift+right",
"command": "org.incrementContext",
"when": "editorLangId == 'org'"
},{
"key": "shift+left",
"command": "org.decrementContext",
"when": "editorLangId == 'org'"
},{
"key": "ctrl+enter",
"command": "org.insertHeadingRespectContent",
"when": "editorLangId == 'org'"
},{
"key": "ctrl+c shift+1",
"command": "extension.insertTimestamp",
"when": "editorLangId == 'org'"
},{
"key": "ctrl+c b",
"command": "org.bold",
"when": "editorLangId == 'org'"
},{
"key": "ctrl+c i",
"command": "org.italic",
"when": "editorLangId == 'org'"
},{
"key": "ctrl+c u",
"command": "org.underline",
"when": "editorLangId == 'org'"
},{
"key": "ctrl+c c",
"command": "org.code",
"when": "editorLangId == 'org'"
},{
"key": "ctrl+c v",
"command": "org.verbose",
"when": "editorLangId == 'org'"
},{
"key": "ctrl+c l",
"command": "org.literal",
"when": "editorLangId == 'org'"
}
"org.todoKeywords": [
"TODO",
"DONE",
"WAIT",
"SCHD"
]
```

## Docs

## Contributing
Detailed documentation is kept in the [GitHub Wiki](https://github.com/jsonreeder/vscode-org-mode/wiki).

Guidelines for contributing are coming soon. Also, see Git conventions below.
## Contributing

## Conventions
We welcome contributions to the GitHub repo. Here are basic guidelines for conventions.

### Naming

The full name of this project is `VS Code Org Mode`. It is abbreviated `vscode-org-mode`. In the VS Code Marketplace, it is listed as `Org Mode`.

Commands are prefixed with `org.` and followed by camel case, eg `org.insertHeadingRespectContent`. Command titles are prefixed with `Org: ` and followed by capitalized words separated by spaces, eg `Org: Insert Heading Respect Content`.

Filenames use kebab case.
Filenames use kebab case, eg `header-functions.ts`.

When referring to the original Org mode, we capitalize the "O" and leave the "m" lower case. This is in keeping with the original teams usage on [orgmode.org](http://orgmode.org/).
When referring to the original Org mode, we capitalize the "O" and leave the "m" lower case. This is in keeping with the original team's usage on [orgmode.org](http://orgmode.org/).

### Code

Expand All @@ -104,17 +86,9 @@ Our unicorn icon is based on an image by [M. Turan Ercan](https://thenounproject

This work is available under the [GNU General Public License v3](https://www.gnu.org/licenses/gpl-3.0.en.html).

## Features

Features description coming soon.

## Requirements

Requirements description coming soon.

## Extension Settings

Settings description coming soon.
Install the extension. The rest will be taken care of.

## Known Issues

Expand All @@ -130,10 +104,6 @@ Until Microsoft addresses those issues, it appears to be impossible to implement

Colorization, bolding, italicization, and other modes of highlighting are handled differently by different themes. We have prioritized supporting the default VS Code themes (Dark+ and Light+). This prioritization means that some colors may not appear as expected in other themes, or that opportunities for more variance have been missed.

### Additional

Feel free to call out issues using the `Issues` tab above.

## Release Notes

Release notes coming soon.
See [CHANGELOG.md](https://github.com/jsonreeder/vscode-org-mode/blob/develop/CHANGELOG.md).
2 changes: 1 addition & 1 deletion docs/demo.org
Expand Up @@ -39,4 +39,4 @@ Check for milk mustache
*** Request broom
** TODO Sweep other rooms
** TODO Wash floors
** TODO Nap
** TODO Nap
96 changes: 91 additions & 5 deletions package.json
Expand Up @@ -34,8 +34,12 @@
"title": "Org: Do Promote"
},
{
"command": "org.doPromoteSubtree",
"title": "Org: Do Promote Subtree"
"command": "org.promoteSubtree",
"title": "Org: Promote Subtree"
},
{
"command": "org.demoteSubtree",
"title": "Org: Demote Subtree"
},
{
"command": "org.timestamp",
Expand Down Expand Up @@ -80,8 +84,7 @@
"aliases": [
"Org",
"Org Markup",
"org",
"org-mode"
"Org Mode"
],
"extensions": [
".org"
Expand All @@ -106,7 +109,90 @@
"description": "Specifies the types of TODO statuses available (for switching)."
}
}
}
},
"snippets": [
{
"language": "org",
"path": "./snippets/org.json"
}
],
"keybindings": [
{
"command": "org.insertHeadingRespectContent",
"key": "ctrl+alt+o h",
"when": "editorLangId == 'org'"
},
{
"command": "org.insertSubheading",
"key": "ctrl+alt+o s",
"when": "editorLangId == 'org'"
},
{
"command": "org.doDemote",
"key": "ctrl+alt+o shift+d",
"when": "editorLangId == 'org'"
},
{
"command": "org.doPromote",
"key": "ctrl+alt+o shift+p",
"when": "editorLangId == 'org'"
},
{
"command": "org.promoteSubtree",
"key": "ctrl+alt+o p",
"when": "editorLangId == 'org'"
},
{
"command": "org.demoteSubtree",
"key": "ctrl+alt+o d",
"when": "editorLangId == 'org'"
},
{
"command": "org.timestamp",
"key": "ctrl+alt+o t",
"when": "editorLangId == 'org'"
},
{
"command": "org.incrementContext",
"key": "alt+right",
"when": "editorLangId == 'org'"
},
{
"command": "org.decrementContext",
"key": "alt+left",
"when": "editorLangId == 'org'"
},
{
"command": "org.bold",
"key": "ctrl+alt+o b",
"when": "editorLangId == 'org'"
},
{
"command": "org.italic",
"key": "ctrl+alt+o i",
"when": "editorLangId == 'org'"
},
{
"command": "org.underline",
"key": "ctrl+alt+o u",
"when": "editorLangId == 'org'"
},
{
"command": "org.code",
"key": "ctrl+alt+o c",
"when": "editorLangId == 'org'"
},
{
"command": "org.verbose",
"key": "ctrl+alt+o v",
"when": "editorLangId == 'org'"
},
{
"command": "org.literal",
"key": "ctrl+alt+o l",
"when": "editorLangId == 'org'"
}
]
},
"scripts": {
"vscode:prepublish": "tsc -p ./",
Expand Down
27 changes: 27 additions & 0 deletions snippets/org.json
@@ -0,0 +1,27 @@
{
"title": {
"prefix": "title",
"body": "#+TITLE: ${1:title text}",
"description": "Document title"
},
"options": {
"prefix": "options",
"body": "#+OPTIONS: ${1:option text}",
"description": "Document options"
},
"toc": {
"prefix": "toc",
"body": "#+TOC: ${1:toc text}",
"description": "Document table of contents"
},
"include": {
"prefix": "include",
"body": "#+INCLUDE: ${1:include file}",
"description": "Include file for export"
},
"link": {
"prefix": "link",
"body": "[[${1:link_path}]${2:[${3:Descriptor}]}]",
"description": "External link"
}
}
2 changes: 1 addition & 1 deletion src/cursor-context.ts
Expand Up @@ -38,7 +38,7 @@ export default function getCursorContext(textEditor: TextEditor, edit: TextEdito
// Match for TODO (or absence)
const todoKeywords = Util.getKeywords().join("|");
// const todoWords = "TODO|DONE";
const todoHeaderRegexp = new RegExp(`^(\\*+\\s+)(${todoKeywords})(?:\\b|\\[)`);
const todoHeaderRegexp = new RegExp(`^(\\*+\\s+)(${todoKeywords})(?:\\b|\\[|$)`);
match = todoHeaderRegexp.exec(curLine);
if (match) {
// We've found our match
Expand Down
14 changes: 7 additions & 7 deletions src/extension.ts
Expand Up @@ -3,22 +3,21 @@ import * as vscode from 'vscode';
import * as HeaderFunctions from './header-functions';
import * as TimestampFunctions from './timestamp-functions';
import * as MarkupFunctions from './markup-functions';
import * as SubtreeFunctions from './subtree-functions';
import {
incrementContext,
decrementContext
} from './modify-context';

export function activate(context: vscode.ExtensionContext) {
let insertSiblingCmd = vscode.commands.registerTextEditorCommand('org.insertHeadingRespectContent', HeaderFunctions.insertSibling);
let insertHeadingRespectContentCmd = vscode.commands.registerTextEditorCommand('org.insertHeadingRespectContent', HeaderFunctions.insertHeadingRespectContent);
let insertChildCmd = vscode.commands.registerTextEditorCommand('org.insertSubheading', HeaderFunctions.insertChild);
let demoteLineCmd = vscode.commands.registerTextEditorCommand('org.doDemote', HeaderFunctions.demoteLine);
let promoteLineCmd = vscode.commands.registerTextEditorCommand('org.doPromote', HeaderFunctions.promoteLine);
let promoteSubtreeCmd = vscode.commands.registerTextEditorCommand('org.doPromoteSubtree', HeaderFunctions.promoteSubtree);
let promoteSubtreeCmd = vscode.commands.registerTextEditorCommand('org.promoteSubtree', SubtreeFunctions.promoteSubtree);
let demoteSubtreeCmd = vscode.commands.registerTextEditorCommand('org.demoteSubtree', SubtreeFunctions.demoteSubtree);

let insertTimestampCmd = vscode.commands.registerTextEditorCommand('org.timestamp', (textEditor, edit) => {
vscode.window.showInformationMessage('Inserting Date');
TimestampFunctions.insertTimestamp(textEditor, edit);
});
let insertTimestampCmd = vscode.commands.registerTextEditorCommand('org.timestamp', TimestampFunctions.insertTimestamp);

let incrementContextCmd = vscode.commands.registerTextEditorCommand('org.incrementContext', incrementContext);

Expand All @@ -31,13 +30,14 @@ export function activate(context: vscode.ExtensionContext) {
const verboseCmd = vscode.commands.registerTextEditorCommand('org.verbose', MarkupFunctions.verbose);
const literalCmd = vscode.commands.registerTextEditorCommand('org.literal', MarkupFunctions.literal);

context.subscriptions.push(insertSiblingCmd);
context.subscriptions.push(insertHeadingRespectContentCmd);
context.subscriptions.push(insertChildCmd);

context.subscriptions.push(demoteLineCmd);
context.subscriptions.push(promoteLineCmd);

context.subscriptions.push(promoteSubtreeCmd);
context.subscriptions.push(demoteSubtreeCmd);

context.subscriptions.push(insertTimestampCmd);
context.subscriptions.push(incrementContextCmd);
Expand Down

0 comments on commit b8bbd4d

Please sign in to comment.