Skip to content

Commit

Permalink
Merge branch 'docs'
Browse files Browse the repository at this point in the history
pit-ray committed Jun 9, 2023
2 parents ca04ece + 17bb66d commit af154dd
Showing 9 changed files with 136 additions and 70 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -71,12 +71,12 @@ $ scoop install win-vind
-->

### Executable Installer
- [win-vind_5.0.2_32bit_installer.zip](https://github.com/pit-ray/win-vind/releases/download/v5.0.2/win-vind_5.0.2_32bit_installer.zip)
- [win-vind_5.0.2_64bit_installer.zip](https://github.com/pit-ray/win-vind/releases/download/v5.0.2/win-vind_5.0.2_64bit_installer.zip)
- [win-vind_5.1.0_32bit_installer.zip](https://github.com/pit-ray/win-vind/releases/download/v5.1.0/win-vind_5.1.0_32bit_installer.zip)
- [win-vind_5.1.0_64bit_installer.zip](https://github.com/pit-ray/win-vind/releases/download/v5.1.0/win-vind_5.1.0_64bit_installer.zip)

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


## Usage
10 changes: 5 additions & 5 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ translations:
# label: 日本語

project:
version: 5.0.2
version: 5.1.0
download_url: downloads
download_text: Download

@@ -43,10 +43,10 @@ links:
icon: comments
url: https://github.com/pit-ray/win-vind/discussions

dl_ins_32: https://github.com/pit-ray/win-vind/releases/download/v5.0.2/win-vind_5.0.2_32bit_installer.zip
dl_zip_32: https://github.com/pit-ray/win-vind/releases/download/v5.0.2/win-vind_5.0.2_32bit_portable.zip
dl_ins_64: https://github.com/pit-ray/win-vind/releases/download/v5.0.2/win-vind_5.0.2_64bit_installer.zip
dl_zip_64: https://github.com/pit-ray/win-vind/releases/download/v5.0.2/win-vind_5.0.2_64bit_portable.zip
dl_ins_32: https://github.com/pit-ray/win-vind/releases/download/v5.1.0/win-vind_5.1.0_32bit_installer.zip
dl_zip_32: https://github.com/pit-ray/win-vind/releases/download/v5.1.0/win-vind_5.1.0_32bit_portable.zip
dl_ins_64: https://github.com/pit-ray/win-vind/releases/download/v5.1.0/win-vind_5.1.0_64bit_installer.zip
dl_zip_64: https://github.com/pit-ray/win-vind/releases/download/v5.1.0/win-vind_5.1.0_64bit_portable.zip

ui:
mode: 'light' # 'auto', 'dark', 'light'
9 changes: 5 additions & 4 deletions docs/cheat_sheet/defaults/index.md
Original file line number Diff line number Diff line change
@@ -54,10 +54,11 @@ nav: Default Mappings
|`<C-f>`|`<scroll_down_onepage>`|
|`<C-u>`|`<scroll_up_halfpage>`|
|`<C-y>`, `<C-k>`|`<scroll_up>`|
|`FF`, `Fo`|`<easy_click_left>`|
|`Fa`|`<easy_click_right>`|
|`Fh`|`<easy_click_hover>`|
|`Fm`|`<easy_click_mid>`|
|`FF`, `Fo`|`<easyclick><click_left>`|
|`Fa`|`<easyclick><click_right>`|
|`Fh`|`<easyclick>`|
|`Fm`|`<easyclick><click_mid>`|
|`<C-m>`|`<gridmove>`|
|`G`|`<jump_cursor_to_bottom>`|
|`M`|`<jump_cursor_to_vcenter>`|
|`a`, `A`|`<click_right>`|
7 changes: 3 additions & 4 deletions docs/cheat_sheet/functions/index.md
Original file line number Diff line number Diff line change
@@ -26,10 +26,9 @@ disable_anchors: true
|:---:|:---|
|`<click_left>`|Left button of a mouse click|
|`<click_right>`|Right button of a mouse click|
|`<easy_click_hover>`|EasyClick (Hovering)|
|`<easy_click_left>`|EasyClick (Left Click)|
|`<easy_click_mid>`|EasyClick (Mid Click)|
|`<easy_click_right>`|EasyClick (Right Click)|
|`<click_mid>`|Middle button of a mouse click|
|`<easyclick>`|Move a cursor using hints on the UI objects without clicking.|
|`<gridmove>`|Move a cursor using tiled hints laid on the entire screen.|
|`<jump_cursor_to_active_window>`|Jump the mouse cursor to the foreground window|
|`<jump_cursor_to_bottom>`|Jump the mouse cursor to bottom|
|`<jump_cursor_to_hcenter>`|Jump the mouse cursor to horizontal center|
123 changes: 91 additions & 32 deletions docs/cheat_sheet/options/index.md
Original file line number Diff line number Diff line change
@@ -8,16 +8,22 @@ show_in_menu: false

## Parameter ID and Defaults

### System

|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`arrangewin_ignore`|str||A list of executable filenames to ignore in ArrangeWindows. For example, if you want to remove rainmeter and gvim from the alignment, write `set arrangewin_ignore = rainmeter, gvim`. The name is the name of the executable file without extension.|
|`autofocus_textarea`|bool|false|Automatically focus on the nearest text area when switching to **Editor Normal Mode**|
|`autotrack_popup`|bool|false|It is one of standard options on Windows. For example, if shown **Are you sure you want to move this file to the Recycle Bin?**, it automatically moves the cursor to the popup window.|
|`blockstylecaret_mode`|str|solid|Mode of block style caret. There is a `solid` mode with fixed size and a `flex` mode with pseudo blocks by selection.|
|`blockstylecaret_width`|num|15|Width of block style caret on solid mode|
|`blockstylecaret`|bool|false|Block Style Caret|
|`charbreak`|str|grapheme|Mode for how to split a single Unicode character. The `grapheme` mode treats a combination character as a single character. The `codepoint` mode processes the combination character for each codepoint.|
|`charcache`|bool|false|It is a very small cache for one character used by `x` or `X` commands. If it is enabled, the clipboard is opened per once typing. Therefore, you will get the same behavior as the original Vim, whereas the performance maybe drop a litte.|
|`initmode`|str|i|Initial mode of win-vind. The value is the mode prefix.|
|`listen_interval`|float|1.0|The time interval in seconds at which the server win-vind will retrieve command requests sent by the client with the `-c` argument.|
|`icon_style`|str|resources/icon32_dark.ico|Style of the icon to be displayed on the taskbar. By default, **Dark** and **Light** styles are available. The former is `resources/icon32_dark.ico` and the latter is `resouces/icon32_light.ico`. By the way, you can use any tasktray icon you like as long as it is in `.ico` format and **32x32**.|
|`tempdir`|str|~/Downloads|Where to download the file with the update checking.|
|`gui_fontname`|str|Segoe UI|Font name of GUI. If an empty string is passed, the system font will be used.|
|`gui_fontsize`|num|11|Font size of GUI|

### Command Line

|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`vcmdline`|bool|true|show virtual command line|
|`cmd_bgcolor`|str|323232|Background color in the virtual command line. (# is optional)|
|`cmd_fadeout`|num|5|Fade-out time in seconds for the virtual command line. If you want the command line to always be visible, make this value large enough.|
|`cmd_fontcolor`|str|c8c8c8|Font color in the virtual command line. (# is optional)|
@@ -29,50 +35,103 @@ show_in_menu: false
|`cmd_xmargin`|num|32|Use `cmd_roughpos` to determine the rough position, and `cmd_xmargin` to determine the detailed horizontal position. The units are in pixels.|
|`cmd_ymargin`|num|96|Use `cmd_roughpos` to determine the rough position, and `cmd_ymargin` to determine the detailed vertical position. The units are in pixels.|
|`cmd_monitor`|str|primary|The monitor on which to draw the command line. The choices are `primary`, `all`, `active`, `${NUMBER}`. The `primary` displays the command line on the primary monitor only. `all` draws command lines on all monitos. `active` displays command lines on the monitor where the selected window is located. `${NUMBER}` shows the command line on `${NUMBER}`th monitor. The `${NUMBER}` is a number starting from 0 and assigned from the left monitor. For example, `set cmd_monitor=1`.|
|`cursor_accel`|num|95|Pixel-level acceleration in the constatnt acceleration motion of the mouse cursor.|
|`cursor_resolution`|num|250|A weight for scaling the time of constant acceleration motion of the mouse cursor.|
|`dedicate_to_window`|bool|false|If **Dedicate to One window** enables, you can select one window with `enable_targeting_of_dedicate_to_window`. In this case, it makes the mode automatically switch to Editor Normal Mode on the targeting window. When the foreground window change to another, it makes the mode switch to Insert Mode. The targeting becomes disable with `disable_targeting_of_dedicate_to_window`. In other words, this feature transforms some normal editors to fake Vim. The computing cost is so small.|

### EasyClick

|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`easyclick_bgcolor`|str|323232|Font background color of hints in EasyClick|
|`easyclick_colordecay`|num|100|Matching color decay of hints in EasyClick|
|`easyclick_fontcolor`|str|c8c8c8|Font color of hints in EasyClick|
|`easyclick_fontname`|str|Arial|Font name of hints in EasyClick|
|`easyclick_fontname`|str|Consolas|Font name of hints in EasyClick|
|`easyclick_fontsize`|num|14|Font size of hints in EasyClick|
|`easyclick_fontweight`|num|500|Font weight of hits in EasyClick. Its maximum value is 1000.|
|`gui_fontname`|str|Segoe UI|Font name of GUI. If an empty string is passed, the system font will be used.|
|`gui_fontsize`|num|11|Font size of GUI|

### GridMove

|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`gridmove_bgcolor`|str|323232|Font background color of hints in GridMove|
|`gridmove_fontcolor`|str|c8c8c8|Font color of hints in GridMove|
|`gridmove_fontname`|str|Consolas|Font name of hints in GridMove|
|`gridmove_fontsize`|num|14|Font size of hints in GridMove|
|`gridmove_fontweight`|num|500|Font weight of hits in GridMove. Its maximum value is 1000.|
|`gridmove_size`|str|12x8|The grid size in GridMove. It assumes a text as its value, such as `12x8` for horizontal 12 cells and vertical 8 cells.|

### Mouse

|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`cursor_accel`|num|95|Pixel-level acceleration in the constatnt acceleration motion of the mouse cursor.|
|`cursor_resolution`|num|250|A weight for scaling the time of constant acceleration motion of the mouse cursor.|
|`jump_margin`|num|10|A margin in pixels to prevent jumping off the screen when jumping to the edge of the screen using `jump_cursor_to_left`, etc.|
|`hscroll_pageratio`|num|0.125|The ratio of one page to the screen width to determine the amount of scrolling movement as a page.
|`hscroll_speed`|num|10|Horizontal scrolling speed of the mouse wheel.|
|`icon_style`|str|resources/icon32_dark.ico|Style of the icon to be displayed on the taskbar. By default, **Dark** and **Light** styles are available. The former is `resources/icon32_dark.ico` and the latter is `resouces/icon32_light.ico`. By the way, you can use any tasktray icon you like as long as it is in `.ico` format and **32x32**.|
|`initmode`|str|i|Initial mode of win-vind. The value is the mode prefix.|
|`jump_margin`|num|10|A margin in pixels to prevent jumping off the screen when jumping to the edge of the screen using `jump_cursor_to_left`, etc.|
|`keybrd_layout`|str||Keyboard layout kmp file referenced by `jump_cursor_with_keybrd_layout`. By default, only **US (101/102)** or **JP (106/109)** layouts are supported. If your keyboard is not the right one, please create your own kmp file and use its path as the value. If you leave the value empty, the KMP file will be selected automatically.|
|`listen_interval`|float|1.0|The time interval in seconds at which the server win-vind will retrieve command requests sent by the client with the `-c` argument.|
|`shell`|str|cmd|Name of the shell to use for `:!` commands|
|`shell_startupdir`|str||The current directory where commands (e.g. `:shell`, `:terminal`, `:!`) will be executed. For these commands, the current directory is the directory if there is Exeplorer, or the user directory otherwise. If this option is not empty, then the current directory is fixed to a value directory.|
|`shellcmdflag`|str|-c|Flag passed to the shell to execute `:!` commands|
|`suppress_for_vim`|bool|false|It makes the mode of win-vind automatically switch to **Resident Mode** on the applications included the strings called **VIM** in an executable file name. Thus, it allows us to smoothly move from win-vind having the same key-bindings as Vim to Vim applications.|
|`tempdir`|str|~/Downloads|Where to download the file with the update checking.|
|`uiacachebuild`|bool|false|EasyClick and `autofocus_textarea` are slow because they scan the UI object after being called. If this option is enabled, scanning is done asynchronously and cache is used as a result. Using the cache is 30 times faster than scanning linearly, but the location information, etc. may not always be correct.|
|`uiacachebuild_lifetime`|num|1500|Cache lifetime (ms). A high value reduces the computational cost, but decreases the reliability of the cache. A low value increases the computational cost due to frequent cache creation, but guarantees reliability.|
|`uiacachebuild_staybegin`|num|500|The time between when the mouse cursor stops moving and when it starts to build a cache. In order to reduce unnecessary computational cost, it is desirable not to create a cache when there is no operation. Therefore, it should be updated only immediately after the mouse stops. The value of this option is the time(ms) that the mouse cursor is considered to be stopped. Please refer to [appendix](#overview-of-stay-range-in-uiacachebuild)|
|`uiacachebuild_stayend`|num|2000|In order to reduce unnecessary computational cost, it is desirable not to create a cache when there is no operation. The value of this option is the time(ms) between the time the cursor stops moving and the time it stops creating a cache. Please refer to appendix [appendix](#overview-of-stay-range-in-uiacachebuild)|
|`vcmdline`|bool|true|show virtual command line|
|`vscroll_pageratio`|num|0.125|The ratio of one page to the screen height to determine the amount of scrolling movement as a page.
|`vscroll_speed`|num|30|Vertical scrolling speed of the mouse wheel.|
|`keybrd_layout`|str||Keyboard layout kmp file referenced by `jump_cursor_with_keybrd_layout`. By default, only **US (101/102)** or **JP (106/109)** layouts are supported. If your keyboard is not the right one, please create your own kmp file and use its path as the value. If you leave the value empty, the KMP file will be selected automatically.|

### Window

|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`arrangewin_ignore`|str||A list of executable filenames to ignore in ArrangeWindows. For example, if you want to remove rainmeter and gvim from the alignment, write `set arrangewin_ignore = rainmeter, gvim`. The name is the name of the executable file without extension.|
|`window_velocity`|num|100|Pixel-level velocity in the constatnt acceleration motion of the window in winresizer.|
|`window_hdelta`|num|100|Window Width delta for resizing|
|`window_vdelta`|num|100|Window height delta for resizing|
|`winresizer_initmode`|num|0|Initial mode of window resizer ([0]: Resize, [1]: Move, [2]: Focus)|

### Block Style Caret

## Appendix
|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`blockstylecaret`|bool|false|Block Style Caret|
|`blockstylecaret_mode`|str|solid|Mode of block style caret. There is a `solid` mode with fixed size and a `flex` mode with pseudo blocks by selection.|
|`blockstylecaret_width`|num|15|Width of block style caret on solid mode|

### AutoFocus

|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`autofocus_textarea`|bool|false|Automatically focus on the nearest text area when switching to **Editor Normal Mode**|
|`autotrack_popup`|bool|false|It is one of standard options on Windows. For example, if shown **Are you sure you want to move this file to the Recycle Bin?**, it automatically moves the cursor to the popup window.|

### UIA Cache

|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`uiacachebuild`|bool|false|EasyClick and `autofocus_textarea` are slow because they scan the UI object after being called. If this option is enabled, scanning is done asynchronously and cache is used as a result. Using the cache is 30 times faster than scanning linearly, but the location information, etc. may not always be correct.|
|`uiacachebuild_lifetime`|num|1500|Cache lifetime (ms). A high value reduces the computational cost, but decreases the reliability of the cache. A low value increases the computational cost due to frequent cache creation, but guarantees reliability.|
|`uiacachebuild_staybegin`|num|500|The time between when the mouse cursor stops moving and when it starts to build a cache. In order to reduce unnecessary computational cost, it is desirable not to create a cache when there is no operation. Therefore, it should be updated only immediately after the mouse stops. The value of this option is the time(ms) that the mouse cursor is considered to be stopped. Please refer to [appendix](#overview-of-stay-range-in-uiacachebuild)|
|`uiacachebuild_stayend`|num|2000|In order to reduce unnecessary computational cost, it is desirable not to create a cache when there is no operation. The value of this option is the time(ms) between the time the cursor stops moving and the time it stops creating a cache. Please refer to appendix [appendix](#overview-of-stay-range-in-uiacachebuild)|

### Overview of stay range in `uiacachebuild`
<p align="center">
<img src="{{ site.url }}/imgs/uiacachebuild_stay.png" class="img-fluid">
<p align="center">uiacachebuild_staybegin and uiacachebuild_stayend overview</p>
</p>

### Shell

|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`shell`|str|cmd|Name of the shell to use for `:!` commands|
|`shell_startupdir`|str||The current directory where commands (e.g. `:shell`, `:terminal`, `:!`) will be executed. For these commands, the current directory is the directory if there is Exeplorer, or the user directory otherwise. If this option is not empty, then the current directory is fixed to a value directory.|
|`shellcmdflag`|str|-c|Flag passed to the shell to execute `:!` commands|

### Vim Emulation

|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`charbreak`|str|grapheme|Mode for how to split a single Unicode character. The `grapheme` mode treats a combination character as a single character. The `codepoint` mode processes the combination character for each codepoint.|
|`charcache`|bool|false|It is a very small cache for one character used by `x` or `X` commands. If it is enabled, the clipboard is opened per once typing. Therefore, you will get the same behavior as the original Vim, whereas the performance maybe drop a litte.|

### Options

|ID|Type|Default|Note|
|:---:|:---:|:---:|:---|
|`dedicate_to_window`|bool|false|If **Dedicate to One window** enables, you can select one window with `enable_targeting_of_dedicate_to_window`. In this case, it makes the mode automatically switch to Editor Normal Mode on the targeting window. When the foreground window change to another, it makes the mode switch to Insert Mode. The targeting becomes disable with `disable_targeting_of_dedicate_to_window`. In other words, this feature transforms some normal editors to fake Vim. The computing cost is so small.|
|`suppress_for_vim`|bool|false|It makes the mode of win-vind automatically switch to **Resident Mode** on the applications included the strings called **VIM** in an executable file name. Thus, it allows us to smoothly move from win-vind having the same key-bindings as Vim to Vim applications.|



<br>
<br>
1 change: 0 additions & 1 deletion docs/usage/index.md
Original file line number Diff line number Diff line change
@@ -105,7 +105,6 @@ For example, adjusting EasyClick parameters.
" write in your .vindrc
set easyclick_bgcolor=E67E22
set easyclick_fontcolor=34495E
set easyclick_colordecay=150
set easyclick_fontname=Consolas
set easyclick_fontsize=16
set easyclick_fontweight=600
2 changes: 1 addition & 1 deletion src/core/keycode.cpp
Original file line number Diff line number Diff line change
@@ -332,7 +332,7 @@ namespace vind
code_ = table.name2code_[n] ;
}
else {
throw LOGIC_EXCEPT(name + " is not supported.") ;
throw RUNTIME_EXCEPT(name + " is not supported.") ;
}
}
}
28 changes: 25 additions & 3 deletions src/core/settable.cpp
Original file line number Diff line number Diff line change
@@ -10,14 +10,19 @@ namespace

std::vector<Param> default_params {
Param("hintkeys", "asdghklqwertyuiopzxcvbnmfj"),

Param("arrangewin_ignore", ""),

Param("autofocus_textarea", false),
Param("autotrack_popup", false),

Param("blockstylecaret", false),
Param("blockstylecaret_mode", "solid"),
Param("blockstylecaret_width", 15),

Param("charbreak", "grapheme"),
Param("charcache", false),

Param("cmd_bgcolor", "323232"),
Param("cmd_fadeout", 5),
Param("cmd_fontcolor", "c8c8c8"),
@@ -29,42 +34,59 @@ namespace
Param("cmd_roughpos", "LowerLeft"),
Param("cmd_xmargin", 32),
Param("cmd_ymargin", 96),

Param("cursor_accel", 32),
Param("cursor_resolution", 250),

Param("dedicate_to_window", false),

Param("easyclick_bgcolor", "323232"),
Param("easyclick_colordecay", 100),
Param("easyclick_fontcolor", "c8c8c8"),
Param("easyclick_fontname", "Arial"),
Param("easyclick_fontname", "Consolas"),
Param("easyclick_fontsize", 14),
Param("easyclick_fontweight", 500),

Param("gridmove_bgcolor", "323232"),
Param("gridmove_fontcolor", "c8c8c8"),
Param("gridmove_fontname", "Arial"),
Param("gridmove_fontname", "Consolas"),
Param("gridmove_fontsize", 14),
Param("gridmove_fontweight", 500),
Param("gridmove_size", "12x8"),

Param("gui_fontname", "Segoe UI"),
Param("gui_fontsize", 10),

Param("hscroll_pageratio", 0.125f),
Param("hscroll_speed", 10),

Param("icon_style", "icon32_flat.ico"),

Param("initmode", "i"),

Param("jump_margin", 10),

Param("keybrd_layout", ""),

Param("listen_interval", 1.0f),

Param("shell", "cmd"),
Param("shell_startupdir", ""),
Param("shellcmdflag", "-c"),

Param("suppress_for_vim", false),

Param("tempdir", "~/Downloads"),

Param("uiacachebuild", false),
Param("uiacachebuild_lifetime", 1500),
Param("uiacachebuild_staybegin", 500),
Param("uiacachebuild_stayend", 2000),

Param("vcmdline", true),

Param("vscroll_pageratio", 0.125f),
Param("vscroll_speed", 30),

Param("window_hdelta", 100),
Param("window_vdelta", 100),
Param("window_velocity", 100),
18 changes: 2 additions & 16 deletions src/util/def.hpp
Original file line number Diff line number Diff line change
@@ -7,25 +7,11 @@
#define UNUSED(identifier) /* identifier */
#endif

//exception class with scope identifier
#if defined(__GNUC__)
#define LOGIC_EXCEPT(msg) \
std::logic_error(std::string("An logic exception occurred from ") +\
__PRETTY_FUNCTION__ + ". " + msg)
std::logic_error(std::string("An logic exception occurred: ") + msg)

#define RUNTIME_EXCEPT(msg) \
std::runtime_error(std::string("An runtime exception occurred from ") +\
__PRETTY_FUNCTION__ + ". " + msg)
std::runtime_error(std::string("An runtime exception occurred: ") + msg)

#elif defined(_MSC_VER) && _MSC_VER >= 1500
#define LOGIC_EXCEPT(msg) \
std::logic_error(std::string("An logic exception occurred from ") +\
__FUNCSIG__ + ". " + msg)

#define RUNTIME_EXCEPT(msg) \
std::runtime_error(std::string("An runtime exception occurred from ") +\
__FUNCSIG__ + ". " + msg)

#endif //defubed(__GNUC__)

#endif

0 comments on commit af154dd

Please sign in to comment.