hackernews-TUI icon indicating copy to clipboard operation
hackernews-TUI copied to clipboard

vi mode

Open ink-splatters opened this issue 4 years ago • 6 comments

Hi,

@aome510 any plans for this one?

Anyone around interested in?

Thanks a lot

ink-splatters avatar Nov 10 '21 12:11 ink-splatters

Hi @ink-splatters, can you elaborate more about what will a vi mode be used for?

aome510 avatar Nov 10 '21 16:11 aome510

I guess OP means vim-like navigation keys, so hjkl with hl for opening/closing a post and jk to move verticallly between posts, plus things like gg/G to go to the first/last displayed entry. I agree it would be to have that, as many TUI applications provide such bindings and I'm used to them.

BachoSeven avatar Dec 13 '21 13:12 BachoSeven

@BachoSeven thanks for the additional insight.

Tbh, the default keybindings are kinda a mess 😢. I haven't used any TUIs before I built HN-TUI, so I have no idea what the bindings other apps normally provide.

I hope this is still addressable with the help of key mapping in the configuration file.

aome510 avatar Dec 13 '21 16:12 aome510

Key mappings in config file would be perfect, I could provide a vi-mode bindings config file which can be linked to in the README for those interested, will do soon.

BachoSeven avatar Dec 13 '21 16:12 BachoSeven

Hey @BachoSeven ! How's that binding config file coming through? This is an awesome app, but it is really needed!

slarrain avatar Jan 25 '22 23:01 slarrain

@slarrain

As someone who's used a ton of TUI apps and with a vim background, these bindings make a lot more sense to me, as they're more consistent with many other TUI apps:

[keymap.global_keymap]
quit = "C-c"
goto_previous_view = "q"
goto_search_view = "/"

[keymap.story_view_keymap]
page_down = "C-d"
page_up = "C-u"
prev_story_tag = "["
next_story_tag = "]"
open_article_in_article_view = "v"

[keymap.comment_view_keymap]
page_down = "C-d"
page_up = "C-u"
open_link_in_browser = "o"
open_link_in_article_view = "v"
toggle_collapse_comment = " "

[keymap.article_view_keymap]
page_down = "C-d"
page_up = "C-u"
open_link_in_browser = "o"
open_link_in_article_view = "v"

huyz avatar Mar 24 '22 19:03 huyz

The default keybindings are not perfect but I guess it can be worked around by using the above keymap.

I'll close this issue for now.

aome510 avatar Jan 31 '23 18:01 aome510