diff --git a/src/components/ModalVault.svelte b/src/components/ModalVault.svelte index 4482d86..c7b7473 100644 --- a/src/components/ModalVault.svelte +++ b/src/components/ModalVault.svelte @@ -14,6 +14,7 @@ import { createNote, openNote } from '../tools/notes' import { getCtrlKeyLabel, + getAltKeyLabel, getExtension, isFilePDF, loopIndex, @@ -44,20 +45,20 @@ let openInCurrentPaneKey: string let createInNewPaneKey: string let createInCurrentPaneKey: string - let openInNewLeafKey: string = getCtrlKeyLabel() + ' alt ↵' + let openInNewLeafKey: string = getCtrlKeyLabel() + getAltKeyLabel() + ' ↵' $: selectedNote = resultNotes[selectedIndex] $: searchQuery = searchQuery ?? previousQuery $: if (plugin.settings.openInNewPane) { openInNewPaneKey = '↵' openInCurrentPaneKey = getCtrlKeyLabel() + ' ↵' - createInNewPaneKey = 'shift ↵' - createInCurrentPaneKey = getCtrlKeyLabel() + ' shift ↵' + createInNewPaneKey = 'Shift ↵' + createInCurrentPaneKey = getCtrlKeyLabel() + ' Shift ↵' } else { openInNewPaneKey = getCtrlKeyLabel() + ' ↵' openInCurrentPaneKey = '↵' - createInNewPaneKey = getCtrlKeyLabel() + ' shift ↵' - createInCurrentPaneKey = 'shift ↵' + createInNewPaneKey = getCtrlKeyLabel() + ' Shift ↵' + createInCurrentPaneKey = 'Shift ↵' } $: if (searchQuery) { updateResultsDebounced() @@ -354,7 +355,7 @@ ↑↓to navigate
- alt ↑↓ + {getAltKeyLabel()} ↑↓ to cycle history
@@ -362,7 +363,7 @@ to open
- tab + Tab to switch to In-File Search
@@ -391,14 +392,14 @@
- alt ↵ + {getAltKeyLabel()} ↵ to insert a link
- ctrl g + Ctrl g to toggle excerpts
- escto close + Escto close
diff --git a/src/settings.ts b/src/settings.ts index 2368fdc..425adbb 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -11,7 +11,7 @@ import { import { writable } from 'svelte/store' import { K_DISABLE_OMNISEARCH } from './globals' import type OmnisearchPlugin from './main' -import { enableVerboseLogging } from './tools/utils' +import { enableVerboseLogging, getCtrlKeyLabel } from './tools/utils' import { debounce } from 'lodash-es' interface WeightingSettings { @@ -398,9 +398,7 @@ export class SettingsTab extends PluginSettingTab { // Set Vim like navigation keys new Setting(containerEl) .setName('Set Vim like navigation keys') - .setDesc( - 'Navigate down the results with Ctrl/⌘ + J/N, or navigate up with Ctrl/⌘ + K/P' - ) + .setDesc(`Navigate down the results with ${getCtrlKeyLabel()} + J/N, or navigate up with ${getCtrlKeyLabel()} + K/P.`) .addToggle(toggle => toggle .setValue(settings.vimLikeNavigationShortcut) diff --git a/src/tools/utils.ts b/src/tools/utils.ts index 9b74292..1fb49d2 100644 --- a/src/tools/utils.ts +++ b/src/tools/utils.ts @@ -145,8 +145,12 @@ export function removeDiacritics(str: string, arabic = false): string { return str } -export function getCtrlKeyLabel(): 'ctrl' | '⌘' { - return Platform.isMacOS ? '⌘' : 'ctrl' +export function getCtrlKeyLabel(): 'Ctrl' | '⌘' { + return Platform.isMacOS ? '⌘' : 'Ctrl' +} + +export function getAltKeyLabel(): 'Alt' | '⌥' { + return Platform.isMacOS ? '⌥' : 'Alt' } export function isFileImage(path: string): boolean {