From 02de8d85775c68d08aaa1f87669e7743d90a2a24 Mon Sep 17 00:00:00 2001 From: rcmdnk Date: Mon, 19 Oct 2020 16:10:29 +0900 Subject: [PATCH] change build executable: make vim_ahk directory and put icons there --- .github/workflows/build_test.yml | 10 +-- .gitignore | 1 + README.md | 58 +++++++----------- build/build.bat => build.bat | 7 ++- lib/vim_ahk.ahk | 4 +- lib/vim_icon.ahk | 10 +-- {icons => vim_ahk_icons}/command.ico | Bin {icons => vim_ahk_icons}/disabled.ico | Bin {icons => vim_ahk_icons}/insert.ico | Bin {icons => vim_ahk_icons}/normal.ico | Bin .../other_icons/command.png | Bin .../other_icons/disabled.png | Bin .../other_icons/insert.png | Bin .../other_icons/normal.png | Bin .../other_icons/vim_ahk.ico | Bin .../other_icons/visual.png | Bin {icons => vim_ahk_icons}/other_icons/z.png | Bin {icons => vim_ahk_icons}/visual.ico | Bin 18 files changed, 39 insertions(+), 51 deletions(-) rename build/build.bat => build.bat (64%) rename {icons => vim_ahk_icons}/command.ico (100%) rename {icons => vim_ahk_icons}/disabled.ico (100%) rename {icons => vim_ahk_icons}/insert.ico (100%) rename {icons => vim_ahk_icons}/normal.ico (100%) rename {icons => vim_ahk_icons}/other_icons/command.png (100%) rename {icons => vim_ahk_icons}/other_icons/disabled.png (100%) rename {icons => vim_ahk_icons}/other_icons/insert.png (100%) rename {icons => vim_ahk_icons}/other_icons/normal.png (100%) rename {icons => vim_ahk_icons}/other_icons/vim_ahk.ico (100%) rename {icons => vim_ahk_icons}/other_icons/visual.png (100%) rename {icons => vim_ahk_icons}/other_icons/z.png (100%) rename {icons => vim_ahk_icons}/visual.ico (100%) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 99feb94c..cdfe7bb2 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -16,7 +16,7 @@ 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 @@ -24,13 +24,9 @@ jobs: 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 @@ -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 diff --git a/.gitignore b/.gitignore index 4e017eee..64d08205 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ testLogs/ +vim_ahk/ .DS_Store diff --git a/README.md b/README.md index df0490b6..b3f2c0f6 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,27 @@ at the end of the 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 (メモ帳) @@ -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| @@ -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.
  1. Do not disable unused keys
  2. Disable alphabets (+shift) and symbols
  3. Disable all including keys with modifiers (e.g. Ctrl+Z)
|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.
  1. Nothing.
  2. Minimum tooltip (Mode name only).
  3. ToolTip (All information).
  4. MsgBox.
|0| |VimGroup|Applications on witch vim_ahk is enabled.|See **Applications** section| You can add your options before including **vim.ahk** in your script @@ -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 diff --git a/build/build.bat b/build.bat similarity index 64% rename from build/build.bat rename to build.bat index 8ff5be61..6b26d4fc 100644 --- a/build/build.bat +++ b/build.bat @@ -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" ( @@ -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 diff --git a/lib/vim_ahk.ahk b/lib/vim_ahk.ahk index f4fa2882..294ba368 100644 --- a/lib/vim_ahk.ahk +++ b/lib/vim_ahk.ahk @@ -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" diff --git a/lib/vim_icon.ahk b/lib/vim_icon.ahk index b4505c34..50f01d64 100644 --- a/lib/vim_icon.ahk +++ b/lib/vim_icon.ahk @@ -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} } diff --git a/icons/command.ico b/vim_ahk_icons/command.ico similarity index 100% rename from icons/command.ico rename to vim_ahk_icons/command.ico diff --git a/icons/disabled.ico b/vim_ahk_icons/disabled.ico similarity index 100% rename from icons/disabled.ico rename to vim_ahk_icons/disabled.ico diff --git a/icons/insert.ico b/vim_ahk_icons/insert.ico similarity index 100% rename from icons/insert.ico rename to vim_ahk_icons/insert.ico diff --git a/icons/normal.ico b/vim_ahk_icons/normal.ico similarity index 100% rename from icons/normal.ico rename to vim_ahk_icons/normal.ico diff --git a/icons/other_icons/command.png b/vim_ahk_icons/other_icons/command.png similarity index 100% rename from icons/other_icons/command.png rename to vim_ahk_icons/other_icons/command.png diff --git a/icons/other_icons/disabled.png b/vim_ahk_icons/other_icons/disabled.png similarity index 100% rename from icons/other_icons/disabled.png rename to vim_ahk_icons/other_icons/disabled.png diff --git a/icons/other_icons/insert.png b/vim_ahk_icons/other_icons/insert.png similarity index 100% rename from icons/other_icons/insert.png rename to vim_ahk_icons/other_icons/insert.png diff --git a/icons/other_icons/normal.png b/vim_ahk_icons/other_icons/normal.png similarity index 100% rename from icons/other_icons/normal.png rename to vim_ahk_icons/other_icons/normal.png diff --git a/icons/other_icons/vim_ahk.ico b/vim_ahk_icons/other_icons/vim_ahk.ico similarity index 100% rename from icons/other_icons/vim_ahk.ico rename to vim_ahk_icons/other_icons/vim_ahk.ico diff --git a/icons/other_icons/visual.png b/vim_ahk_icons/other_icons/visual.png similarity index 100% rename from icons/other_icons/visual.png rename to vim_ahk_icons/other_icons/visual.png diff --git a/icons/other_icons/z.png b/vim_ahk_icons/other_icons/z.png similarity index 100% rename from icons/other_icons/z.png rename to vim_ahk_icons/other_icons/z.png diff --git a/icons/visual.ico b/vim_ahk_icons/visual.ico similarity index 100% rename from icons/visual.ico rename to vim_ahk_icons/visual.ico