Select line by clicking line-number in edit mode

Use case or problem

Most standard text-editors provide the standard functionality of selecting a line of text when the user clicks on a line number — to the point where this is basic expected functionality of the line numbers beyond mere representational display.

Proposed solution

In edit mode, when line numbers are displayed, the default behavior (perhaps with an option to turn this off for anyone who doesn‘t like it for some idiosyncratic reason) should be for clicking the line-number to select that entire line of text.

Current workaround (optional)

manually selecting the entire line

8 Likes

I concur!

1 Like

Ideally, clicking on one line-number to select the contents of that line and then SHIFT-clicking a line-number below that should also select the contents of the first line clicked and the second line clicked as well as all lines in between.

1 Like

I was just notified that selecting an entire line including the line break using a 4-click (3-click selects without the line break and thus leaves behind an empty line when removing/cutting). Might at least be a quicker workaround.

2 Likes

+1 on this!

++ here.

This is especially needed when using tablets and stylus input.

Did Someone find a workaround?

Edit: I’m on Android and I’m looking to “Select line by clicking line-number in edit mode”. Triple tap or +3 taps are not reliable when there’s formatting like italics or links etc in the line.

Workaround for which use case?

To copy or cut, you don’t need to select the line. Just place the cursor in the line (without making a selection), and press Ctrl + C or Ctrl + X. That copies/cuts the line (technically a “paragraph”, since it’s markdown).

To move the line, same thing: place the cursor in the line and run the Move line up or Move line down command, or assign those to keyboard shortcuts.

To type over or delete, put the cursor in the line and press Ctrl + D, which is the default keyboard shortcut for the Delete paragraph command.

For other uses, if you say what, maybe someone can offer a workaround.


Sorry MacOS users: imagine I also typed Cmd up in those keys.

I’m on Android and I’m looking to “Select line by clicking line-number in edit mode”. Triple tap or +3 taps are not reliable when there’s formatting like italics or links etc in the line.

I’m using the command from a plugin: Code Editor Shortcuts: Select line, but I have to search for it as can’t fit it in my visible commands. Maybe the Toolbar that pops up when selecting text · chrisgurney/obsidian-note-toolbar · Discussion #120 · GitHub can make the selection easier but would prefer from the line number to optimize space.

To be clear for anyone who wants to offer a workaround: What do you want to do after selecting it? (The use for the feature, not just the action of selecting.)

If you’re just wanting to get the text into the clipboard to transfer to another app, yep, a “select paragraph” feature would be great. Dragging the selection handle on Android goes smoothly for me most of the time but not always.

But if it’s to move the text to other notes: core Note Composer has a toolbar button and command do to it by heading section without having to select the text. Depending on what you’re doing, that might work.

And the toolbar buttons and commands to delete paragraph (line), move line up, and move line down all work on mobile without needing to select the text.

I agree, and indeed that is what I was using in the meantime, now in v1.10.3 I noticed that 3 taps is more reliable so I prefer that for selection of specific lines.