Klojer / obsidian-emacs-text-editor

GNU General Public License v3.0
21 stars 4 forks source link

Added another behavior of beginning-of-line #10

Open shichishima opened 1 month ago

shichishima commented 1 month ago

An action "beginning-of-line" is just set cursor position to ch: 0 , But sometime I want to move cursor to head of text, considering indentation, lists, task lists, and so on.

This PR provides another behavior of beginning-of-line, similer to press HOME key.

When pipe character "|" is cursor:

     some indented text|
(exec command beginning-of-line-as-homekey)
    |some indented text
(exec again)
|    some indented text

    - some list item|
    - |some list item
|   - some list item

    - [ ] some task list item|
    - [ ] |some task list item
|   - [ ] some task list item

    1. some numbered list item|
    1. |some numbered list item
|   1. some numbered list item

## some heading text|
## |some heading text
|## some heading text

How do you feel about this added feature? or shuld I split another plugin?

Klojer commented 1 month ago

Hi, thank you for interesting and well-formed PR.

This functionality can be neat in many cases, but, I think, it should be a separate plugin:

How do you think?