Skip to content

Commit

Permalink
change build executable: make vim_ahk directory and put icons there
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmdnk committed Oct 19, 2020
1 parent 6e80d79 commit 02de8d8
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 51 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,17 @@ jobs:
# fix for [Unable to copy error by command line · Issue #68 · AutoHotkey/Ahk2Exe](https://github.com/AutoHotkey/Ahk2Exe/issues/68)
- name: build
shell: cmd
run: ./build/build.bat
run: ./build.bat
- name: get tag
if: startsWith( github.ref, 'refs/tags/v' )
id: get_tag
shell: bash
run: echo ::set-output name=tag::${GITHUB_REF##*/}
- name: zip
if: startsWith( github.ref, 'refs/tags/v' )
working-directory: ./build
#shell: bash
#run: zip -r vim_ahk-${{steps.get_tag.outputs.tag}}.zip vim_ahk.app
#run: powershell -c Compress-Archive -Path vim_ahk.app -DestinationPath vim_ahk-${{steps.get_tag.outputs.tag}}.zip
shell: pwsh
run:
Compress-Archive -Path "./vim_ahk.exe" -DestinationPath vim_ahk-${{steps.get_tag.outputs.tag}}.zip
Compress-Archive -Path "vim_ahk" -DestinationPath vim_ahk-${{steps.get_tag.outputs.tag}}.zip
- name: Create Release
if: startsWith( github.ref, 'refs/tags/v' )
id: create_release
Expand All @@ -50,6 +46,6 @@ jobs:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: ./build/vim_ahk-${{steps.get_tag.outputs.tag}}.zip
asset_path: vim_ahk-${{steps.get_tag.outputs.tag}}.zip
asset_name: vim_ahk-${{steps.get_tag.outputs.tag}}.zip
asset_content_type: application/zip
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
testLogs/
vim_ahk/
.DS_Store
58 changes: 23 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,27 @@ at the end of the <a href="http://www.autohotkey.com/docs/Scripts.htm#auto">Auto

### Executable

You can also use vim.exe, which can work standalone w/o AutoHotKey.
You can also use **vim_ahk.exe**, which can work standalone w/o AutoHotKey.

To get executable, go to [the releases page](https://github.com/rcmdnk/vim_ahk/releases)
and download the latest one.
and download the latest zip file.

## Applications
Unzip the zip file, and place the extracted vim_ahk folder where you like,
then launch **vim_ahk.exe**.

:memo: place **vim_ahk_icons** folder in the same folder with **vim_ahk.exe**,
otherwise the tray menu icon feature does not work.

### Build executable from the source

Clone vim_ahk and go vim_ahk folder, and run **build.bat**.

* Double click the file
* Or run `.\build.bat` on PowerShell or Command Prompt.

You will find **vim_ahk** folder which contains **vim_ahk.exe** and **vim_ahk_icons**.

## Applications (VimGroup)
The default setting enables vim-mode for the following applications:

* Notepad (メモ帳)
Expand Down Expand Up @@ -104,7 +119,8 @@ Examples of applications:

## Options

There are following options which you can set in your script.
In addition to `VimGroup`,
there are following options which you can set in your script.
All of these can be changed from setting menu, too.

|Option|Description|Default|
Expand All @@ -116,11 +132,11 @@ All of these can be changed from setting menu, too.
|VimRestoreIME|If 1, IME status is restored at entering insert mode.|1|
|VimJJ|If 1, `jj` changes mode to Normal from Insert.|0|
|VimTwoLetterEsc|A list of character pairs to press together during insert mode to get to normal mode. For example, a value of `jf` means pressing `j` and `f` at the same time will enter normal mode.|""|
|VimDisableUnused|Disable level of unused keys in normal mode (see below for details).|3|
|VimDisableUnused|Disable level of unused keys in other than insert mode.<br><ol><li>Do not disable unused keys</li><li>Disable alphabets (+shift) and symbols</li><li>Disable all including keys with modifiers (e.g. Ctrl+Z)</li></ol>|3|
|VimSetTitleMatchMode|SetTitleMatchMode: 1: Start with, 2: Contain, 3: Exact match|2|
|VimSetTitleMatchModeFS|SetTitleMatchMode: Fast: Text is not detected for such edit control, Slow: Works for all windows, but slow|Fast|
|VimIconCheckInterval|Interval to check vim_ahk status (ms) and change tray icon. If it is set to 0, the original AHK icon is set (see below for details).|1000|
|VimVerbose|Verbose level (see below for details).|0|
|VimIconCheckInterval|Interval to check vim_ahk status (ms) and change tray icon (see below picture). If it is set to 0, the original AHK icon is set and not changed.|1000|
|VimVerbose|Verbose level.<br><ol><li>Nothing.</li><li>Minimum tooltip (Mode name only).</li><li>ToolTip (All information).</li><li>MsgBox.</li></ol>|0|
|VimGroup|Applications on witch vim_ahk is enabled.|See **Applications** section|

You can add your options before including **vim.ahk** in your script
Expand All @@ -132,36 +148,8 @@ in the auto execute section like:
If you want to change them directly in the vim.ahk script,
add these variable before `Vim := new VimAhk()`.

### DisableUnused

Set how vim_ahk treats keys which are not used by vim_ahk in such normal mode.

* 1: Do not disable unused keys
* 2: Disable alphabets (+shift) and symbols
* 3: Disable all including keys with modifiers (e.g. Ctrl+Z)

### VimIconCheckInterval

If **VimIconCheckInterval** is set to non-zero,
the tray icon is changed when the mode is changed.

This interval defines the interval to check the mode to update the icon.

If this value is non-zero, the task tray icon is changed by following the mode.

![trayicon](https://raw.githubusercontent.com/rcmdnk/vim_ahk/master/pictures/trayicon.gif "trayicon")

### VimVerbose

Set verbose level with **VimVerbose**.

The level is defined by a number and the allowed numbers are followings:

* 1: Nothing.
* 2: Minimum tooltip (Mode name only).
* 3: Tooltip.
* 4: Msgbox.

## GUI Option Setting Window

You can change these options from the right click menu of task tray icon
Expand Down
7 changes: 5 additions & 2 deletions build/build.bat → build.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off
SET AHKPath=C:\Program Files\AutoHotkey
REM Takes a sinple optional command parameter, /t, which starts testing before build.
REM Takes a simple optional command parameter, /t, which starts testing before build.
SET Param1=%1

if "%Param1%"=="/t" (
Expand All @@ -18,4 +18,7 @@ if errorlevel 1 (
echo .
exit /b %errorlevel%
)
"%AHKPath%\compiler\ahk2exe.exe" /in vim.ahk /out build\vim_ahk.exe /compress 0
if exist vim_ahk rmdir /s /q vim_ahk
mkdir vim_ahk
"%AHKPath%\compiler\ahk2exe.exe" /in vim.ahk /out vim_ahk\vim_ahk.exe /compress 0
xcopy /i /y vim_ahk_icons vim_ahk\vim_ahk_icons
4 changes: 2 additions & 2 deletions lib/vim_ahk.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

class VimAhk{
__About(){
this.About.Version := "v0.8.2"
this.About.Date := "18/Oct/2020"
this.About.Version := "v0.8.3"
this.About.Date := "19/Oct/2020"
this.About.Author := "rcmdnk"
this.About.Description := "Vim emulation with AutoHotkey, everywhere in Windows."
this.About.Homepage := "https://github.com/rcmdnk/vim_ahk"
Expand Down
10 changes: 5 additions & 5 deletions lib/vim_icon.ahk
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
class VimIcon{
__New(){
global VimScriptPath
this.icons := {Normal: VimScriptPath "\..\icons\normal.ico"
, Insert: VimScriptPath "\..\icons\insert.ico"
, Visual: VimScriptPath "\..\icons\visual.ico"
, Command: VimScriptPath "\..\icons\command.ico"
, Disabled: VimScriptPath "\..\icons\disabled.ico"
this.icons := {Normal: VimScriptPath "\..\vim_ahk_icons\normal.ico"
, Insert: VimScriptPath "\..\vim_ahk_icons\insert.ico"
, Visual: VimScriptPath "\..\vim_ahk_icons\visual.ico"
, Command: VimScriptPath "\..\vim_ahk_icons\command.ico"
, Disabled: VimScriptPath "\..\vim_ahk_icons\disabled.ico"
, Default: A_AhkPath}
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.

0 comments on commit 02de8d8

Please sign in to comment.