Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Feature request) Keybind to make the current paragraph a header #4129

Closed
FalcoGer opened this issue Jul 27, 2023 · 9 comments
Closed

(Feature request) Keybind to make the current paragraph a header #4129

FalcoGer opened this issue Jul 27, 2023 · 9 comments

Comments

@FalcoGer
Copy link

FalcoGer commented Jul 27, 2023

Describe feature

A few key bindings that, when used, turn the current line to a heading.

Some sane defaults could for example be Ctrl + 1 .. 6

1 being paragraph, 2 being header 2, etc.

Why is this important?

I find myself often writing manuals or steps to reproduce something (like an installation + configuration) for myself. I very often structure my notes using different headers because not only does that make it more readable, it also creates that really nice index on the side.

The current solution is very slow and inconvenient to use, because you have to grab your mouse and click the little paragraph symbol, click the drop down and then select what you want.

image

This is especially annoying with a touchpad as mouse operations typically take longer there.

When typing, you typically don't want to take your hands off the keyboard. A keybinding for this very common task would speed the process up immensely and increase the ergonomics of the software.

@meichthys
Copy link
Collaborator

meichthys commented Jul 27, 2023

Just type ## at the beginning of the line to add an H2 header, ### for H3, etc.

@FalcoGer
Copy link
Author

I guess that works. Just didn't know that was a thing. Thank you. Maybe instead make it more obvious somehow? Perhaps include the ## in the drop down menu in front of Header 2, etc?

@meichthys
Copy link
Collaborator

meichthys commented Jul 27, 2023

You can also change the Header format in the Trilium options to use the "Markdown" style, then it would show the hashes in front of the header - this woud be a visual reminder that you can use the hashes.

Also, another little-known shortcut: alt-f10 will toggle the format menu. You can then use the arrow keys and enter to select an option. Hitting alt-f10 again will toggle the paragraph menu. So a quick keyboard workflow could be: alt-f10 + alt-f10 + down-arrow + down-arrow + enter

(Bad Mouse, Good Keyboard 🤪)

@FalcoGer
Copy link
Author

FalcoGer commented Jul 27, 2023

You can also change the Header format in the Trilium options to use the "Markdown" style, then it would show the hashes in front of the header - this woud be a visual reminder that you can use the hashes.

Yes, but then the notes look ugly.

little-known shortcut

I don't think little known features should be a thing, hence my suggestion to include the #s in the drop down menu.
Alt-F10 for me is an OS shortcut to maximize and restore the window. I couldn't find a shortcut in the shortcut options that opens the format menu.

alt-f10 + alt-f10 + down-arrow + down-arrow + enter

I still think Ctrl2 is better, and that being a shortcut in the shotcuts screen would make it self documenting, unlike AltF10

@meichthys
Copy link
Collaborator

I still think Ctrl2 is better, and that being a shortcut in the shotcuts screen would make it self documenting, unlike AltF10

I could get on board with that, but it would pose some issues for the web version of Trilium where ctrl-# is already taken by many browsers for shortcuts to pinned tabs. For example ctrl-1 in Firefox activates the first pinned tab.

@FalcoGer FalcoGer reopened this Jul 27, 2023
@meichthys
Copy link
Collaborator

These features would likely need to be implemented upstream in the CKEditor before they could be implemented in Trilium.
https://github.com/ckeditor/ckeditor5/issues

@Nriver
Copy link
Contributor

Nriver commented Jul 28, 2023

Type ## and a space at the beginning of a line, it will become heading 2. Three # will make it heading 3.

You can try this theme https://github.com/SiriusXT/trilium-theme-blue. Every level of heading has a different colour which make it very distinguishable.
heading

@zadam
Copy link
Owner

zadam commented Jul 30, 2023

I don't think little known features should be a thing, hence my suggestion to include the #s in the drop down menu.

These are actually markdown-like shortcuts, see documentation here: https://ckeditor.com/docs/ckeditor5/latest/features/autoformat.html

These features come from upstream CKEditor for the most part. Changing them would mean forking CKEditor which is something I generally want to avoid.

@meichthys
Copy link
Collaborator

Trilium has entered maintenance mode. Future enhancements will be addressed in TrilumNext: TriliumNext/Notes#100

@meichthys meichthys closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants