pit-ray / win-vind

You can operate Windows with key bindings like Vim.
https://pit-ray.github.io/win-vind/
MIT License
1.9k stars 45 forks source link

Change caret size to reflect different modes[Feature] #31

Closed Positron010 closed 3 years ago

Positron010 commented 3 years ago

Describe the feature you'd like Sometimes it is helpful to know which mode one is in. For example, it would be great if the caret (insertion point) changes to block style like in the terminal to reflect that you entered normal mode just like in Vim, and then returns to the normal thin mode in insert mode. It would be helpful also to have a key binding to trigger the status indicator to reveal the current mode (just like the one that appears when switching modes). This is helpful especially for the GUI Modes.

Thanks and appreciate your work.

Related projects (Optional) A similar project that implements Vim using AutoHotKey (vim_ahk), has the caret width feature as an option.

pit-ray commented 3 years ago

Thanks for the request.

The Binding that bring up the current mode is easy to implement. However, there are two concerns with implementing a block-style caret.

Firstly, vim_ahk only dynamically changes Settings > Ease of Access > Cursor & pointer > Cursor thickness on Windows 10, which has no effect on applications that have their own rendering (e.g. Chrome, Edge). Therefore, the support is likely to be uneven. Secondly, if it goes further than vim_ahk and changes the thickness that matches the size of the text, the character width detection will be a major problem.

Once I make a prototype, I will reply again.

Thanks

ghost commented 3 years ago

Instead of changing Caret (cursor), would an easier solution be to switch application icon design in system tray?

Like "Vi" where the "i" is overlaid in front of the "V" and is a prominent bold colour to make it stand out from the "V". Some for other modes "Vgn", "Vgv", and so on...

pit-ray commented 3 years ago

Instead of changing Caret (cursor), would an easier solution be to switch application icon design in system tray?

Like "Vi" where the "i" is overlaid in front of the "V" and is a prominent bold colour to make it stand out from the "V". Some for other modes "Vgn", "Vgv", and so on...

I am not very motivated to dynamically change the system tray icon like vim_ahk. This is because some people have grouped system icons or hidden the taskbar to make the icons invisible. But it might be a good idea to implement it as an option.

By the way, if you make the value of the cmd_fadeout option large enough, you can make the virtual command line not disappear.

For example

set cmd_fadeout = 3600 " one hour visible
pit-ray commented 3 years ago

Today, I released v4.2.0-rc1 as the preview version. It supports block-style carets. However, it was difficult to detect the character width dynamically, so I implemented a width-fixed block style and a pseudo block style with selection instead. Please try it.

Positron010 commented 3 years ago

Hi, Thanks for you hard work. I really appreciate your efforts. Unfortunately, I upgraded to Windows 11, and apparently win-vind doesn't work well in it unfortunately. I hope to test the feature once Windows 11 gets supported. Meanwhile, I hope someone with the ability tests the feature.

Thanks

pit-ray commented 3 years ago

I haven't tried Windows 11 yet. I'll do my best to support Windows 11 as soon as possible. Thanks again for your feature suggestions.

pit-ray commented 3 years ago

I have confirmed that the installer and zip of win-vind 4.2.0-rc1 work on Windows 11 21H2 22000.168 Build, please check the log of your win-vind. If there are no errors, please describe the situation in more detail.

Positron010 commented 3 years ago

Hi, I am sorry, I just tried win-vind again, and it really does work. I really don't know why it didn't work when I tried it previously. I am going to try the feature. Sorry again for the mistake. Thanks for letting me know.

pit-ray commented 3 years ago

I'm glad it works. Thanks again!

Positron010 commented 3 years ago

Just tried the feature, it works really well! Thanks, and good luck!