Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pit-ray/win-vind

You can operate Windows with key bindings like Vim.
https://github.com/pit-ray/win-vind

emulation hotkey keybinding keyboard mouse vim window-manager windows

Last synced: about 5 hours ago
JSON representation

You can operate Windows with key bindings like Vim.

Awesome Lists containing this project

README

        





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


## Installation
win-vind supports a variety of installation methods.

### [Chocolatey](https://chocolatey.org/)

```sh
$ choco install win-vind
```

### [winget](https://github.com/microsoft/winget-cli)

```sh
$ winget install win-vind
```

### [Scoop](https://scoop.sh/)
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
- [win-vind_5.13.2_32bit_installer.zip](https://github.com/pit-ray/win-vind/releases/download/v5.13.2/win-vind_5.13.2_32bit_installer.zip)
- [win-vind_5.13.2_64bit_installer.zip](https://github.com/pit-ray/win-vind/releases/download/v5.13.2/win-vind_5.13.2_64bit_installer.zip)

### Portable Zip
- [win-vind_5.13.2_32bit_portable.zip](https://github.com/pit-ray/win-vind/releases/download/v5.13.2/win-vind_5.13.2_32bit_portable.zip)
- [win-vind_5.13.2_64bit_portable.zip](https://github.com/pit-ray/win-vind/releases/download/v5.13.2/win-vind_5.13.2_64bit_portable.zip)

## Usage

Usage is mainly described in easy-to-read [documentation pages](https://pit-ray.github.io/win-vind/usage/) with plenty of diagrams. Here, only a sample .vindrc is shown below. As you can see, it is Vim user-friendly.

The file is located at `C:\Users\[USERNAME]\.win-vind\.vindrc`

### .vindrc sample

```vim
" 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 {}

" Define useful shortcuts
inoremap
inoremap
inoremap

" Register application launchers
noremap :! gvim
noremap :e http://example.com

" Define macros like Vim
enoremap t ggyyGp

" Apply auto-commands
autocmd AppLeave *
autocmd AppEnter,EdiNormalEnter vim.exe
```

### 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.

```vim
" Only comments can be written in here.
version tiny
" Any command can be written from.
" For example
set shell = cmd
```

|**Tier**|**Supported Features**|
|:---|:---|
|[tiny](https://pit-ray.github.io/win-vind/cheat_sheet/defaults/tiny)|+mouse +syscmd|
|[small](https://pit-ray.github.io/win-vind/cheat_sheet/defaults/small)|+mouse +syscmd +window +process|
|[normal](https://pit-ray.github.io/win-vind/cheat_sheet/defaults/normal)|+mouse +syscmd +window +process +vimemu|
|[big](https://pit-ray.github.io/win-vind/cheat_sheet/defaults/big)|+mouse +syscmd +window +process +vimemu +hotkey +gvmode|
|[huge](https://pit-ray.github.io/win-vind/cheat_sheet/defaults/huge)|+mouse +syscmd +window +process +vimemu +hotkey +gvmode +experimental|

Following Vim, there are five tiers.
* `tiny` has minimal commands for mouse moving and clicking from the keyboard (e.g., GridMove and EasyClick).
* `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](https://pit-ray.github.io/win-vind/cheat_sheet/defaults/).

## 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](https://github.com/pit-ray/win-vind/issues/11))
- Windows 10/11 Single Language does not seem to be able to map toggle keys such as ``. ([#40](https://github.com/pit-ray/win-vind/issues/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](https://cmake.org/download/), [Visual Sudio](https://visualstudio.microsoft.com/ja/downloads/) and [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/), then do the following.

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

If you want to build with MinGW or create an installer, see [here](https://github.com/pit-ray/win-vind/blob/master/CONTRIBUTING.md#to-development).

## Test
Tests can be run using ctest and python.

### Unit Test
Run source code level tests.

```bash
$ 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.

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

See [this document](tests/README.md) for details.

## Contribute
If you would like to contribute to win-vind, see [CONTRIBUTING.md](https://github.com/pit-ray/win-vind/blob/master/CONTRIBUTING.md).

The project is managed with GitHub Projects.

## Similar Projects
- [rcmdnk/vim_ahk](https://github.com/rcmdnk/vim_ahk)
- [microsoft/PowerToys](https://github.com/microsoft/PowerToys)
- [zsims/hunt-and-peck](https://github.com/zsims/hunt-and-peck)

## License

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