wustho / epr

CLI Epub Reader
MIT License
1.2k stars 49 forks source link

Feature requests: keyboard shortcuts, search #5

Closed dsanson closed 5 years ago

dsanson commented 5 years ago

Love this! Some suggestions:

  1. The space-bar should also be a default shortcut for PAGE_DOWN, like it is in more and less.
  2. The vim-like shortcuts for paging up and down should include Ctrl-U for PAGE_UP and Ctrl-D for PAGE_DOWN.
  3. At the end of a chapter, PAGE_DOWN should take me to the next chapter, just like turning a page in a book.
  4. Search would be great! Again, more and less offer a good model for keyboard shortcuts that will be familiar to most users.
  5. (This is a reach but): vim-like counts would be cool: e.g., "5j" goes down 5 lines; 3l jumps three chapters forward...
dsanson commented 5 years ago

Sorry: 2 is wrong. The vim bindings are 'ctrl-b' for PAGE_UP and 'ctrl-f' for PAGE_DOWN. But I think it would make more sense to use the "vim-like" bindings that less and more use: 'b' for PAGE_UP and 'f' for PAGE_DOWN.

wustho commented 5 years ago

Thanks for some suggestions, here my thoughts:

  1. forgot about that, let me consider it first tho
  2. Since I use two ctrl button, it kinda too much work for my finger, so i thought changing it to capital J/K will do for now, but might reconsider it if anyone else ask for this binding...
  3. That's originated from my personal issue, so I always have this anxiety when flipping a page, did I miss one line? so i made it like that
  4. Some things that I ditched when choosing this, idk know the term, algorithm or something, is reading percentage and search feature, and I want reading percentage more than search, so dent expect search anytime soon
  5. need more thinking for this,
dsanson commented 5 years ago

I've implemented everything but (4) on my fork: https://github.com/dsanson/epr. I won't open a pull request, since I'm sure that if you decide to implement any of these things, you will want to do it in your own way!

wustho commented 5 years ago

Sorry just read it, and I just followed your suggestions: 1 & 3 thanks... sorry, not implementing all, I still think to make it more sturdy like not depending on html2text, especially this is weekend, before adding features 4 & 5... It does independent from html2text now and support opening images if you might want to add them to your fork...

wustho commented 5 years ago

Hello there @dsanson , I just realize from issue #8 that actually people not only using this epr just to read fictions which my initial motivations, so I thought that vim like counter movement is unnecessary to read fictions. But since now I understand, is it too much to ask for you to pull request regarding that counter like movement? I just read your fork, and it's actually so new to me about counter algorithm.

With image support I just finished, now I feel satisfied with my idea and hoping for other's people idea to improve thiss epr, especially htmll to text rendering...

dsanson commented 5 years ago

I am super busy with other things right now, but I’d be happy to try to make a clean pull request in a week or two. The basic idea behind the algorithm I used (which may not be the best) is:

wustho commented 5 years ago

Whenever you feel free @dsanson , not in hurry ofc, because having prefix arguments to adjust text width like 60= is probably so much better than holding = or -, it's lagging so much that sometimes I feel text wont come out...

I tried your fork and just like your tips in your last comment, that's neww to me... I almost made one with timeout to sepearate motion and counter... thanks for the tips...

wustho commented 5 years ago
  1. [x] Added search function, though only capable of finding text that span across single line.