KrazyManJ / obsidian-keyshots

๐Ÿ”ฎ๐Ÿ“ Obsidian plugin that adds classic hotkey/shortcuts commands from popular IDEs like Visual Studio Code or JetBrains Family.
https://www.moritzjung.dev/obsidian-stats/plugins/keyshots/
MIT License
85 stars 2 forks source link
obsidian-hotkeys obsidian-md obsidian-plugin

Keyshots is an Obsidian plugin that adds classic hotkey/shortcuts commands from popular IDEs like Visual Studio Code or JetBrains Family.

๐ŸŒ  Visual examples

Keyshots adds actions like move line up or down...

...add caret cursor up or down...

...insert lines above or below...

...duplicate line up or down...

...duplicate text or selection...

...toggle readable line length inside editor...

...toggle line numbers inside editor...

...encode or decode URI text...

...transform selected texts to lowercase, uppercase or titlecase...

...join selected lines to one line...

...split selections on new line and trim selection...

...sort selected lines with alphanumeric comparison...

...transform selections to or from snakecase...

...and much more commands to explore! (And more are comming soon)

โŒจ๏ธ List of Keyshots commands with IDE Mappings

Here is a full list of all Keyshots commands with mappings of hotkeys that are available. If any of hotkey for IDE action is missing, Keyshots mappings hotkey is used instead (This behavior can be changed in settings).

