typora_plugin icon indicating copy to clipboard operation
typora_plugin copied to clipboard

add completeWithLLM

Open freezed-corpse-143 opened this issue 10 months ago • 4 comments

I add a custom plugin, named completeWIthLLM. I add the completeWithLLM.js in plugin/custom/plugins and add configuration in plugin/global/settings/custom_plugin.user.toml.

freezed-corpse-143 avatar Feb 17 '25 13:02 freezed-corpse-143

@freezed-corpse-143

Hi, thanks for your PR!

It's getting late, I'll look into how different software handles LLM autocompletion tomorrow or the day after. I want to see which interaction style is the most user-friendly.

obgnail avatar Feb 17 '25 16:02 obgnail

@obgnail,I want to add a hotkey for getting the cursor to the end of line. Would you have some ideas?

freezed-corpse-143 avatar Feb 28 '25 13:02 freezed-corpse-143

@freezed-corpse-143

My apologies. I find the implementation of submitting a token after text selection a little strange. But I haven't had a chance to research the interaction design of other product Copilots these past few days.

However, I can answer your current question.

const hotkey = "ctrl+shift+j"
const jumpToLineEnd = () => File.editor.selection.jumpToLineEnd()

this.utils.hotkeyHub.registerSingle(hotkey, jumpToLineEnd)

Try entering the following code in the devtools console. After that, you should be able to test the 'ctrl+shift+j' shortcut in the main content area.

__plugin_utils__.hotkeyHub.registerSingle("ctrl+shift+j", () => File.editor.selection.jumpToLineEnd())

obgnail avatar Feb 28 '25 13:02 obgnail

Thank you!

freezed-corpse-143 avatar Mar 01 '25 11:03 freezed-corpse-143