No description
Find a file
2023-05-20 17:53:08 +10:00
.github Add sponsor button 2022-04-05 23:29:08 +10:00
.husky Fix precommit hook for formatting 2021-11-30 21:02:33 +11:00
.yarn/releases Upgrade to Yarn Berry 2022-04-22 21:07:29 +10:00
src Migrate delete line to CM6 2023-05-20 17:53:08 +10:00
.eslintrc.json Add ESLint to pre-commit hook 2022-01-09 00:05:24 +11:00
.gitignore Upgrade to Yarn Berry 2022-04-22 21:07:29 +10:00
.nvmrc Upgrade to Yarn Berry 2022-04-22 21:07:29 +10:00
.prettierrc Add Prettier config 2021-09-25 17:31:15 +10:00
.yarnrc.yml Upgrade to Yarn Berry 2022-04-22 21:07:29 +10:00
babel.config.js Set up Jest for testing 2022-01-03 15:41:48 +11:00
jest.config.js Add tests for utils 2022-01-03 15:41:48 +11:00
LICENSE Add LICENSE 2021-09-26 22:16:18 +10:00
manifest.json v1.13.1 2023-04-12 16:52:35 +10:00
package.json Update test harness for CM6 2023-04-12 16:53:02 +10:00
README.md Fix multiple cursors link in README (#56) 2023-02-04 14:11:54 +11:00
styles.css Remove sample CSS 2021-09-26 22:16:18 +10:00
tsconfig.json Set up Jest for testing 2022-01-03 15:41:48 +11:00
versions.json v1.13.1 2023-04-12 16:52:35 +10:00
yarn.lock Update test harness for CM6 2023-04-12 16:53:02 +10:00

Code Editor Shortcuts

This Obsidian plugin adds keyboard shortcuts (hotkeys) commonly found in code editors such as Visual Studio Code or Sublime Text.

Command Shortcut *
Insert line below Ctrl + Enter
Insert line above Ctrl + Shift + Enter
Delete line Ctrl + Shift + K
Duplicate line Ctrl + Shift + D
Copy line up Alt + Shift + Up
Copy line down Alt + Shift + Down
Join line below to current line Ctrl + J
Select line (repeat to keep expanding selection) Ctrl + L
Add cursors to selection ends Alt + Shift + I
Select word or next occurrence of selection Ctrl + D
Select all occurrences of selection Ctrl + Shift + L
Move cursor up Not set
Move cursor down Not set
Move cursor left Not set
Move cursor right Not set
Go to previous word Not set
Go to next word Not set
Go to start of line Not set
Go to end of line Not set
Go to previous line Not set
Go to next line Not set
Go to first line Not set
Go to last line Not set
Go to line number Not set
Delete to start of line Not set
Delete to end of line Not set
Transform selection to uppercase Not set
Transform selection to lowercase Not set
Transform selection to title case Not set
Toggle case of selection Not set
Expand selection to brackets Not set
Expand selection to quotes Not set
Expand selection to quotes or brackets Not set
Insert cursor above Not set
Insert cursor below Not set
Go to next heading Not set
Go to previous heading Not set
Toggle line numbers Not set
Indent using tabs Not set
Indent using spaces Not set

* On macOS, replace Ctrl with Cmd and Alt with Opt

Important notes

  • Ctrl + Enter for 'Insert line below' may conflict with the default shortcut for Open link under cursor in new tab; changing/removing one of the bindings is recommended.
  • Ctrl + L for 'Select line' may conflict with the default shortcut for Toggle checkbox status; changing/removing one of the bindings is recommended.
  • Ctrl + D for 'Select word or next occurrence of selection' will behave differently depending on how the initial selection was made. If it was also done via Ctrl + D, the command will only look for the entire word in subsequent matches. However, if the selection was done by hand, it will search within words as well.
  • 'Toggle case of selection' will cycle between uppercase, lowercase and title case.
  • If you are looking for the Alt + Up and Alt + Down shortcuts from VS Code, you can assign those hotkeys to Obsidian's built in actions "Move line up" and "Move line down".

Multiple Cursors

These shortcuts also work with multiple cursors, with the exception of:

  • Expand selection to quotes or brackets
  • Go to next/previous heading

However, if you're using Live Preview, undo and redo will not work intuitively actions will be handled individually for each cursor, rather than grouped together. If this becomes an issue for you, you can switch back to the legacy editor in Settings as a workaround as actions will be grouped in that case.

Installing the plugin

Refer to the official installation instructions for third-party plugins here.

Configuring settings

Go to Settings → Hotkeys to customise the keyboard shortcut for each action.

The following behaviour can be configured via the settings tab for this plugin:

Setting Description
Auto insert list prefix Automatically insert list prefix when inserting a line above or below

Contributing

Contributions and suggestions are welcome feel free to open an issue or raise a pull request.

To get started:

  • Switch to the specified Node version: nvm use
  • Install dependencies: yarn install
  • Run the extension: yarn start
  • Run tests: yarn test (use --watch for watch mode)

Support

This plugin is completely free to use, but if you'd like to say thanks, consider buying me a coffee! 😄

ko-fi