win-vind
win-vind copied to clipboard
[Feature] listing apps for RESIDENT/NORMAL modes
Hi,
This is a suggestion for making the integration of win-vind
in Windows more streamlines. The idea is to filter/define the specific apps in which win-vind
will automatically enter RESIDENT mode and with it will automatically enter INSERT mode. This mechanism already works when switching to a vim
app, where there is no need for win-vind
to work, and it automatically switches to RESIDENT. Having a full control on the apps for which either INSERT / RESIDENT modes are turned on would make it ideal.
I think this would make the ongoing use of win-vind
easy and fault-free. For example, I definitely need win-vind
to work when I type documents in Microsoft Word, but when not when I switch to Adobe Acrobat and not when I switch to a web browser. When I switch back to Word, it would be ideal to have win-vind
automatically turn on in INSERT mode so I can start working with it again. A lot of issues with the <esc>
mapping for switching modes would naturally be resolves this way.
The implementation can be simple, with allowing to define a "default" mode for win-vind
on entry to an app for which no specific mode was specified, as in:
set default_mode = to_resident
and then allow to define specific apps for specific modes, as in:
set to_insert_apps = [LIST OF APPS]
With the above, easy implementation, I could navigate freely between apps and putting to use win-vind
seamlessly.
I hope this makes sense. Let me know your thoughts.
Love win-vind
!
Best Gil
Thanks for the suggestion. This seems to make a lot of sense. The current automatic mode change is terrible, like a toy, so needs to be enhanced.
I have two concerns.
- whether each name of applications should be executable name, or full path, etc.
- how to represent the listings. For example, in .vimrc notation, we write list something like
set fileformats=unix,dos,mac
, but in Vim script it islet v=[a, b, c]
.
In my opinion, it is better to use 1 is a regular expression for the path, and 2 should be the same notation as in .vimrc.
Please let me know your opinion. Thanks.
Great! Thanks for considering this!
As for 1), I actually think that just the exe name would be enough, not only b/c this is more simple to the uninitiated user, but also b/c even multiple instances of the same exe file (in different paths etc.) should have the same behavior for win-vind. So it would keep it simple and make sense.
With 2), I really can't say as I don't know Vim Script (and try not to, as I hear it is a bit of a mess), but how do you deal with listings in .vindrc
right now? Or isn't there such a behavior yet?
Best Gil
Now, let's make 1) an exe name so that it will be recognized as a path if we put /
or \\
.
With 2), the .vimrc format is used for arrangewin_ignore
.
ref. https://pit-ray.github.io/win-vind/cheat_sheet/options/
Thanks.
Yes, both of these look good to me!
+1 great idea.
love win vind. just found it
(#89, #100)
I plan to employ automatic commands using events like Vim. For example, in the following format.
autocmd AppSelect edge to_insert
autocmd AppSelect mspaint.exe to_gui_normal
autocmd AppSelect "C:\Program Files\Mozilla Firefox\firefox.exe" to_resident
Yes, looks great. But is it still possible to list more than one app for one autocmd?
Also, might add 'AppSelectDefault' for catchall/default mode, for all the apps that are not specified?
With 'AppSelectDefault' no app should be specified, only the default mode: 'autocmd AppSelectDefault to_insert'
@gilbh How about using regular expressions like in Vim?
autocmd AppSelect * to_insert
autocmd AppSelect *vim to_resident
I think that is a bit confusing, for the following reasons:
- The above two lines are not mutually exclusive:
*
includes*vim
. - The wildcard
*
could potentially clash with a path specification. - It is unclear how to list multiple items.
I would suggests going with the previous system.
Let me know your thoughts.
best!
@gilbh
After careful consideration, the default value using autocmd AppSelect *
was indeed a bad idea.
I want Vim users not to have to learn anything new, so I would to avoid the concept of Default as much as possible.
How about the following style command?
" .vindrc
autocmd WinLeave * to_insert
autocmd WinEnter "C:\Program Files\Mozilla Firefox\firefox.exe" to_resident
autocmd WinEnter vim to_resident
autocmd WinEnter notepad.exe to_edi_normal
It is similar to Vim notation.
" .vimrc
autocmd WinLeave * stopinsert
autocmd WinEnter *.txt startinsert
Thanks.
Yes, this looks really good! Thanks for developing this.
Now then, I'll implement along this policy.
@gilbh @alexn-s Implemented in 5.3.0.
I am testing now 5.3.0 and I have a few questions:
- This works:
autocmd AppEnter *notepad* <to_edi_normal>
-- but this doesn't:
autocmd AppEnter notepad.exe <to_edi_normal>
Is this deliberate or a bug?
-
How to specify multiple apps in one autocmd line?
-
There is a bug (not sure if always reproducible). From the first time I enter notepad and vind switched to NORMAL, it will happens on any
switching, and also on (switching to desktop). I am getting NORMAL switch from that moment onward on any app switch ...
Thanks!!
@gilbh Thank you for trying this feature.
1, 2.
It was neither a bug nor an intended one, and was not implemented. I will add it in the next version.
3.
This is a bug that only occurs when switching to desktop. I will fix it.
Fixed in v5.4.0