Hotkeys Keyshots Default Mappings Visual Studio Code JetBrains IDEs Microsoft Visual Studio
Duplicate line down (Visual Studio Code) Shift + Alt + โ†“ Shift + Alt + โ†“
Duplicate line up (Visual Studio Code) Shift + Alt + โ†‘ Shift + Alt + โ†‘
Duplicate selection or line (JetBrains IDEs) Ctrl + Alt + D Ctrl + D Ctrl + D
Insert line above Ctrl + Shift + Enter Ctrl + Shift + Enter Ctrl + Alt + Enter Ctrl + Enter
Insert line below Shift + Enter Ctrl + Enter Shift + Enter Shift + Enter
Join selected lines Ctrl + Shift + J Ctrl + J Ctrl + Shift + J
Move line down Alt + โ†“ Alt + โ†“ Shift + Alt + โ†“ Alt + โ†“
Move line up Alt + โ†‘ Alt + โ†‘ Shift + Alt + โ†‘ Alt + โ†‘
Reverse selected lines Alt + R
Shuffle selected lines Ctrl + Shift + Alt + S
Sort selected lines Ctrl + Shift + S
Better insert callout Shift + Alt + C
Insert code block Ctrl + Shift + `
Insert ordinal numbering Shift + Alt + N
Insert Table Shift + Alt + T
Close all foldable callouts Shift + Alt + L
Open all foldable callouts Shift + Alt + O
Toggle all callouts fold state Shift + Alt + K
Multi-toggle bold Ctrl + Shift + B
Multi-toggle code Ctrl + Shift + C
Multi-toggle comment Ctrl + Shift + /
Multi-toggle highlight Ctrl + Shift + H
Multi-toggle italic Ctrl + Shift + I
Multi-toggle strikethrough Ctrl + Shift + M
Replace by Regular Expression (Regex) Ctrl + Alt + H
Toggle case (JetBrains) Ctrl + Shift + U Ctrl + Shift + U
Toggle selections kebabcase Alt + -
Toggle keyboard input (<kbd>) Ctrl + Shift + K
Toggle selections snakecase Shift + Alt + -
Toggle underline Alt + N
Toggle selections URI encoded/decoded string Ctrl + Alt + U
Transform selections to lowercase Alt + L Ctrl + U
Transform selections to titlecase (capitalize) Alt + C
Transform selections to uppercase Alt + U Ctrl + Shift + U
Trim selections Alt + T
Add caret cursor down Ctrl + Alt + โ†“ Ctrl + Alt + โ†“ Shift + Alt + โ†“
Add caret cursor up Ctrl + Alt + โ†‘ Ctrl + Alt + โ†‘ Shift + Alt + โ†‘
Search by Regular Expression (Regex) Ctrl + Alt + S
Select all word instances Ctrl + Shift + L Ctrl + Shift + L Ctrl + Shift + Alt + J Shift + Alt + ;
Select multiple word instances Ctrl + D Ctrl + D Alt + J Shift + Alt + .
Split selections by lines Ctrl + Alt + L
Expand line selections Alt + E Ctrl + L Ctrl + W Shift + Alt + =
Split selections on new line Alt + S
Go to next fold Ctrl + Alt + ]
Go to previous fold Ctrl + Alt + [
Go to parent fold Ctrl + Alt + P
Switch 'inline title' setting Ctrl + Alt + T
Switch 'line numbers' setting Ctrl + Alt + N
Switch 'readable line length' setting Ctrl + Alt + R
Open developer tools F12
Reopen current note Alt + Q
Toggle focus mode Ctrl + Alt + F
Change Keyshots preset Ctrl + Shift + P
Open Keyshots settings tab Ctrl + Alt + ,
Switch Keyshots case sensitivity Ctrl + Alt + I

โœŒ๏ธโŒจ๏ธ Double-Key commands

Double key commands are feature used in JetBrains IDEs, that are doing certain actions after specific key is pressed twice.

Now Keyshots has two double-key commands:

If you do not like them, then you can disable them in settings.

๐ŸŽ›๏ธ Settings

Adds ability to choose default hotkeys mappings by IDEs presets. You can also configure behavior of some commands.

You can choose from these IDEs presets:

You can change it also via modal window inside obsidian that you can open with command "Change Keyshots preset" with Ctrl + Shift + P shortcut.

โš ๏ธ Possible conflicts:

Some IDE commands have hotkey, that is already set to another Obsidian action and that results into conflict.

Here is list of all possible conflicts:

Hotkey Visual Studio Code JetBrains IDEs Microsoft Visual Studio Obsidian Action
Ctrl + L Expand line selections Toggle checkbox status
Ctrl + Enter Insert line below Insert line above Open link under cursor in new tab
Ctrl + W Expand line selections Close current tab
Ctrl + Alt + Enter Insert line above Open link under cursor to the right

My conflicts handling

For default Keyshots mappings I will take care of all conflicts with Obsidian hotkeys. However, mind that I can take care of obsidian hotkeys only meaning that plugins hotkeys are irrelevant and impossible to handle due to unlimited plugin amount.

Also, obsidian team recommends to don't set default hotkeys for commands and that is why Keyshots installs with "clear" preset!

โฐ Changelog

1.0.0 - First release of plugin


1.1.0 - New commands


1.2.0 - IDE Keymap Settings

Now, Keyshots are able to pick from one of presets that you choose and use their's default hotkeys.

Available presets:


1.3.0 - Visual Studio Mappings

In new version I added keymaps of Visual Studio. From now you can change it in plugin settings!


1.4.0 - Clear (Blank) Key Mappings

Based on a recommendation by Obsidian Team, I added preset, that is set in default, which has no default Hotkeys.


1.5.0 - 10 NEW COMMANDS!

New commands:

New features:

Improvements:


2.0.0 - Huge update | ๐ŸŒŸDouble-key commands๐ŸŒŸ

New commands:

Multi-togglers are commands that are already in Obsidian, but they provide ability to perform actions with multiple selections. For example Multi-toggle bold surrounds text like this **<text>** but with multiple selections anywhere in editor.

Double-key Commands are available

JetBrains feature to do action after certain key is pressed twice. All about double key commands is mentioned in README.

Current available commands are:

Fixes


2.0.1


2.1.0

New Commands


2.1.1


2.1.2


2.2.0

New commands

Fixes


2.3.0 - Few fixes and improvements (Latest Release)

New features

Improvements

2.4.0

New commands

Fixes