Giter Club home page Giter Club logo

win-vind's Introduction

Coverity Scan Build Status

What is this?

win-vind provides a lightweight hybrid UI system of CUI and GUI for Windows.
By installing this tool, you will be able to control the Windows GUI in the same way as Vim.

1. Vim-user friendly.

All configuration methods and mode concepts are derived from Vim, allowing for Vim-like UI operation.
Vim users only need to understand win-vind's macro features and additional mode concepts with little learning cost.

2. There are many useful built-in commands.

You don't have to worry about complicated scripts and dependencies like with traditional key binding tools.
You can freely create user-defined commands by combining low-level optimized built-in commands.

3. Very portable and fully open source.

win-vind is a small single binary with no dependencies that runs with user permissions.
It is also available from the command line as a command for UI operations like $ win-vind -c "ggyyGp".

Top Feature Demo

demo.mp4

Installation

win-vind supports a variety of installation methods.

$ choco install win-vind
$ winget install win-vind

This has been added to Scoop Extras thanks to contributors and is automatically updated by the autoupdate feature of scoop.

$ scoop bucket add extras
$ scoop install win-vind

Executable Installer

Portable Zip

Usage

Usage is mainly described in easy-to-read documentation pages with plenty of diagrams. Here, only a sample .vindrc is shown below. As you can see, it is Vim user-friendly.

.vindrc sample

" Choose the version of {tiny, small, normal, big, huge}.
version normal

" Change parameters
set shell = cmd
set cmd_fontsize = 14
set cmd_fontname = Consolas
set easyclick_bgcolor=E67E22
set easyclick_fontcolor=34495E

" Map capslock to ctrl.
imap <capslock> {<ctrl>}

" Define useful shortcuts
inoremap <ctrl-shift-f> <easyclick><click_left>
inoremap <ctrl-shift-m> <gridmove><click_left>
inoremap <ctrl-shift-s> <switch_window><easyclick><click_left>

" Register application launchers
noremap <ctrl-1> :! gvim<cr>
noremap <ctrl-2> :e http://example.com<cr>

" Define macros like Vim
enoremap t ggyyGp

" Apply auto-commands
autocmd AppLeave * <to_insert>
autocmd AppEnter,EdiNormalEnter vim.exe <to_resident>

Default Mappings

win-vind has many features, but you can use a simpler one for your purposes by putting the version command at the beginning of your .vindrc. If you want to use tiny version, write the following. It is important to note that nothing but comments can be written before the version command. If you do not write the version command, huge will be loaded.

" Only comments can be written in here.
version tiny
" Any command can be written from.
" For example
set shell = cmd
Tier Supported Features
tiny +mouse +syscmd
small +mouse +syscmd +window +process
normal +mouse +syscmd +window +process +vimemu
big +mouse +syscmd +window +process +vimemu +hotkey +gvmode
huge +mouse +syscmd +window +process +vimemu +hotkey +gvmode +experimental

Following Vim, there are five tiers. tiny has minimal commands for mouse moving and clicking, including EasyClick and GridMove. small allows more flexible handling of window controls and process launches, etc. normal has Vim emulation mappings and allows text editing in text areas, etc. big adds several hotkeys that redefine some of the shortcut keys in Windows to operate Windows with more Vim-like ways. It also provides GUI Visual Mode (+gvmode), which allows for holding down the mouse. huge allows win-vind to have experimental features for more complex operations.

For more information on default mappings, please visit our website.

