logseq / logseq

A privacy-first, open-source platform for knowledge management and collaboration. Download link: http://github.com/logseq/logseq/releases. roadmap: http://trello.com/b/8txSM12G/roadmap
https://logseq.com
GNU Affero General Public License v3.0
32.83k stars 1.92k forks source link

Adding keyboard shortcut for inline `code` formatting #10494

Open udkl opened 12 months ago

udkl commented 12 months ago

Search first

What Happened?

I'm opening this issue to discuss my proposal to add a shortcut in logseq core that will mark highlighted inline text as code.

Questions to discuss

  1. Is this better as a plugin ? https://discuss.logseq.com/t/more-options-for-text-formatting-bold-strikethrough-underline-etc/14848/
  2. What should the shortcut be ?

Comments will help gauge willingness of the core team to accept a PR to add this feature to logseq. Issue filed in the forum as a Feature Request : https://discuss.logseq.com/t/more-options-for-text-formatting-bold-strikethrough-underline-etc/14848/3

Reproduce the Bug

N/A

Expected Behavior

No response

Screenshots

No response

Desktop or Mobile Platform Information

No response

Additional Context

No response

Are you willing to submit a PR? If you know how to fix the bug.

flo-schu commented 8 months ago

I'd appreciate this very much. In Github this is implemented with ctrl+e, and I personally find myself very often in need of this shortcut.

ssimmen commented 2 weeks ago

Another vote for this feature!

flo-schu commented 5 days ago

My workaround for this is to use the text wrapper plugin (https://github.com/sethyuan/logseq-plugin-wrap), and add a keyboard binding mod+e in the corresponding settings binding under group_semantic

"wrap-code": {
  "label": "Inline code",
  "binding": "mod+e",
  "template": "`$^`",
  "icon": "<svg xmlns=\"http://www.w3.org/2000/svg\"><text stroke=\"#000\" stroke-width=\"0\" x=\"6\" y=\"22\" font-size=\"24\" font-family=\"Noto Sans JP\" xml:space=\"preserve\" fill=\"#eee\">`</text></svg>"
},

It works not as satisfying as the use in github, but it's a start.