charmbracelet / glow

Render markdown on the CLI, with pizzazz! πŸ’…πŸ»
MIT License
16k stars 349 forks source link

open editor in current line #642

Open electriquo opened 1 month ago

electriquo commented 1 month ago

Is your feature request related to a problem? Please describe. following https://github.com/charmbracelet/glow/commit/597e56bad4599857dde4c36174ce7a5ec371b7cc, it is expected that:

  1. pressing the ? to list the hotkeys will include e, but it does not.
  2. pressing e will work when opening a single file and not the entire directory. e.g. when using glow README.md, pressing e does not open the editor but rather scrolls down the view.
  3. a configuration to support for specifying the editor and its argument, e.g. code --wait, in the configuration file, rather then always use the shell default editor.
  4. the commit title states feat: open editor in current line, but what is the current line when viewing a markdown in glow?

Describe the solution you'd like A clear and concise description of what you want to happen.

  1. add e to ? hotkey listing.
  2. pressing e should open the editor and not scroll down the markdown view.
  3. add support for specifying editor in the configuration file.
  4. add ability to highlight or have any other indication what is the current line.

Describe alternatives you've considered

  1. invoking glow after setting the EDITOR, e.g. EDITOR="code --wait" glow
  2. invoke glow --line-numbers without specifying any markdown file to show line numbers when viewing a markdown file, then pressing e to see the correlation between the view with line numbers to the current line on the editor. though, there was no noticeable correlation.

Additional context Add any other context or screenshots about the feature request here.

  1. e is not in hotkey listing

       enter    open      /  find    r  refresh
       j/k ↑/↓  choose               q  quit
       h/l ←/β†’  page                 ?  close help