win-vind icon indicating copy to clipboard operation
win-vind copied to clipboard

[Question] vindrc map insert mode keybinds in gui normal mode.

Open pardo312 opened this issue 2 years ago • 3 comments

Question Hello, first and foremost, thank you so much for you project. I haved tried multiplayer alternatives and nothing works the same as win-vind. Excelent program.

The question as the title says it, is that if there is a way to map a key in normal gui mode to a insert mode action. I asked this because i use another authotkey script to cycle through the virtual desktop, and more specific, to change windows to an specific desktop. Right know, in win-vind I've only found that I have to open the virtual desktop manager and then enter gui visual and drag the window to the virtual desktop.

So, is there a way I can access the insert mode, autohotkey script, within gui normal mode? Thank you so much again!

pardo312 avatar Oct 13 '21 14:10 pardo312

Thanks for using it! And thanks for the very clear questions.

The keymaps defined in each mode are just defaults, and all the functions on this page can be set to any keymap you like, regardless of the mode. Virtual desktop related is here.

Therefore, you can map some favorite functions in GUI-Normal mode into the Insert mode like this.

imap <capslock> <f20>
inoremap <f20-t> taskview
inoremap <f20-q> close_current_vdesktop
inoremap <f20-n> create_new_vdesktop
inoremap <f20-h> switch_to_left_vdesktop
inoremap <f20-l> switch_to_right_vdesktop
inoremap <f20-v> to_gui_visual

Mapping from Insert to GUI-Normal is also possible, of course.

In the future, I plan to support command line shortcuts and low-level cmd2cmd like following.

inoremap <ctrl-h> <ctrl-win><left>
inoremap <ctrl-l> <ctrl-win><right>
inoremap <ctrl-t> <win-tab>
gnnoremap <f1> :!vim ~/.vimrc

If you want new feature to move the currently selected window to a specified virtual desktop, I will try to implement it in the next version.

Thanks.

pit-ray avatar Oct 13 '21 15:10 pit-ray

Thanks for the fast response!

That second part with the cmd2cmd will work for the mapping I got right now for the ahk script. For example, I press <capslock-w> to move the current selected window to the 2 desktop <capslock-e> to the third, etc. This is the current script I am using windows-desktop-switcher.

It will be great if you could add the feature in a future review! Thank you so much for you attention and support!

pardo312 avatar Oct 13 '21 16:10 pardo312

I didn't know about that script, but I think it can be easily implemented since Windows provides an API to control virtual desktops.

Currently, only key2key is supported, so there are alternatives such as switch_to_left_vdesktop which just works the same as <ctrl-win><left>.

The plan is to implementation of two features.

  • something like :movewv 3 or :movewv 6 to move the selected window to the specified number. If no desktops create needed ones.
  • moves the selected window to the previous or next virtual desktops and switches the desktop to one.

If you have any other ideas, please let me know. Thanks.

pit-ray avatar Oct 13 '21 17:10 pit-ray