Shortcut and/or button to toggle readable line length

It would be great to have it. Sometimes I need to see everything on full width and now I need to change it on the config pane.

2 Likes

exactly, a hotkey would be extremly useful!

1 Like

I’d like to bump this one up. I keep running into it and it would be great to have a hot key for this

3 Likes

Recently I faced the same problem and I was thinking about a hotkey solution to it. +1 for this. Another more general solution for this could be creating hotkeys for toggling css snippets

1 Like

If anyone is using auto hot key in windows you can write a script to toggle the readable line length setting. I’ve shared mine. The only challenge is, you’d need to use window spy to edit the numbers

; Readable line toggle for ctrl+shift+L
#IfWinActive ahk_exe Obsidian.exe
^+l::
WinGetPos, , , CurrentWinWidth
CoordMode Mouse, Screen
MouseGetPos MouseXBefore, MouseYBefore
; make the window full screen if it isn't
; do this by checking if the width matches full screen width
If (CurrentWinWidth < 2560) {
    Send {F11}
}
Sleep 100
; open settings
Send ^,
; Click on "Editor"
MouseClick, Left, 324, 309, 1
Sleep 100
; Click on the readable line length toggle
MouseClick, Left, 2186, 368, 1
; Close settings
Send {Esc}
; If the window was not full screen before escape from full screen
If (CurrentWinWidth < 2560) {
    Send {F11}
}
; Move the mouse back to where it was before
MouseMove, %MouseXBefore%, %MouseYBefore%
return
3 Likes

Are you sure that this can work for everyone? I guess the placement of buttons is affected by theme and css that one uses

This is important!

1 Like

You are correct that the placement of buttons will be affected. Which is why Window Spy is needed to figure out what numbers to insert into the mouse click locations and window size parameters

1 Like

interesting, I have never used this feature of AHK, because I though it is going be very finicky for this reason, maybe I should look into it again

+1 for this feature. I end up needing to turn on/off the reading line length multiple times per day (mostly for editing tables). Having a hotkey for this would be super helpful!!! Please prioritize, thanks! :slight_smile:

2 Likes

definitely happy to see you agree!

It would also be nice to be able to set “Readable line length” separately for preview mode and edit mode.

2 Likes

I would personally really love to see YAML metadata for this setting. There are some pages I will always want to see with readable line length off, like huge dataview tables, while generally I prefer readable line length on.

2 Likes

Also though about it, but I don’t know how to fix this with cssclass

1 Like

This is one of those features which should be relatively easy to implement but would make a huge difference in daily work → especially as a computer science student I am toggling a lot between “Readable Line Lenght” on and off when embedding code in my markdown notes.

Really wish I had this (without a plugin). It would make reading certain content way easier.

i use these plugin to toggle snippets easily:

and use this snippet to basically override readable length

.markdown-preview-view.is-readable-line-width .markdown-preview-sizer{
	max-width: 95%;
	width:100rem;
}

it is not the best solution, obviously the direct hotkey is better, but it is serviceable

1 Like

I’ve posted a work-around similar to Archie’s under this request for “readable line length” to apply only to elements other than (Dataview) tables.

I liked this ages topic ago, but it remains the main reason why I mostly edit in Sublime Text and view in Obsidian. Daft, but there you go.

Please, just give us the ability to do this. No default necessary – I use alt/option w (for width) in Sublime Text – just make it available so it can be set.

Just want to add a couple cents here. I’ve started embedding iframes in a handful of pages, and being able to view those pages full width would be nice. A hot key would be nice, but as has also been mentioned, embedded metadata to make a one-off full-width page would be ideal.

1 Like