obsidian-keyshots
obsidian-keyshots copied to clipboard
๐ฎ๐ Obsidian plugin that adds classic hotkey/shortcuts commands from popular IDEs like Visual Studio Code or JetBrains Family.
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 + F | |||
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 | |||
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 | |||
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:
-
Ctrl - Pressing and holding last key and then press โ or โ will
add caret cursor just like
Add caret cursor up
orAdd caret cursor down
do -
Shift - If you have internal plugin
Quick Switcher
enabled, then this shortcut will open quick switcher window just like Ctrl + O does
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:
- Clear (everything blank; set in default when keyshots are installed)
- Visual Studio Code
- JetBrains IDEs Family (IntelliJ IDEA, PyCharm, WebStorm, ... )
- Microsoft Visual Studio
- Keyshots default hotkeys mappings
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
-
Transform selections to Uppercase
-
Transform selections to Lowercase
-
Transform selections to Titlecase
-
Sort selected lines by alphanumeric comparison
-
Encode / Decode URI selections
-
Toggle line numbers
-
Join selected lines
-
Split selections on new line
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:
- Visual Studio Code
- Jetbrains IDEs (IntelliJ IDEA, PyCharm, WebStorm, ...)
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:
-
Open Keyshots settings
-
Select all word instances
-
Select multiple word instances
-
Shuffle selected lines
(with shuffle rounds option) -
Toggle Keyshots case sensitivity
-
Toggle case (JetBrains)
-
Transform selections from / to Kebabcase
-
Toggle inline title (setting)
-
Split selections by lines
-
Expand line selections
New features:
- Toggle case sensitivity in settings - toggles case sensitivity for
Select multiple word instances
andSelect all word instances
commands - Use keyshots hotkeys combined with selected IDE - whenever you select any IDE preset, then keyshots merge it's mapping with IDE mapping, if you don't want this to happen, you can just disable it!
Improvements:
- Now commands will not "glitch" text when performing undo/redo action on them
- Now all presets have full mappings for all actions (if specific IDE has it defaultly) - i have full map in README!
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.
-
Change Keyshots preset
- changing keys preset in editor -
Multi-toggle bold
-
Multi-toggle italic
-
Multi-toggle code
-
Multi-toggle highlight
-
Multi-toggle comment
-
Multi-toggle strikethrough
-
Toggle underline
- underline selected texts -
Toggle keyboard input (<kbd>)
- surrounds text with keyboard-input tags -
Insert code block
- inserts code blocks in selections with ability to choose language/code block processing -
Insert ordinal numbering
- inserts numbers on each selections (1,2,3,4,...) -
Open developer tools
- opens developer tools (great for developers of plugins)
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:
-
Open Quick Switcher
(double Shift key press) -
Add caret cursor
(double Ctrl/โ key press and hold last, then press โ or โ to add caret cursors upwards or downwards)
Fixes
- Updated hotkeys for rest of all commands
- Fixed select word regex to select word correctly
- Fixed selection processing to correctly handle selection replacing on same lines
- Updated commands names to be more clearer and shorter
2.0.1
- Fixed events unregistering for DoubleKeyRegistry when user changed preset
2.1.0
New Commands
-
Better insert callout
(displays available callouts to use) -
Insert Table
-
Search by Regular Expression (Regex)
-
Replace by Regular Expression (Regex)
-
Toggle all callouts fold state
-
Open all foldable callouts
-
Close all foldable callouts
2.1.1
- Double key commands won't cancel when interrupted with key while pressing command key #4
- Replace regex modal bad parsing of escape characters
2.1.2
- Fixed Double key registry previous fix to work 100%
- Added react support to my code
2.2.0
New commands
-
Toggle focus mode
- hides ribbon menu, sidebars, and toggle app fullscreen -
Go to next fold
- -
Go to previous fold
- -
Go to parent fold
- - Double key
Open Command-Palette
command via double Ctrl shortcut.
Fixes
- Made double key quick switcher shortcut to be triggered on second release rather than on second press
- Double key registry registers command on release only if command released in desired timestamp
2.3.0 - Few fixes and improvements (Latest Release)
New features
- Ability to add custom callouts for
Better insert callout
command (#8) - Double shift now improved to be able to select community switch engines, supported plugins are (#7):
- Quick switcher (Core plugin)
- Omnisearch
- Quick Switcher++
Improvements
- Fixed behavior of
Go to next/previous fold
commands (#5)