I have worked on software my whole adult life. Sometimes I feel disoriented when I cannot see line numbers on the left of a long file. Sometimes I write really long notes in Obsidian. I love Obsidian.
Yes, there is a scroll bar which indicates position in the document; however, while jumping around my notes, I often yearn for a quick read on the file size, and invariably end up looking left for line numbers.
Yes, I can enable line numbers everywhere all the time via the option in Editor settings. But part of the beauty of Obsidian is itās clean content presentation. I donāt want to see line numbers most of the time; yet, sometimes, Iām lost without them, albeit momentarily.
Proposed solution
Obsidian has a global setting *Options > Editor > Display > Show line numbers". I propose that this option can be toggled via the Command Palette, whereby users can reach it quickly and potentially even assign it a hotkey should they see fit.
I personally have found myself searching the Command Palette for this option numerous times as a new user, as it seems like a natural fit. I can understand not wanting to crowd the Command Palette with every option under the sun. Perhaps a settings for āexpose all settings in Command Paletteā could work here, but I digress. I just think toggling line numbers should be a first class command.
Current workaround (optional)
Command+, for settings, Control+/ to activate Shortcat, type āeditorā and Return, Control+/ for Shortcat again, look for key combination of radio input for line numbers, enter key combination and press Return, press Escape to exit settings.
You can specify vault parameter i.e. advanced-uri?vault=myVault&ā¦ if you want to target specific vaults. Without vault parameter advanced uri targets your last used vault.
The cool thing about Raycast is that you donāt necessarily want to use keyboard shortcuts for every actionājust use āSpace and then search your action.
Thanks @blue_emperor! This was definitely an improvement on my Mac. And I already had Raycast installed :).
I ended up finding a cross platform solution including optional hotkeys. I have a custom CSS snippet and snippet-commands-obsidian installed, which exposes commands to toggle CSS snippets via the Command Palette.
Any CSS snippets loaded from .obsidian/snippets are now available by name as toggle commands in the Command Palette. In this case, a new command Snippet Commands: Toggle hide-line-numbers is available.
No additional plugin config needed
Optional: Map a hotkey for the new command in Settings > Hotkeys
Restart Obsidian. This would remove any modifications made in DevTools debugger while testing the CSS snippet if it were to be forgotten and confuse a silly programmer such as myself.
Itās working well on macOS and iOS so far between restarts and device syncs.
<aside>I wish Obsidian would implement a built in way to change settings via a command palette like interface. Maybe as a separate picker interface or by enabling an option as it might cause new users to get stuck accidentally triggering settings updates. Iām kinda paranoid about running so many community plugins if I were to really adopt obsidian as my full pkm/second brain/GTD datastore. Thatās not to say anything against all the wonderful community contributors though. Much love. </aside>