Known Issues

  • EasyClick does not seem to work properly for some applications on older Windows 10 before 1803. The cause is not known, but we have confirmed that it works after 1909. (#11)

  • Windows 10/11 Single Language does not seem to be able to map toggle keys such as <Capslock>. (#40)

  • If you want to use word motion (e.g. w, B, e) in MS Office Word, it is recommended to disable Use smart paragraph selection.

Build

All you have to do is install cmake, Visual Sudio and Windows SDK, then do the following.

$ cmake -B build
$ cmake --build build
$ ./build/Debug/win-vind.exe

If you want to build with MinGW or create an installer, see here.

Test

Tests can be run using ctest and python.

Unit Test

Run source code level tests.

$ cd tests
$ cmake -B build unit
$ cmake --build build
$ ctest -C Debug --test-dir build --output-on-failure
$ cd ..

Runtime Test

Runtime tests check the behavior of the built binaries.

$ cd tests
$ python runtime/test.py "../bin_64/win-vind/win-vind.exe"  # Specifies the binary for release.
$ cd ..

See this document for details.

Contribute

If you would like to contribute to win-vind, see CONTRIBUTING.md.

The project is managed with GitHub Projects.

Similar Projects

License

This software is provided by pit-ray under the MIT License.

win-vind's People

Contributors

az-pz avatar mohamedhmini avatar pit-ray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

win-vind's Issues

Change caret size to reflect different modes[Feature]

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.

Support run commands style config like `.vimrc`.

For example.

set keybrdtype=US
set initmode=edii
set suppress_for_vim
set vscrollspeed=10

ediimap <capslock> <ctrl>
ediimap <esc-left> change_to_edi_normal

It was converted from Project/ToDo to issue.

[Question] Swtiching from Insert to EDI NORMAL without cursor moving to the right

When I switch from INSERT to EDI NORMAL (Esc+Right Arrow) the cursor moves to the right. Is this intended? It throws off my writing sequence (in Microsoft Word) and I am wondering if it can be changed that the cursor stays in the same location.

Thanks.

  • Windows 10 Edition: Pro
  • OS Type: 64bit
  • OS Version: 20H2
  • OS Build: 19042.1348
  • win-vind Version: 4.2.1
  • win-vind Type: installer
  • Is it reproducible?: Yes

[Bug] Strange behavior with right-alt and Word

In order to activate editor normal with right alt, I have the following line in .vindrc:

inoremap <ralt> to_edi_normal

-- but in Microsoft Word (I haven't tried in other apps) I get very weird behavior once I click r-alt. Keys behave differently than before (e.g. typing shift-T in insert mode inserts the current time instead of capital T).

[Question] Easier Alt-Tab in Editor Modes

Question
I know that I can use [Ctrl+w > s] and [:ws] to alt-tab from GUI and command modes. However, how can I do this from Editor normal Mode? Right now I have to switch modes to do so.

[Question] passing <alt> to system?

Hi

I am trying the following so vind will automatically switch to INSERT when I click :

ennoremap <alt> to_insert

This is helpful when I switch to other apps. Problem is that the first is caught by vind and is not passed to Windows. Any way of getting over this? (i.e., to pass the first to Windows so that my first press of will both switch vind to INSERT and also have Windows switch apps?)

[Question] 'Change' on visual block?

Hi

I see the c w works well in edii mode inside Microsoft Word, but when I mark a block of text in ediv and then click c nothing happens. Am I doing something wrong? Is this particular use of change is not yet implemented?

Thanks
Gil

Rationale behind resident mode[Question]

Question
Hi,
I wonder what is the purpose behind resident mode, as it seems for me that both it and insert mode have the same purpose, making it redundant. Am I missing something?

Thanks

[Question] Can I use win-vind in Linux or MacOS?

Question
A clear and concise description of what you have.

Dear pit-ray.

I'm a big fan of your win-vind.
I don't use mouse that much since I found win-vind.
Now I want it to use on Linux(Ubuntu) or MacOS.
Is it Compatible with them? if not, do you have any plan to develop?

Block cursor

When in vim keybinding normal mode, would be possible to have the cursor shown as a block like in vim?

difference between EDI INSERT and GUI INSERT?

Hi

I am asking this because it is much easier for me to remain in EDI INSERT while writing in Word and switch to other apps etc., than to need to switch to GUI INSERT every time I am doing something outside Word.

Thanks
Gil

[Question] replace ESC from edii to ediv?

Hi

Is it possible to change the command from Esc to something else like ? The reason is that this way I could work with edii ediin with many windows, without needing to switch to guii. The only thing preventing me from doing this right now is that the Esc key is needed in many applications, but every time i click it it switches back to edin, which I don't want to.

Thanks!
Gil

Cannot create setting files after install

After first install and first launch getting this error:

An runtime exception occurred from void __cdecl Utility::create_directory(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &). Cannot create a directory \\.win-vind\.. So could not create setting files of win-vind, so terminate. (Windows Error Code: 161)

Tried running as administrator and still getting the same error.

System Info

Edition Windows 10 Enterprise LTSC
Version 1809
OS build 17763.1757

[Question] is there vnoremap?

Hi,

In order to quickly switch to normal and insert modes from visual mode, I have placed the following two lines in my .vindrc:

vnoremap <esc> to_edi_normal
vnoremap i to_insert

-- but I am getting an error: E: not command (L:2)

What am I doing wrong?

WinVind stops when right-clicked in tray [Bug]

Describe the bug
Recently, whenever I right click the win-vind icon in the tray, the app closes. This wasn't the behavior before, where a menu appears with options like showing the configuration file location. This issue is only with win-vind, all other icons show their menus.

Environment (please complete the following information):

  • Windows 10 Edition: Home
  • OS Type: 64bit
  • OS Version: 10.0.19042
  • OS Build: Build 19042
  • win-vind Version: 4.0.1
  • win-vind Type: installer
  • Is it reproducible?: Not sure

What I tried:

  • Uninstalling/installing
  • Removing my .vindrc file
  • Restarting the computer

Thanks

[Feature] <del> should not occupy + register

Hi,

When I mark a in EDIT VISUAL and then hit d, the text is inserted into the + register (the Windows clipboard). This causes confusion because it will replace whatever is already in the clipboard. One way of getting over this is simply using <win-v> instead of <ctrl-v> because it will show the history of previous clipboard content, but I am wondering if you would consider differentiating between d (which should not occupy the + register, as in DEL operation) and x (which is somehow akin to <ctrl-x> and therefore is a more natural candidate for CUT operation). This way, the user can decide between DEL and CUT ... As far as I see in the vim documentation, there is no difference in VISUAL MODE between d and x -- so you can make a distinction here without breaking anything assumed in vim ...

Let me know what you think.

Best.

Controlling the scroll movment size

Hi again!

When I use the very helpful ctrl+y and ctrl+e, the scrolling of the window is very slow and choppy. It is possible to determine how many pixels each jump will have? If this is too much work to add this as a GUI feature for the user to determine, perhaps just increase it by a bit? (I am not sure if this is only in my computer or to my own taste...).

Best!

[Question] Keep alt,shift,ctrl pressed

Question
How can you keep pressed keys like alt, ctrl, shift in gui normal mode?

For example, in unity you can look around the scene by pressing alt+ moving the mouse.

Is there a way of doing this using the vindrc?

[Feature] Detect windows objects ad assign shortcuts to them for user interaction

This cool extension is available in Chrome:

https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb

It would be awesome to develop a tool for controlling windows and their objects (TreeView, ListView, Toolbars...) in a similar way of that Chrome extension: once a user triggers a shortcut, a number of labels displaying sequence of characters appear in the front of the dynamic windows objects, and by typing those characters in sequence, then a click/control send/focus is triggered on it according to the target object.

A sample of what I mean:

image

The basic idea would be:

  1. Scan all of the windows looking for their controls (buttons, edit boxes, etc.)
  2. Draw some boxes near them with the key sequence which would activate them.
  3. Wait for the user to type the character sequence related to the desired object to activate.

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

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!

[Question] double bindings?

Hi,

I added a binding to guii as but when I type this I first get a notice:
-- TARGET ON --

Is this overstepping another binding? I could not figure it out...

Thanks.

Not detecting VS Code

Hi,

For some reson it's not detecting VS Code.

For example, when I try to select the window using or , the cursor is not jumping to the window.

EasyClick also does not work.

I am using VS Code Insiders (but it didn't work for normal VS Code either) on a Window 10 x64 machine.

Support for right-click and hover in EasyClick

First off, great work!! There is no other implementation that comes this close to Vim emulation for Windows. You might want to enable Github Sponsors to let people show their appreciation :)

It would be nice to be able to right click on the target using EasyClick, similar to left click. There could also be an additional hover motion which would only move the pointer without any click.

[Question] Use EasyClick Only

Question
Is there a way to configure win-vind such that it only listens for the triggers for EasyClick/"EasyMotion-like Hints" but passes all other keybinds through to the OS? Basically, I'd like to disable all other functions and modes and just use the EasyClick feature.

So far, I've tried removing all entries from keybinds.json besides the ones for EasyClick but that effectively blocks all normal keyboard input.

Highlighting not deleting

Hey!
First of all: This looks amazing, thans a lot !

I have a few problems though:
(Win10)
When pressing "db" or "dw" it is highligting but not deleting

Also E doesn't work

Have a great day and thanks!
Greetings

[Bug] Can't map <capslock>

Describe the bug
As an example, I'm trying to remap <capslock> by doing:

imap <capslock> <f15>
inoremap <f15> to_edi_normal

Also, I tried to remap <capslock> in other modes without success:

gnnoremap <capslock> j

I can remap all other keys except capslock.

Environment (please complete the following information):

  • Windows 11 Home Single Language
  • OS Type: 64bit
  • OS Version: 21H2
  • OS Build: 21H2
  • win-vind Version: 4.2.1
  • win-vind Type: installer
  • Is it reproducible?: Yes

[Bug] Overlay is not displayed on external monitor when laptop screen is off

Describe the bug
I do not see any of the overlays for hints or the current mode or the command window. I think hinting is working as the cursor jumps around but the overlays visible in the GIF don't show up

Environment (please complete the following information):

  • Windows 10 Edition: Enterprise
  • OS Type: 64bit
  • OS Version: 1909
  • OS Build: 18363.19.16
  • win-vind Version: 4.2.1
  • win-vind Type: chocolatey
  • Is it reproducible?: I only have access to one device, but the problem always occurs for me.

[Question] How can I slow the mouse speed in GN mode?

win-vind 4.2.1

In GUI normal mode, my mouse moves super fast.
One stroke of h,j,k,l leaves half across the screen.

I wrote this in my ~/.win-vind/.vindrc file,

set cursor_accel =5
set cursor_maxv = 1
set cursor_tweight = 10

but nothing changed.

Am I doing wrong something? Need help!

Easy Click FF is really slow[Question]

Question
Is it normal that the Easy Click FF takes long time to load the options?
It is definetly slower than the vimium FX on Firefox.
I'm using a Windows 10 8GB Ram 4x2,4GHz i5 6300U.

Is it because it is loading the window information from the windows sdk?

[Bug] The character '-' is invalid ascii key code in default_config/.vindrc

The 4.3.1 release is using a default config file in default_config/.vindrc and there's an error when launching the portable 64 bits release. The log says :

[Message] E: Invalid Syntax (L:277)

[Error] An runtime exception occurred from class std::vector<class vind::core::KeyCode,class std::allocator > __cdecl vind::core::parse_pure_one_character_command(char). The character '-' is invalid ascii key code. (...\win-vind-4.3.1\default_config.vindrc, L:277) (enum vind::SystemCall __cdecl vind::bind::SyscmdSource::sprocess(const class std::filesystem::path &,bool))

The 4.2.1 has not this problem (default_config/.vindrc is inexistant in my config)

Please note that I was just launching win-vnid for a 1st use and my .vindrc (my own) is empty for the moment.

Environment (please complete the following information):

  • Windows 10 Enterprise
  • OS Type: 64bit
  • OS Version: 21H1
  • OS Build: 10.0.19043
  • win-vind Version: 4.3.1
  • win-vind Type: zip
  • Is it reproducible?: Yes

Mistake in documentation

Hi,
In this page about resident mode the default binding to switch to insert mode should be esc + up rather than esc + down, which is what is describe in the mode transition image in this page.

Thanks

Changing the easyclick command from FF to f

Describe the feature you'd like

[English] I was trying to change the key bindings of the easyclick command from ff to just f, but the change does not get reflected after modifying the setting. Is this a bug, or am I missing something?

[Japanese] Win Vind を使わせていただいてありがとうございます。非常に気に入っております。一つ疑問なのですがKey Bindings を使ってeasyclick のコマンドをFF から fに変えたいのですが変更が反映されません。これはバグでしょうか?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.