Skip to content

Commit

Permalink
feat: add some addition shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
tjx666 committed Aug 28, 2024
1 parent e47dbc8 commit 5eafe8d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 39 deletions.
51 changes: 14 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,38 @@
# vscode extension boilerplate
# VSCode Keybindings for Cursor

<div align="center">

[![Version](https://img.shields.io/visual-studio-marketplace/v/YuTengjing.awesome-vscode-extension-boilerplate)](https://marketplace.visualstudio.com/items/YuTengjing.awesome-vscode-extension-boilerplate/changelog) [![Installs](https://img.shields.io/visual-studio-marketplace/i/YuTengjing.awesome-vscode-extension-boilerplate)](https://marketplace.visualstudio.com/items?itemName=YuTengjing.awesome-vscode-extension-boilerplate) [![Downloads](https://img.shields.io/visual-studio-marketplace/d/YuTengjing.awesome-vscode-extension-boilerplate)](https://marketplace.visualstudio.com/items?itemName=YuTengjing.awesome-vscode-extension-boilerplate) [![Rating Star](https://img.shields.io/visual-studio-marketplace/stars/YuTengjing.awesome-vscode-extension-boilerplate)](https://marketplace.visualstudio.com/items?itemName=YuTengjing.awesome-vscode-extension-boilerplate&ssr=false#review-details) [![Last Updated](https://img.shields.io/visual-studio-marketplace/last-updated/YuTengjing.awesome-vscode-extension-boilerplate)](https://github.com/tjx666/awesome-vscode-extension-boilerplate)
[![Version](https://img.shields.io/visual-studio-marketplace/v/YuTengjing.vscode-classic-experience)](https://marketplace.visualstudio.com/items/YuTengjing.vscode-classic-experience/changelog) [![Installs](https://img.shields.io/visual-studio-marketplace/i/YuTengjing.vscode-classic-experience)](https://marketplace.visualstudio.com/items?itemName=YuTengjing.vscode-classic-experience) [![Downloads](https://img.shields.io/visual-studio-marketplace/d/YuTengjing.vscode-classic-experience)](https://marketplace.visualstudio.com/items?itemName=YuTengjing.vscode-classic-experience) [![Rating Star](https://img.shields.io/visual-studio-marketplace/stars/YuTengjing.vscode-classic-experience)](https://marketplace.visualstudio.com/items?itemName=YuTengjing.vscode-classic-experience&ssr=false#review-details) [![Last Updated](https://img.shields.io/visual-studio-marketplace/last-updated/YuTengjing.vscode-classic-experience)](https://github.com/tjx666/vscode-classic-experience)

![CI](https://github.com/tjx666/awesome-vscode-extension-boilerplate/actions/workflows/ci.yml/badge.svg) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com) [![Github Open Issues](https://img.shields.io/github/issues/tjx666/awesome-vscode-extension-boilerplate)](https://github.com/tjx666/awesome-vscode-extension-boilerplate/issues) [![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg?style=flat-square)](https://github.com/996icu/996.ICU/blob/master/LICENSE)
![CI](https://github.com/tjx666/vscode-classic-experience/actions/workflows/ci.yml/badge.svg) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com) [![Github Open Issues](https://img.shields.io/github/issues/tjx666/vscode-classic-experience)](https://github.com/tjx666/vscode-classic-experience/issues) [![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg?style=flat-square)](https://github.com/996icu/996.ICU/blob/master/LICENSE)

</div>

## Features

- github actions support publish extension to both vs marketplace and open vsx
- auto generate changelog and publish github release, make sure you enabled the write permission of github actions
- pnpm/eslint/prettier/ling-staged/simple-git-hooks/stale-dep
- use esbuild to bundle extension
Restore all original VSCode keybindings with a single installation. This extension brings back the familiar keyboard shortcuts you know and love, enhancing your coding experience without any additional configuration.

## Setup
some additional shortcuts:

After fork this repository and clone it to local, run:
- `cmd+e`: cursor edit
- `cmd+]`: cursor new chat

```bash
cd <your-extension-directory>
npx setup-boilerplate
```

You can also just skip this step and adjust the boilerplate by yourself.

## Development

Install dependencies by:

```shell
pnpm install
```

Then run and debug extension like in [official documentation](https://code.visualstudio.com/api/get-started/your-first-extension)

## Publish

You need set two github actions secrets:

- VS_MARKETPLACE_TOKEN: [Visual Studio Marketplace token](https://learn.microsoft.com/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate)
- OPEN_VSX_TOKEN: [Open VSX Registry token](https://github.com/eclipse/openvsx/wiki/Publishing-Extensions#3-create-an-access-token)
## Recommended settings

```shell
pnpm release
```jsonc
{
// this bring back the original vscode activity bar and side bar layout
"workbench.activityBar.orientation": "vertical",
}
```

## My extensions

- [Open in External App](https://github.com/tjx666/open-in-external-app)
- [Package Manager Enhancer](https://github.com/tjx666/package-manager-enhancer)
- [VSCode archive](https://github.com/tjx666/vscode-archive)
- [Neo File Utils](https://github.com/tjx666/vscode-neo-file-utils)
- [VSCode FE Helper](https://github.com/tjx666/vscode-fe-helper)
- [Modify File Warning](https://github.com/tjx666/modify-file-warning)
- [Power Edit](https://github.com/tjx666/power-edit)
- [Adobe Extension Development Tools](https://github.com/tjx666/vscode-adobe-extension-devtools)
- [Scripting Listener](https://github.com/tjx666/scripting-listener)

Check all here: [publishers/YuTengjing](https://marketplace.visualstudio.com/publishers/YuTengjing)
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vscode-classic-experience",
"displayName": "Vscode Classic Experience",
"displayName": "VSCode Keybindings for Cursor",
"version": "0.0.29",
"description": "Restore familiar VSCode keybindings in Cursor editor. Smooth transition for VSCode users.",
"publisher": "YuTengjing",
Expand Down Expand Up @@ -1915,6 +1915,15 @@
{
"key": "shift+cmd+l",
"command": "-aichat.insertselectionintochat"
},
{
"key": "cmd+e",
"command": "aipopup.action.modal.generate",
"when": "editorFocus && !composerBarIsVisible && !composerControlPanelIsVisible"
},
{
"key": "cmd+]",
"command": "aichat.newchataction"
}
]
},
Expand Down
15 changes: 14 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,24 @@ export async function generateKeybindings(extensionPath: string) {
},
];

const additionalShortcuts = [
{
key: 'cmd+e',
command: 'aipopup.action.modal.generate',
when: 'editorFocus && !composerBarIsVisible && !composerControlPanelIsVisible',
},
{
key: 'cmd+]',
command: 'aichat.newchataction',
},
];

const resultShortcuts = [
...removedCmdRShortcuts,
...removedCmdKKeybindings,
...cmdKKeybindings,
...shortcutsToRemoved,
...additionalShortcuts,
];

const extensionPackageJsonPath = path.resolve(extensionPath, 'package.json');
Expand All @@ -80,7 +93,7 @@ export async function generateKeybindings(extensionPath: string) {
export function activate(_context: vscode.ExtensionContext) {
console.log('Congratulations, your extension "vscode-classic-experience" is now active!');

// generateKeybindings(context.extensionPath);
generateKeybindings(_context.extensionPath);
}

export function deactivate() {}

0 comments on commit 5eafe8d

Please sign in to comment.