add updated build pipeline template

This commit is contained in:
garlandcrow 2022-11-09 13:54:20 +09:00
parent 352193fc4e
commit 14b5c79d36
13 changed files with 14220 additions and 3982 deletions

3
.eslintrc Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "@antfu"
}

2
.npmrc Normal file
View File

@ -0,0 +1,2 @@
ignore-workspace-root-check=true
node-linker=hoisted

8
.prettierrc Normal file
View File

@ -0,0 +1,8 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"arrowParens": "always",
"pluginSearchDirs": ["."]
}

32
.vscode/tasks.json vendored
View File

@ -1,20 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

258
README.md
View File

@ -8,162 +8,157 @@ Once you enter Insert mode it will be a completely vanilla VSCode experience: th
Operators act on a range of text. In Normal mode the range is specified by the OperatorRange typed after the operator. In Visual mode it is the visual selection.
| Keys | Description |
|-|-|
| `d` | Delete range. |
| `c` | Delete range and enter insert mode. |
| `y` | Yank range. |
| `r` | Yank and delete range. |
| `s` | Select range and enter Visual mode. |
| `q` | Duplicate line. |
| Keys | Description |
| ---- | ----------------------------------- |
| `d` | Delete range. |
| `c` | Delete range and enter insert mode. |
| `y` | Yank range. |
| `r` | Yank and delete range. |
| `s` | Select range and enter Visual mode. |
| `q` | Duplicate line. |
## OperatorRanges
OperatorRanges select a range for an Operator to act on. They must be used in Normal mode by typing an Operator and then an OperatorRange.
| Keys | Description |
|-|-|
| `l` | Character under cursor. |
| `j` | Character to the left of cursor. |
| `i` | Current line and line above. |
| `k` | Current line and line below. |
| `w` | From cursor to beginning of next word. |
| `W` | From cursor to beginning of next word (including punctuation). |
| `b` | From cursor to beginning of previous word. |
| `B` | From cursor to beginning of previous word (including punctuation). |
| `e` | From cursor to end of next word. |
| `E` | From cursor to end of next word (including punctuation). |
| `iw` | Word under cursor. |
| `iW` | Word (including punctuation) under cursor. |
| `aw` | Word under cursor and whitespace after. |
| `aW` | Word (including punctuation) under cursor and whitespace after. |
| `f[char][char]` | From cursor to next occurrence (case sensitive) of [char][char]. |
| `F[char][char]` | From cursor to previous occurrence (case sensitive) of [char][char]. |
| `t[char]` | From cursor to next occurrence (case sensitive) of [char]. |
| `T[char]` | From cursor to previous occurrence (case sensitive) of [char]. |
| `gg` | From current line to first line of the document. |
| `G` | From current line to last line of the document. |
| `}` | From current line to beginning of next paragraph. |
| `{` | From current line to beginning of previous paragraph. |
| `ip` | Current paragraph. |
| `ap` | Current paragraph and whitespace after. |
| `i[bracket]` | Inside the matching `[bracket]`s. Where `[bracket]` is a quote or opening bracket character (any of ``'"`({[<``). |
| `a[bracket]` | Outside the matching `[bracket]`s. Where `[bracket]` is a quote or opening bracket character (any of ``'"`({[<``). |
| `it` | Inside XML tag. |
| `at` | Outside XML tag. |
| `ii` | Inside indentation level. |
| `[number]i` | Including [number] of lines up. |
| `[number]k` | Including [number] of lines down. |
| Keys | Description |
| --------------- | -------------------------------------------------------------------------------------------------------------------- |
| `l` | Character under cursor. |
| `j` | Character to the left of cursor. |
| `i` | Current line and line above. |
| `k` | Current line and line below. |
| `w` | From cursor to beginning of next word. |
| `W` | From cursor to beginning of next word (including punctuation). |
| `b` | From cursor to beginning of previous word. |
| `B` | From cursor to beginning of previous word (including punctuation). |
| `e` | From cursor to end of next word. |
| `E` | From cursor to end of next word (including punctuation). |
| `iw` | Word under cursor. |
| `iW` | Word (including punctuation) under cursor. |
| `aw` | Word under cursor and whitespace after. |
| `aW` | Word (including punctuation) under cursor and whitespace after. |
| `f[char][char]` | From cursor to next occurrence (case sensitive) of [char][char]. |
| `F[char][char]` | From cursor to previous occurrence (case sensitive) of [char][char]. |
| `t[char]` | From cursor to next occurrence (case sensitive) of [char]. |
| `T[char]` | From cursor to previous occurrence (case sensitive) of [char]. |
| `gg` | From current line to first line of the document. |
| `G` | From current line to last line of the document. |
| `}` | From current line to beginning of next paragraph. |
| `{` | From current line to beginning of previous paragraph. |
| `ip` | Current paragraph. |
| `ap` | Current paragraph and whitespace after. |
| `i[bracket]` | Inside the matching `[bracket]`s. Where `[bracket]` is a quote or opening bracket character (any of `` '"`({[< ``). |
| `a[bracket]` | Outside the matching `[bracket]`s. Where `[bracket]` is a quote or opening bracket character (any of `` '"`({[< ``). |
| `it` | Inside XML tag. |
| `at` | Outside XML tag. |
| `ii` | Inside indentation level. |
| `[number]i` | Including [number] of lines up. |
| `[number]k` | Including [number] of lines down. |
## Motions
Motions move the cursor and can be used in Normal or Visual mode. In Visual mode they only move one side of the selection; the other side stays anchored to where it was when you entered Visual mode.
| Keys | Description |
|-|-|
| `l` | Character right. |
| `j` | Character left. |
| `i` | Line up. |
| `k` | Line down. |
| `w` | Word right. |
| `W` | Word (including punctuation) right. |
| `b` | Word left. |
| `B` | Word (including punctuation) left. |
| `e` | Word end right. |
| `E` | Word end (including punctuation) right. |
| `o` | End of line. |
| `u` | Beginning of line. |
| `%` | Go to matching `[bracket]`. Where `[bracket]` is a bracket character (any of ({[<>]})). |
| `f[char][char]` | Next occurrence (case sensitive) of [char][char]. |
| `F[char][char]` | Previous occurrence (case sensitive) of [char][char]. |
| `t[char]` | Next occurrence (case sensitive) of [char]. |
| `T[char]` | Previous occurrence (case sensitive) of [char]. |
| `gg` | First line of the document. |
| `G` | Last line of the document. |
| `}` | Down a paragraph. |
| `{` | Up a paragraph. |
| `H` | Top of screen. |
| `M` | Middle of screen. |
| `L` | Bottom of screen. |
| Keys | Description |
| --------------- | --------------------------------------------------------------------------------------- |
| `l` | Character right. |
| `j` | Character left. |
| `i` | Line up. |
| `k` | Line down. |
| `w` | Word right. |
| `W` | Word (including punctuation) right. |
| `b` | Word left. |
| `B` | Word (including punctuation) left. |
| `e` | Word end right. |
| `E` | Word end (including punctuation) right. |
| `o` | End of line. |
| `u` | Beginning of line. |
| `%` | Go to matching `[bracket]`. Where `[bracket]` is a bracket character (any of ({[<>]})). |
| `f[char][char]` | Next occurrence (case sensitive) of [char][char]. |
| `F[char][char]` | Previous occurrence (case sensitive) of [char][char]. |
| `t[char]` | Next occurrence (case sensitive) of [char]. |
| `T[char]` | Previous occurrence (case sensitive) of [char]. |
| `gg` | First line of the document. |
| `G` | Last line of the document. |
| `}` | Down a paragraph. |
| `{` | Up a paragraph. |
| `H` | Top of screen. |
| `M` | Middle of screen. |
| `L` | Bottom of screen. |
## Actions
Actions are miscellaneous commands that don't follow the well-defined patterns of Operators, OperatorRanges, or Motions.
| Keys | Description |
|-|-|
| `~` | Enter Insert mode. |
| `U` | Move to beginning of line and enter Insert mode. |
| `a` | Move one character to the right and enter Insert mode. |
| `O` | Move to end of line and enter Insert mode. |
| `v` | Enter VisualCharacter mode. |
| `V` | Enter VisualLine mode. |
| `Escape` | Enter Normal mode. |
| `K` | Insert line below and enter insert mode. |
| `I` | Insert line above and enter insert mode. |
| `p` | Put yanked text before cursor. |
| `P` | Put yanked text after cursor. |
| `gl` | Go to last edited location. |
| `gd` | Go to definition of symbol under cursor in current pane. |
| `gp` | Peek definition of symbol under cursor. |
| `gD` | Go to definition of symbol under cursor in new pane. |
| `gr` | Peek references of symbol under cursor. |
| `gR` | Show all references of symbol under cursor in sidebar. |
| `gh` | Show hover popup of symbol under cursor. |
| `gs` | Open Dash to lookup symbol under cursor (required Dash extension). |
| `gu` | Transform symbol under cursor to lowercase. |
| `gU` | Transform symbol under cursor to uppercase. |
| `n` | Delete character under cursor. |
| `h` | Delete character left of cursor. |
| `dd` | Delete current line. |
| `D` | Delete to the end of the line. |
| `cc` | Delete current line and enter Insert mode. |
| `C` | Delete to the end of the line and enter Insert mode. |
| `yy` | Yank current line. |
| `Y` | Yank to the end of the line. |
| `rr` | Yank current line and delete it. |
| `R` | Yank to the end of the line and delete it. |
| `ss` | Select current line. |
| `S` | Select to the end of the line. |
| `qq` | Copy line down. |
| `QQ` | Copy line up. |
| `[space]z` | Undo. |
| `[space]r` | Redo. |
| `[space]i` | Scroll half-page up. |
| `[space]k` | Scroll half-page down. |
| `x[char]` | Swap character under the cursor with next [char] typed. |
| `zz` | Scroll so that cursor is in the middle of the screen. |
| `:` | Goto line # |
| `;` | Repeat the last `f`, `F`, `t` or `T` motion forward. |
| `,` | Repeat the last `f`, `F`, `t` or `T` motion backward. |
| Keys | Description |
| ---------- | ------------------------------------------------------------------ |
| `~` | Enter Insert mode. |
| `U` | Move to beginning of line and enter Insert mode. |
| `a` | Move one character to the right and enter Insert mode. |
| `O` | Move to end of line and enter Insert mode. |
| `v` | Enter VisualCharacter mode. |
| `V` | Enter VisualLine mode. |
| `Escape` | Enter Normal mode. |
| `K` | Insert line below and enter insert mode. |
| `I` | Insert line above and enter insert mode. |
| `p` | Put yanked text before cursor. |
| `P` | Put yanked text after cursor. |
| `gl` | Go to last edited location. |
| `gd` | Go to definition of symbol under cursor in current pane. |
| `gp` | Peek definition of symbol under cursor. |
| `gD` | Go to definition of symbol under cursor in new pane. |
| `gr` | Peek references of symbol under cursor. |
| `gR` | Show all references of symbol under cursor in sidebar. |
| `gh` | Show hover popup of symbol under cursor. |
| `gs` | Open Dash to lookup symbol under cursor (required Dash extension). |
| `gu` | Transform symbol under cursor to lowercase. |
| `gU` | Transform symbol under cursor to uppercase. |
| `n` | Delete character under cursor. |
| `h` | Delete character left of cursor. |
| `dd` | Delete current line. |
| `D` | Delete to the end of the line. |
| `cc` | Delete current line and enter Insert mode. |
| `C` | Delete to the end of the line and enter Insert mode. |
| `yy` | Yank current line. |
| `Y` | Yank to the end of the line. |
| `rr` | Yank current line and delete it. |
| `R` | Yank to the end of the line and delete it. |
| `ss` | Select current line. |
| `S` | Select to the end of the line. |
| `qq` | Copy line down. |
| `QQ` | Copy line up. |
| `[space]z` | Undo. |
| `[space]r` | Redo. |
| `[space]i` | Scroll half-page up. |
| `[space]k` | Scroll half-page down. |
| `x[char]` | Swap character under the cursor with next [char] typed. |
| `zz` | Scroll so that cursor is in the middle of the screen. |
| `:` | Goto line # |
| `;` | Repeat the last `f`, `F`, `t` or `T` motion forward. |
| `,` | Repeat the last `f`, `F`, `t` or `T` motion backward. |
## Occurance Match Mode
Occurance Match Mode lets you easily add cursors to the symbol your cursor is under.
| Keys | Description |
|-|-|
| `[space][space]` | Enter occurance match mode. |
| `p` | Add cursor to to previous match. |
| `n` | Add cursor to to next match. |
| `a` | Add cursor to to all matches in document. |
| Keys | Description |
| ---------------- | ----------------------------------------- |
| `[space][space]` | Enter occurance match mode. |
| `p` | Add cursor to to previous match. |
| `n` | Add cursor to to next match. |
| `a` | Add cursor to to all matches in document. |
## Bookmarks
Bookmarks are quick ways to jump to places in code. This requires `alefragnani.bookmarks` extension installed.
| Keys | Description |
|-|-|
| `mm` | Add bookmark to currnet line. |
| `mi` | Move to previous bookmark. |
| `mk` | Move to next bookmark. |
| Keys | Description |
| ---- | ------------------------------- |
| `mm` | Add bookmark to currnet line. |
| `mi` | Move to previous bookmark. |
| `mk` | Move to next bookmark. |
| `ml` | List bookmarks in current file. |
| `mL` | List bookmarks in all files. |
| `mL` | List bookmarks in all files. |
## Differences From Vim
@ -189,13 +184,12 @@ SimpleVim prioritizes simplicity and integration with native VSCode features ove
- SimpleVim does not support marks. If you're jumping back and forth often between two places in a file you can use VSCode's split window feature, and use `Cmd+1` and `Cmd+2` to focus them. If you just need to jump back to where you've been, you can use VSCode's `Ctrl+-`.
## Settings
The `y` (yank) operator temporarily changes the background color of the range being yanked to make it obvious what you're yanking. Otherwise you might not realize you yanked the wrong thing until you tried to put it somewhere else. You can change the background color it uses with the `simpleVim.yankHighlightBackgroundColor` setting.
```json
{
"simpleVim.yankHighlightBackgroundColor": "#F8F3AB"
"simpleVim.yankHighlightBackgroundColor": "#F8F3AB"
}
```

3177
dist/index.js vendored Normal file

File diff suppressed because it is too large Load Diff

2
index.d.ts vendored
View File

@ -1 +1 @@
declare module "string.prototype.matchall";
declare module 'string.prototype.matchall'

14474
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,93 +1,110 @@
{
"name": "vscode-helix",
"displayName": "Helix",
"description": "Helix-like key emulation for Visual Studio Code",
"version": "0.1.0",
"license": "MIT",
"publisher": "garlandcrow",
"keywords": [
"vim",
"vi",
"helix"
],
"repository": {
"type": "git",
"url": "https://github.com/garlandcrow/vscode-helix.git"
},
"engines": {
"vscode": "^1.22.2"
},
"categories": [
"Other"
],
"activationEvents": [
"*"
],
"main": "./out/extension",
"contributes": {
"keybindings": [
{
"key": "shift+5",
"command": "editor.action.jumpToBracket",
"when": "editorTextFocus && !extension.simpleVim.insertMode"
},
{
"key": "shift+j",
"command": "editor.action.joinLines",
"when": "editorTextFocus && !extension.simpleVim.insertMode"
},
{
"key": "Escape",
"command": "extension.simpleVim.escapeKey",
"when": "editorTextFocus"
},
{
"key": "ctrl+f",
"command": "extension.simpleVim.scrollDownPage",
"when": "editorTextFocus && !extension.simpleVim.insertMode"
},
{
"key": "ctrl+b",
"command": "extension.simpleVim.scrollUpPage",
"when": "editorTextFocus && !extension.simpleVim.insertMode"
}
],
"configuration": {
"type": "object",
"title": "SimpleVim Configuration",
"properties": {
"simpleVim.yankHighlightBackgroundColor": {
"type": "string",
"default": "#F8F3AB",
"description": "Background color that flashes to show the range when yanking."
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
"package": "vsce package",
"publish": "vsce publish",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"lint": "tslint -c tslint.json 'src/**/*.ts' --exclude 'src/test/*.ts'"
},
"devDependencies": {
"@types/http-errors": "^1.8.0",
"@types/node": "^12.12.58",
"string.prototype.matchall": "^4.0.2",
"tslint": "^5.10.0",
"typescript": "^4.0.2",
"vscode": "^1.1.18"
},
"dependencies": {
"vsce": "^2.11.0"
},
"__metadata": {
"id": "fb57f80d-708d-4ade-b92b-e420c6b5c04a",
"publisherDisplayName": "GarlandCrow",
"publisherId": "fe4ca483-01fb-4881-9e30-524a40026553",
"isPreReleaseVersion": false
}
"name": "vscode-helix",
"version": "0.1.0",
"displayName": "Helix",
"description": "Helix-like key emulation for Visual Studio Code",
"publisher": "garlandcrow",
"author": "Garland Crow <garlandcrow@protonmail.com>",
"license": "MIT",
"homepage": "https://github.com/garlandcrow/vscode-helix#readme",
"keywords": [
"vim",
"vi",
"helix"
],
"repository": {
"type": "git",
"url": "https://github.com/garlandcrow/vscode-helix.git"
},
"bugs": {
"url": "https://github.com/garlandcrow/vscode-helix/issues"
},
"categories": [
"Other",
"Keymaps"
],
"main": "./dist/index.js",
"icon": "res/icon.png",
"files": [
"dist"
],
"engines": {
"vscode": "^1.69.0"
},
"activationEvents": [
"onStartupFinished"
],
"contributes": {
"keybindings": [
{
"key": "shift+5",
"command": "editor.action.jumpToBracket",
"when": "editorTextFocus && !extension.simpleVim.insertMode"
},
{
"key": "shift+j",
"command": "editor.action.joinLines",
"when": "editorTextFocus && !extension.simpleVim.insertMode"
},
{
"key": "Escape",
"command": "extension.simpleVim.escapeKey",
"when": "editorTextFocus"
},
{
"key": "ctrl+f",
"command": "extension.simpleVim.scrollDownPage",
"when": "editorTextFocus && !extension.simpleVim.insertMode"
},
{
"key": "ctrl+b",
"command": "extension.simpleVim.scrollUpPage",
"when": "editorTextFocus && !extension.simpleVim.insertMode"
}
],
"configuration": {
"type": "object",
"title": "SimpleVim Configuration",
"properties": {
"simpleVim.yankHighlightBackgroundColor": {
"type": "string",
"default": "#F8F3AB",
"description": "Background color that flashes to show the range when yanking."
}
}
}
},
"scripts": {
"build": "tsup src/index.ts --external vscode",
"dev": "npm run build --watch",
"pack": "vsce package --no-dependencies",
"publish": "vsce publish --no-dependencies",
"vscode:prepublish": "npm run build",
"lint": "prettier --check --plugin-search-dir=. . && eslint .",
"format": "prettier --write --plugin-search-dir=. .",
"typecheck": "tsc --noEmit",
"release": "bumpp && nr publish"
},
"devDependencies": {
"@antfu/eslint-config": "^0.25.2",
"@types/http-errors": "^1.8.0",
"@types/node": "^16.14.2",
"@types/vscode": "^1.69.0",
"bumpp": "^8.2.1",
"eslint": "^8.21.0",
"esno": "^0.16.3",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"string.prototype.matchall": "^4.0.2",
"tsup": "^6.2.1",
"typescript": "^4.7.4",
"vsce": "^2.11.0",
"vscode": "^1.1.18"
},
"__metadata": {
"id": "fb57f80d-708d-4ade-b92b-e420c6b5c04a",
"publisherDisplayName": "GarlandCrow",
"publisherId": "fe4ca483-01fb-4881-9e30-524a40026553",
"isPreReleaseVersion": false
}
}

View File

@ -1,15 +1,14 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": ["es6", "es2020.string"],
"sourceMap": true,
"rootDir": "src",
"target": "es2017",
"module": "esnext",
"lib": ["esnext"],
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"exclude": ["node_modules", ".vscode-test"]
"strictNullChecks": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true
}
}

View File

@ -1,17 +0,0 @@
{
"defaultSeverity": "error",
"extends": ["tslint:recommended"],
"jsRules": {},
"rules": {
"quotemark": [true, "single", "avoid-escape"],
"ordered-imports": false,
"curly": false,
"object-literal-shorthand": false,
"object-literal-sort-keys": false,
"arrow-parens": false,
"no-console": false,
"interface-over-type-literal": false,
"array-type": false
},
"rulesDirectory": []
}

9
tsup.config.ts Normal file
View File

@ -0,0 +1,9 @@
import { defineConfig } from 'tsup'
export default defineConfig({
entry: ['src/index.ts'],
format: ['cjs'],
shims: false,
dts: false,
external: ['vscode'],
})