MCPcopy Index your code
hub / github.com/KrazyManJ/obsidian-keyshots

github.com/KrazyManJ/obsidian-keyshots @2.8.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 2.8.2 ↗ · + Follow
240 symbols 663 edges 97 files 3 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Obsidian Plugin Downloads Release date GitHub Release Date License Build Status

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 up (Visual Studio Code) Shift + Alt + Shift + Alt +
Duplicate line down (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 selected lines down Alt + Alt + Shift + Alt + Alt +
Move selected lines up Alt + Alt + Shift + Alt + Alt +
Reverse selected lines Alt + R
Shuffle selected lines Ctrl + Shift + Alt + S
Sort selected lines Ctrl + Shift + S
Indent Alt + ]
Unindent Alt + [
Better insert callout Shift + Alt + C
Insert code block Ctrl + Shift + `
Insert ordinal numbering Shift + Alt + N
Insert Table Shift + Alt + T
Change Keyshots preset Ctrl + Shift + P
Open Keyshots settings tab Ctrl + Alt + ,
Switch Keyshots case sensitivity Ctrl + Alt + I
Switch 'inline title' setting Ctrl + Alt + T
Switch 'line numbers' setting Ctrl + Alt + N
Switch 'readable line length' setting Ctrl + Alt + R
Reopen current note Alt + Q
Open developer tools F12
Toggle focus mode Ctrl + Alt + F
Duplicate tab Ctrl + Alt + D
Close all foldable callouts Shift + Alt + L
Open all foldable callouts Shift + Alt + O
Toggle all callouts fold state Shift + Alt + K
Toggle case (JetBrains) Ctrl + Shift + U Ctrl + Shift + U
Transform selections to lowercase Alt + U Ctrl + Shift + U
Replace by Regular Expression (Regex) Ctrl + Alt + H
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 titlecase (capitalize) Alt + C
Trim selections Alt + T
Add caret cursor down Ctrl + Alt + Ctrl + Alt + Shift + Alt +
Add caret cursor up Ctrl + Alt + Ctrl + Alt + Shift + Alt +
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 + .
Search by Regular Expression (Regex) Ctrl + Alt + S
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

✌️⌨️ 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:

  • Pressing and holding last key and then press or will add caret cursor just like Add caret cursor up or Add caret cursor down do
  • 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!

Extension points exported contracts — how you extend this code

WebContents (Interface)
(no doc)
src/types/electron.d.ts
EnhancedSetting (Interface)
(no doc)
src/components/settings-tab.ts
KeyRecord (Interface)
(no doc)
src/classes/DoubleKeyRegistry.ts
DoubleKeyCommand (Interface)
(no doc)
src/model/DoubleKeyCommand.ts
MockEditorOptions (Interface)
(no doc)
tests/mocks/editor.ts
Window (Interface)
(no doc)
src/types/electron.d.ts
TableData (Interface)
(no doc)
src/components/table-modal.tsx
PrismLanguage (Interface)
(no doc)
src/model/PrismLanguage.ts

Core symbols most depended-on inside this repo

HotKey
called by 89
src/utils.ts
getText
called by 34
src/classes/EditorSelectionManipulator.ts
clone
called by 27
src/classes/EditorPositionManipulator.ts
isCaret
called by 21
src/classes/EditorSelectionManipulator.ts
saveSettings
called by 16
src/plugin.ts
expand
called by 15
src/classes/EditorSelectionManipulator.ts
enhanceSetting
called by 13
src/components/settings-tab.ts
joinLinesMarkdownAware
called by 13
src/commands/join-selected-lines.ts

Shape

Method 111
Function 71
Class 28
Interface 28
Enum 2

Languages

TypeScript100%

Modules by API surface

src/classes/EditorSelectionManipulator.ts27 symbols
src/types/obsidian.d.ts20 symbols
src/classes/EditorPositionManipulator.ts16 symbols
src/classes/DoubleKeyRegistry.ts15 symbols
src/plugin.ts13 symbols
src/components/settings-tab.ts10 symbols
src/components/abstract/regex-modal.ts10 symbols
src/components/table-modal.tsx9 symbols
src/classes/SelectionsProcessing.ts9 symbols
src/types/electron.d.ts8 symbols
src/components/regex/regex-replace-modal.ts8 symbols
src/components/ide-preset-modal.tsx7 symbols

For agents

$ claude mcp add obsidian-keyshots \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact