randy3k / radian

A 21 century R console
MIT License
1.96k stars 73 forks source link

vi mode - normal and visualindicated the same way #462

Open raffaem opened 5 months ago

raffaem commented 5 months ago

With

options(radian.editing_mode = "vi")
options(radian.show_vi_mode_prompt = TRUE)
options(radian.vi_mode_prompt = "\033[0;34m[{}]\033[0m ")

while insert mode is indicated with "ins", both normal and visual mode are indicated in the same way, with "nav".

On a side note:

  1. When in visual mode, pressing ESC takes a lot of time to exit visual mode (1/2 seconds)
  2. Is it possible to indicate the mode with just one letter (i/n/v)?

EDIT: replace mode also has its own wording, "rep".

randy3k commented 5 months ago

both normal and visual mode are indicated in the same way, with "nav".

It is expected behavior as long as i can tell.

When in visual mode, pressing ESC takes a lot of time to exit visual mode (1/2 seconds)

it is a known issue of prompt-toolkit. ipython shares the same issues.

Is it possible to indicate the mode with just one letter (i/n/v)?

options(
    radian.vi_mode_prompt = list(
        "ins" = "(I) ",
        "nav" = "(N) ",
        "rep" = "(R) "
    )
)
raffaem commented 5 months ago

Is it possible to indicate the mode with just one letter (i/n/v)?

options(
    radian.vi_mode_prompt = list(
        "ins" = "(I) ",
        "nav" = "(N) ",
        "rep" = "(R) "
    )
)

Is this documented?

raffaem commented 5 months ago

uhm can I have per-mode cursors? I would like a box in normal mode, and a vertical bar in insert mode.

As you can see, I am very, very spoiled 😛

raffaem commented 5 months ago

When in visual mode, pressing ESC takes a lot of time to exit visual mode (1/2 seconds)

it is a known issue of prompt-toolkit. ipython shares the same issues.

is it ever going to be fixed?

I wrote a bug report and never received an answer

randy3k commented 5 months ago

Is this documented?

No. But it is not likely to be changed unless prompt-toolkit changes the input modes.

uhm can I have per-mode cursors? I would like a box in normal mode, and a vertical bar in insert mode.

prompt-toolkit added this support in https://github.com/prompt-toolkit/python-prompt-toolkit/pull/1558

it should be doable, but I don't have the time to invest in it now.

randy3k commented 5 months ago

is it ever going to be fixed?

I wrote a bug report and never received an answer

I don't think it is fixable without major refactoring in prompt-toolkit's key capturing mechanism.