pit-ray / win-vind

You can operate Windows with key bindings like Vim.
https://pit-ray.github.io/win-vind/
MIT License
1.85k stars 45 forks source link
emulation hotkey keybinding keyboard mouse vim window-manager windows

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

$ choco install win-vind

winget

$ winget install win-vind

Scoop

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.

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

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

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

Known Issues

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.