├── .gitignore ├── HISTORY.md ├── LICENSE ├── README.md ├── assets └── images │ ├── vimdesktop_128.jpg │ ├── vimdesktop_32.jpg │ └── vimdesktop_64.jpg └── src └── VimDesktop ├── Plugins ├── General │ └── General.ahk ├── plugins.ahk ├── totalcommander │ ├── a-zhistory.icl │ ├── totalcommander.ahk │ └── totalcommander.ini └── wps │ └── wps.ahk ├── check.ahk ├── lib ├── 7za.exe ├── Acc.ahk ├── anchor.ahk ├── ini.ahk ├── vimcore.ahk └── watchdir.ahk ├── viatc.ico ├── vimd.ahk └── vimd.ini /.gitignore: -------------------------------------------------------------------------------- 1 | #################### 2 | # Windows 3 | #################### 4 | # Windows image file caches 5 | Thumbs.db 6 | ehthumbs.db 7 | 8 | # Folder config file 9 | Desktop.ini 10 | 11 | # Recycle Bin used on file shares 12 | $RECYCLE.BIN/ 13 | 14 | # Windows Installer files 15 | *.cab 16 | *.msi 17 | *.msm 18 | *.msp 19 | 20 | #################### 21 | # vim 22 | #################### 23 | [._]*.s[a-w][a-z] 24 | [._]s[a-w][a-z] 25 | *.un~ 26 | Session.vim 27 | .netrwhist 28 | *~ 29 | -------------------------------------------------------------------------------- /HISTORY.md: -------------------------------------------------------------------------------- 1 | VimDesktop 1.2.1 (2013-12-19) 2 | ============================= 3 | 新增功能 4 | -------- 5 | - 主程序 6 | - 添加 ini 配置文件支持。 7 | - 添加 API:`vim.Exclude(class)` 为全局热键排除某个窗口下可用。 8 | - 添加 API:`vim.smap(hotkey,action,class)`,与 `map` 相似,但是映射为保存为超 9 | 级键,在用vim.exclude排除的窗口中可用。 10 | - 修改每个插件独立目录,以便管理. 11 | - TC插件 12 | - 增加 totalcommander.ini 用于管理 TC 插件。 13 | - 增加寻找 TC 路径的界面,如果是安装版,可以通过注册表找到。如果是绿色版,需 14 | 要指定路径。 15 | - `azHistroy` 修改为加载一次菜单,不会出现闪两次的问题. 16 | 17 | 缺陷修复 18 | -------- 19 | - 主程序 20 | - 修复当 `capslock` 时,按任意符号键出错的问题。 21 | - TC 插件 22 | - 修复 `[count]gg`,跳转到 count 行的错误。 23 | 24 | VimDesktop 1.1.3 (2013-12-13) 25 | ============================= 26 | 缺陷修复 27 | -------- 28 | - 主程序 29 | - 修复部分热键按下导致脚本崩溃的问题。 30 | 31 | VimDesktop 1.1.0 (2013-12-13) 32 | ============================= 33 | 新增功能 34 | -------- 35 | - 主程序 36 | - 调整 VimDesktop 的目录文件结构。 37 | - 修改任务栏图标菜单增加"主页"和"提交问题"菜单项。 38 | - 双击任务栏菜单弹出热键窗口。 39 | - 热键窗口修改为可调整。 40 | - 热键窗口数据居左显示。 41 | - 美化 a-z 历史的视觉效果。闪两次是必须的,没有办法。 42 | - 添加自动加载插件支持,不用手动 include 和 gosub 了。 43 | - TC插件 44 | - `e` 支持激活/最小化 TC。 45 | 46 | 缺陷修复 47 | -------- 48 | - 修复“`o` 和 `O` 的下拉列表中,无法用字母选择盘符”的问题 。 49 | - 修复一个小的操作逻辑。 50 | 51 | VimDesktop 1.0.2 (2013-12-10) 52 | ============================= 53 | 新增功能 54 | -------- 55 | - 基于 2013-12-10 源代码发布初始版本。 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 victorwoo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![icon](assets/images/vimdesktop_32.jpg) VimDesktop 2 | =================================================== 3 | 4 | 让所有 Windows 桌面程序拥有 Vim 操作风格的辅助工具 5 | 6 | 下载地址 7 | -------- 8 | [VimDesktop 1.2.1](https://github.com/victorwoo/vimdesktop/archive/master.zip) 9 | 10 | 运行要求 11 | -------- 12 | - [AutoHotkey](http://l.autohotkey.net/AutoHotkey_L_Install.exe) 13 | 14 | 快速起步 15 | -------- 16 | TODO 17 | 18 | 已知问题 19 | -------- 20 | TODO 21 | 22 | 下一步计划 23 | ---------- 24 | TODO 25 | 26 | 贡献及技术支持 27 | -------------- 28 | 官方 QQ 群: [271105729 (键盘控ViATc)](http://wp.qq.com/wpa/qunwpa?idkey=7aa346ef3d4d7700bc2dd398afe8168251d57f9ea7602479f28edc07f59ceb90) -------------------------------------------------------------------------------- /assets/images/vimdesktop_128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/victorwoo/vimdesktop/c88538ffe486bfbc6eb9e563826a5ac1ac7d58bf/assets/images/vimdesktop_128.jpg -------------------------------------------------------------------------------- /assets/images/vimdesktop_32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/victorwoo/vimdesktop/c88538ffe486bfbc6eb9e563826a5ac1ac7d58bf/assets/images/vimdesktop_32.jpg -------------------------------------------------------------------------------- /assets/images/vimdesktop_64.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/victorwoo/vimdesktop/c88538ffe486bfbc6eb9e563826a5ac1ac7d58bf/assets/images/vimdesktop_64.jpg -------------------------------------------------------------------------------- /src/VimDesktop/Plugins/General/General.ahk: -------------------------------------------------------------------------------- 1 | General: 2 | ; 通用功能 3 | Global FullScreenID := [] 4 | vim.mode("insert","General") 5 | vim.map("","","General") 6 | vim.mode("normal","General") 7 | vim.map("i","","General") 8 | vim.map("0","<0>","General") 9 | vim.map("1","<1>","General") 10 | vim.map("2","<2>","General") 11 | vim.map("3","<3>","General") 12 | vim.map("4","<4>","General") 13 | vim.map("5","<5>","General") 14 | vim.map("6","<6>","General") 15 | vim.map("7","<7>","General") 16 | vim.map("8","<8>","General") 17 | vim.map("9","<9>","General") 18 | vim.map("k","","General") 19 | vim.map("d","","General") 20 | vim.map("r","","General") 21 | vim.map("e","","General") 22 | vim.map("j","","General") 23 | vim.map("k","","General") 24 | vim.map("h","","General") 25 | vim.map("l","","General") 26 | vim.map("zj","","General") 27 | vim.map("zk","","General") 28 | vim.map("zh","","General") 29 | vim.map("zl","","General") 30 | vim.map("zc","","General") 31 | vim.map("zf","","General") 32 | vim.map("zm","","General") 33 | vim.map("zn","","General") 34 | vim.map("zr","","General") 35 | vim.map("t","","General") 36 | vim.map("x","","General") 37 | vim.map("gn","","General") 38 | vim.map("gp","","General") 39 | vim.map("g1","","General") 40 | vim.map("g2","","General") 41 | vim.map("g3","","General") 42 | vim.map("g4","","General") 43 | vim.map("g5","","General") 44 | vim.map("g6","","General") 45 | vim.map("g7","","General") 46 | vim.map("g8","","General") 47 | vim.map("g9","","General") 48 | vim.map("g0","","General") 49 | 50 | vim.comment("","下一个标签") 51 | vim.comment("","前一个标签") 52 | vim.comment("","关闭当前标签") 53 | vim.comment("","新建标签") 54 | vim.comment("","激活第一个标签") 55 | vim.comment("","激活第二个标签") 56 | vim.comment("","激活第三个标签") 57 | vim.comment("","激活第四个标签") 58 | vim.comment("","激活第五个标签") 59 | vim.comment("","激活第六个标签") 60 | vim.comment("","激活第七个标签") 61 | vim.comment("","激活第八个标签") 62 | vim.comment("","激活第九个标签") 63 | vim.comment("","激活最后一个标签") 64 | vim.Comment("<1>","计数前缀1") 65 | vim.Comment("<2>","计数前缀2") 66 | vim.Comment("<3>","计数前缀3") 67 | vim.Comment("<4>","计数前缀4") 68 | vim.Comment("<5>","计数前缀5") 69 | vim.Comment("<6>","计数前缀6") 70 | vim.Comment("<7>","计数前缀7") 71 | vim.Comment("<8>","计数前缀8") 72 | vim.Comment("<9>","计数前缀9") 73 | vim.Comment("<0>","计数前缀0") 74 | vim.Comment("","向左移动[Count]次") 75 | vim.Comment("","向右移动[Count]次") 76 | vim.Comment("","向下移动[Count]次") 77 | vim.Comment("","向上移动[Count]次") 78 | vim.Comment("","窗口移动到下方") 79 | vim.Comment("","窗口移动到上方") 80 | vim.Comment("","窗口移动到左侧") 81 | vim.Comment("","窗口移动到右侧") 82 | vim.Comment("","窗口移动到中间") 83 | vim.Comment("","最大化窗口") 84 | vim.Comment("","最小化窗口") 85 | vim.Comment("","还原当前窗口") 86 | vim.Comment("","全屏当前程序") 87 | vim.Comment("","切换到桌面") 88 | vim.Comment("","打开运行窗口") 89 | vim.Comment("","运行文件管理器") 90 | vim.Comment("","重启脚本") 91 | vim.Comment("","打开配置界面") 92 | vim.Comment("","复制General的热键到当前窗口") 93 | return 94 | 95 | <1>: 96 | <2>: 97 | <3>: 98 | <4>: 99 | <5>: 100 | <6>: 101 | <7>: 102 | <8>: 103 | <9>: 104 | <0>: 105 | 106 | return 107 | 108 | : 109 | reload 110 | return 111 | : 112 | send {down} 113 | return 114 | : 115 | send {up} 116 | return 117 | : 118 | send {left} 119 | return 120 | : 121 | send {right} 122 | return 123 | 124 | : 125 | vim.control("on") 126 | return 127 | 128 | : 129 | vim.control("off") 130 | return 131 | 132 | : 133 | WinGetClass,win,A 134 | vim.mode("normal",win) 135 | return 136 | 137 | : 138 | WinGetClass,win,A 139 | vim.mode("Insert",win) 140 | return 141 | 142 | : 143 | GeneralCopy() 144 | return 145 | GeneralCopy() { 146 | WinGetClass,win,A 147 | vim.copy("General",win) 148 | WinGet,Path,ProcessPath,A 149 | Splitpath,Path,,,,name 150 | Tooltip,%Name%启用VIM模式 151 | settimer,VIMOK,-1400 152 | } 153 | 154 | VIMOK: 155 | Tooltip 156 | return 157 | 158 | : 159 | Send #d 160 | return 161 | 162 | : 163 | Send #r 164 | return 165 | 166 | : 167 | Run %A_WinDir%\explorer.exe 168 | return 169 | 170 | : 171 | WindowPadMove("0, +1, 1.0, 0.5") 172 | Return 173 | : 174 | WindowPadMove("0, -1, 1.0, 0.5") 175 | Return 176 | : 177 | WindowPadMove("-1, 0, 0.5, 1.0") 178 | Return 179 | : 180 | WindowPadMove("+1, 0, 0.5, 1.0") 181 | Return 182 | : 183 | WindowPadMove("0, 0, 0.5, 0.7") 184 | return 185 | : 186 | WinMaximize,A 187 | return 188 | : 189 | WinMinimize, A 190 | return 191 | : 192 | WinRestore, A 193 | return 194 | 195 | ; 全屏当前程序 196 | : 197 | FullScreen() 198 | return 199 | FullScreen() { 200 | WinGet, windowID, ID, A 201 | WindowState := FullScreenID[windowID] 202 | If Strlen(windowState) = 0 203 | WindowState := 0 204 | If WindowState 205 | { 206 | WinSet, Style, ^0xC40000, ahk_id %WindowID% 207 | Loop,Parse,windowState,`, 208 | { 209 | If A_Index = 2 210 | WinPosX := A_LoopField 211 | If A_Index = 3 212 | WinPosY := A_LoopField 213 | If A_Index = 4 214 | WindowWidth := A_LoopField 215 | If A_Index = 5 216 | WindowHeight := A_LoopField 217 | } 218 | WinMove, ahk_id %WindowID%, , WinPosX, WinPosY, WindowWidth, WindowHeight 219 | WindowState := 0 220 | } 221 | Else 222 | { 223 | WinGetPos, WinPosX, WinPosY, WindowWidth, WindowHeight, ahk_id %WindowID% 224 | WinSet, Style, ^0xC40000, ahk_id %WindowID% 225 | WinMove, ahk_id %WindowID%, , 0, 0, A_ScreenWidth, A_ScreenHeight 226 | WindowState := 1 "," WinPosX "," WinPosY "," WindowWidth "," WindowHeight 227 | Msgbox 再按一下刚刚的热键退出全屏 228 | } 229 | FullScreenID[windowID] := WindowState 230 | } 231 | 232 | 233 | ;==================================================================================== 234 | ; 235 | ; WindowPad.ahk 236 | ; Version: 0.4 237 | ; Last Updated: 11/5/2009 238 | ; 239 | ; This file contains functions which are useful for manipulating and moving windows. 240 | ; This is a stripped down version of WindowPad v.1.56 by Lexikos. 241 | ; Downloaded from http://www.autohotkey.com/forum/topic21703.html 242 | ; 243 | 244 | WindowPadMove(P) 245 | { 246 | StringSplit, P, P, `,, %A_Space%%A_Tab% 247 | ; Params: 1:dirX, 2:dirY, 3:widthFactor, 4:heightFactor, 5:window 248 | 249 | if P1 = 250 | P1 = R 251 | if P2 = 252 | P2 = R 253 | 254 | WindowPad_WinExist(P5) 255 | 256 | if !WinExist() 257 | return 258 | 259 | ; Determine width/height factors. 260 | if (P1 or P2) { ; to a side 261 | widthFactor := P3+0 ? P3 : (P1 ? 0.5 : 1.0) 262 | heightFactor := P4+0 ? P4 : (P2 ? 0.5 : 1.0) 263 | } else { ; to center 264 | widthFactor := P3+0 ? P3 : 1.0 265 | heightFactor := P4+0 ? P4 : 1.0 266 | } 267 | 268 | ; Move the window! 269 | MoveWindowInDirection(P1, P2, widthFactor, heightFactor) 270 | } 271 | 272 | MaximizeToggle(P) 273 | { 274 | WindowPad_WinExist(P) 275 | 276 | WinGet, state, MinMax 277 | if state 278 | WinRestore 279 | else 280 | WinMaximize 281 | } 282 | 283 | ; Does the grunt work of the script. 284 | MoveWindowInDirection(sideX, sideY, widthFactor, heightFactor) 285 | { 286 | WinGetPos, x, y, w, h 287 | 288 | hwnd:=WinExist() 289 | if (can_restore := GetWindowProperty(hwnd,"wpHasRestorePos")) 290 | { ; Window has restore info. Check if it is where we last put it. 291 | last_x := GetWindowProperty(hwnd,"wpLastX") 292 | last_y := GetWindowProperty(hwnd,"wpLastY") 293 | last_w := GetWindowProperty(hwnd,"wpLastW") 294 | last_h := GetWindowProperty(hwnd,"wpLastH") 295 | } 296 | if (can_restore && last_x = x && last_y = y && last_w = w && last_h = h) 297 | { ; Window is where we last put it. Check if user wants to restore. 298 | if SubStr(sideX,1,1) = "R" 299 | { ; Restore on X-axis. 300 | restore_x := GetWindowProperty(hwnd,"wpRestoreX") 301 | restore_w := GetWindowProperty(hwnd,"wpRestoreW") 302 | StringTrimLeft, sideX, sideX, 1 303 | } 304 | if SubStr(sideY,1,1) = "R" 305 | { ; Restore on Y-axis. 306 | restore_y := GetWindowProperty(hwnd,"wpRestoreY") 307 | restore_h := GetWindowProperty(hwnd,"wpRestoreH") 308 | StringTrimLeft, sideY, sideY, 1 309 | } 310 | if (restore_x != "" || restore_y != "") 311 | { ; If already at the "restored" size and position, do the normal thing instead. 312 | if ((restore_x = x || restore_x = "") && (restore_y = y || restore_y = "") 313 | && (restore_w = w || restore_w = "") && (restore_h = h || restore_h = "")) 314 | { 315 | restore_x = 316 | restore_y = 317 | restore_w = 318 | restore_h = 319 | } 320 | } 321 | } 322 | else 323 | { ; Next time user requests the window be "restored" use this position and size. 324 | SetWindowProperty(hwnd,"wpHasRestorePos",true) 325 | SetWindowProperty(hwnd,"wpRestoreX",x) 326 | SetWindowProperty(hwnd,"wpRestoreY",y) 327 | SetWindowProperty(hwnd,"wpRestoreW",w) 328 | SetWindowProperty(hwnd,"wpRestoreH",h) 329 | 330 | if SubStr(sideX,1,1) = "R" 331 | StringTrimLeft, sideX, sideX, 1 332 | if SubStr(sideY,1,1) = "R" 333 | StringTrimLeft, sideY, sideY, 1 334 | } 335 | 336 | ; If no direction specified, restore or only switch monitors. 337 | if (sideX+0 = "" && restore_x = "") 338 | restore_x := x, restore_w := w 339 | if (sideY+0 = "" && restore_y = "") 340 | restore_y := y, restore_h := h 341 | 342 | ; Determine which monitor contains the center of the window. 343 | m := GetMonitorAt(x+w/2, y+h/2) 344 | 345 | ; Get work area of active monitor. 346 | gosub CalcMonitorStats 347 | ; Calculate possible new position for window. 348 | gosub CalcNewSizeAndPosition 349 | 350 | ; If the window is already there, 351 | if (newx "," newy "," neww "," newh) = (x "," y "," w "," h) 352 | { ; ..move to the next monitor along instead. 353 | 354 | if (sideX or sideY) 355 | { ; Move in the direction of sideX or sideY. 356 | SysGet, monB, Monitor, %m% ; get bounds of entire monitor (vs. work area) 357 | x := (sideX=0) ? (x+w/2) : (sideX>0 ? monBRight : monBLeft) + sideX 358 | y := (sideY=0) ? (y+h/2) : (sideY>0 ? monBBottom : monBTop) + sideY 359 | newm := GetMonitorAt(x, y, m) 360 | } 361 | else 362 | { ; Move to center (Numpad5) 363 | newm := m+1 364 | SysGet, mon, MonitorCount 365 | if (newm > mon) 366 | newm := 1 367 | } 368 | 369 | if (newm != m) 370 | { m := newm 371 | ; Move to opposite side of monitor (left of a monitor is another monitor's right edge) 372 | sideX *= -1 373 | sideY *= -1 374 | ; Get new monitor's work area. 375 | gosub CalcMonitorStats 376 | } 377 | else 378 | { ; No monitor to move to, alternate size of window instead. 379 | if sideX 380 | widthFactor /= 2 381 | else if sideY 382 | heightFactor /= 2 383 | else 384 | widthFactor *= 1.5 385 | gosub CalcNewSizeAndPosition 386 | } 387 | 388 | ; Calculate new position for window. 389 | gosub CalcNewSizeAndPosition 390 | } 391 | 392 | ; Restore before resizing... 393 | WinGet, state, MinMax 394 | if state 395 | WinRestore 396 | 397 | WinDelay := A_WinDelay 398 | SetWinDelay, 0 399 | 400 | ; Move the window! 401 | WinMove,,, newx, newy, neww, newh 402 | 403 | ; For console windows and other windows which have size restrictions, check 404 | ; that the window was actually resized. If not, reposition based on actual size. 405 | WinGetPos, newx, newy, realw, realh 406 | if (neww != realw || newh != realh) 407 | { 408 | neww := realw 409 | newh := realh 410 | gosub CalcNewPosition 411 | if ((newm = "" || newm = m) && (newx "," newy "," realw "," realh)=(x "," y "," w "," h)) 412 | { 413 | if sideX 414 | neww //= 2 415 | else if sideY 416 | newh //= 2 417 | else 418 | neww := Round(neww*1.5) 419 | ; Size first, since the window size will probably be restricted in some way. 420 | WinMove,,,,, neww, newh 421 | WinGetPos,,, neww, newh 422 | gosub CalcNewPosition 423 | } 424 | WinMove,,, newx, newy 425 | } 426 | 427 | ; Explorer uses WM_EXITSIZEMOVE to detect when a user finishes moving a window 428 | ; in order to save the position for next time. May also be used by other apps. 429 | PostMessage, 0x232 430 | 431 | SetWinDelay, WinDelay 432 | 433 | ; Remember where we put it, to detect if the user moves it. 434 | SetWindowProperty(hwnd,"wpLastX",newx) 435 | SetWindowProperty(hwnd,"wpLastY",newy) 436 | SetWindowProperty(hwnd,"wpLastW",neww) 437 | SetWindowProperty(hwnd,"wpLastH",newh) 438 | return 439 | 440 | CalcNewSizeAndPosition: 441 | ; Calculate new size. 442 | if (IsResizable()) { 443 | neww := restore_w != "" ? restore_w : Round(monWidth * widthFactor) 444 | newh := restore_h != "" ? restore_h : Round(monHeight * heightFactor) 445 | } else { 446 | neww := w 447 | newh := h 448 | } 449 | CalcNewPosition: 450 | ; Calculate new position. 451 | newx := restore_x != "" ? restore_x : Round(monLeft + (sideX+1) * (monWidth - neww)/2) 452 | newy := restore_y != "" ? restore_y : Round(monTop + (sideY+1) * (monHeight - newh)/2) 453 | return 454 | 455 | CalcMonitorStats: 456 | ; Get work area (excludes taskbar-reserved space.) 457 | SysGet, mon, MonitorWorkArea, %m% 458 | monWidth := monRight - monLeft 459 | monHeight := monBottom - monTop 460 | return 461 | } 462 | 463 | ; Get/set window property. type should be int, uint or float. 464 | GetWindowProperty(hwnd, property_name, type="int") { 465 | return DllCall("GetProp", "uint", hwnd, "str", property_name, type) 466 | } 467 | SetWindowProperty(hwnd, property_name, data, type="int") { 468 | return DllCall("SetProp", "uint", hwnd, "str", property_name, type, data) 469 | } 470 | 471 | ; Get the index of the monitor containing the specified x and y co-ordinates. 472 | GetMonitorAt(x, y, default=1) 473 | { 474 | SysGet, m, MonitorCount 475 | ; Iterate through all monitors. 476 | Loop, %m% 477 | { ; Check if the window is on this monitor. 478 | SysGet, Mon, Monitor, %A_Index% 479 | if (x >= MonLeft && x <= MonRight && y >= MonTop && y <= MonBottom) 480 | return A_Index 481 | } 482 | 483 | return default 484 | } 485 | 486 | IsResizable() 487 | { 488 | WinGetClass, Class 489 | if Class = Chrome_XPFrame 490 | return true 491 | if Class = ConsoleWindowClass 492 | return false 493 | WinGet, Style, Style 494 | return (Style & 0x40000) ; WS_SIZEBOX 495 | } 496 | 497 | WindowPad_WinExist(WinTitle) 498 | { 499 | if WinTitle = P 500 | return WinPreviouslyActive() 501 | if WinTitle = M 502 | { 503 | MouseGetPos,,, win 504 | return WinExist("ahk_id " win) 505 | } 506 | return WinExist(WinTitle!="" ? WinTitle : "A") 507 | } 508 | 509 | ; Note: This may not work properly with always-on-top windows. (Needs testing) 510 | WinPreviouslyActive() 511 | { 512 | active := WinActive("A") 513 | WinGet, win, List 514 | 515 | ; Find the active window. 516 | ; (Might not be win1 if there are always-on-top windows?) 517 | Loop, %win% 518 | if (win%A_Index% = active) 519 | { 520 | if (A_Index < win) 521 | N := A_Index+1 522 | 523 | ; hack for PSPad: +1 seems to get the document (child!) window, so do +2 524 | ifWinActive, ahk_class TfPSPad 525 | N += 1 526 | 527 | break 528 | } 529 | 530 | ; Use WinExist to set Last Found Window (for consistency with WinActive()) 531 | return WinExist("ahk_id " . win%N%) 532 | } 533 | 534 | 535 | ; 536 | ; Switch without moving/resizing (relative to screen) 537 | ; 538 | WindowScreenMove(P) 539 | { 540 | SetWinDelay, 0 541 | 542 | StringSplit, P, P, `,, %A_Space%%A_Tab% 543 | ; 1:Next|Prev|Num, 2:Window 544 | 545 | WindowPad_WinExist(P2) 546 | 547 | WinGet, state, MinMax 548 | if state = 1 549 | WinRestore 550 | 551 | WinGetPos, x, y, w, h 552 | 553 | ; Determine which monitor contains the center of the window. 554 | ms := GetMonitorAt(x+w/2, y+h/2) 555 | 556 | SysGet, mc, MonitorCount 557 | 558 | ; Determine which monitor to move to. 559 | if P1 in ,N,Next 560 | { 561 | md := ms+1 562 | if (md > mc) 563 | md := 1 564 | } 565 | else if P1 in P,Prev,Previous 566 | { 567 | md := ms-1 568 | if (md < 1) 569 | md := mc 570 | } 571 | else if P1 is integer 572 | md := P1 573 | 574 | if (md=ms or (md+0)="" or md<1 or md>mc) 575 | return 576 | 577 | ; Get source and destination work areas (excludes taskbar-reserved space.) 578 | SysGet, ms, MonitorWorkArea, %ms% 579 | SysGet, md, MonitorWorkArea, %md% 580 | msw := msRight - msLeft, msh := msBottom - msTop 581 | mdw := mdRight - mdLeft, mdh := mdBottom - mdTop 582 | 583 | ; Calculate new size. 584 | if (IsResizable()) { 585 | w := Round(w*(mdw/msw)) 586 | h := Round(h*(mdh/msh)) 587 | } 588 | 589 | ; Move window, using resolution difference to scale co-ordinates. 590 | WinMove,,, mdLeft + (x-msLeft)*(mdw/msw), mdTop + (y-msTop)*(mdh/msh), w, h 591 | 592 | if state = 1 593 | WinMaximize 594 | } 595 | 596 | 597 | ; 598 | ; "Gather" windows on a specific screen. 599 | ; 600 | GatherWindows(md=1) 601 | { 602 | global ProcessGatherExcludeList 603 | 604 | SetWinDelay, 0 605 | 606 | ; List all visible windows. 607 | WinGet, win, List 608 | 609 | ; Copy bounds of all monitors to an array. 610 | SysGet, mc, MonitorCount 611 | Loop, %mc% 612 | SysGet, mon%A_Index%, MonitorWorkArea, %A_Index% 613 | 614 | if md = M 615 | { ; Special exception for 'M', since the desktop window 616 | ; spreads across all screens. 617 | CoordMode, Mouse, Screen 618 | MouseGetPos, x, y 619 | md := GetMonitorAt(x, y, 0) 620 | } 621 | else if md is not integer 622 | { ; Support A, P and WinTitle. 623 | ; (Gather at screen containing specified window.) 624 | WindowPad_WinExist(md) 625 | WinGetPos, x, y, w, h 626 | md := GetMonitorAt(x+w/2, y+h/2, 0) 627 | } 628 | if (md<1 or md>mc) 629 | return 630 | 631 | ; Destination monitor 632 | mdx := mon%md%Left 633 | mdy := mon%md%Top 634 | mdw := mon%md%Right - mdx 635 | mdh := mon%md%Bottom - mdy 636 | 637 | Loop, %win% 638 | { 639 | ; If this window matches the GatherExclude group, don't touch it. 640 | if (WinExist("ahk_group GatherExclude ahk_id " . win%A_Index%)) 641 | continue 642 | 643 | ; Set Last Found Window. 644 | if (!WinExist("ahk_id " . win%A_Index%)) 645 | continue 646 | 647 | WinGet, procname, ProcessName 648 | ; Check process (program) exclusion list. 649 | if procname in %ProcessGatherExcludeList% 650 | continue 651 | 652 | WinGetPos, x, y, w, h 653 | 654 | ; Determine which monitor this window is on. 655 | xc := x+w/2, yc := y+h/2 656 | ms := 0 657 | Loop, %mc% 658 | if (xc >= mon%A_Index%Left && xc <= mon%A_Index%Right 659 | && yc >= mon%A_Index%Top && yc <= mon%A_Index%Bottom) 660 | { 661 | ms := A_Index 662 | break 663 | } 664 | ; If already on destination monitor, skip this window. 665 | if (ms = md) 666 | continue 667 | 668 | WinGet, state, MinMax 669 | if (state = 1) { 670 | WinRestore 671 | WinGetPos, x, y, w, h 672 | } 673 | 674 | if ms 675 | { 676 | ; Source monitor 677 | msx := mon%ms%Left 678 | msy := mon%ms%Top 679 | msw := mon%ms%Right - msx 680 | msh := mon%ms%Bottom - msy 681 | 682 | ; If the window is resizable, scale it by the monitors' resolution difference. 683 | if (IsResizable()) { 684 | w *= (mdw/msw) 685 | h *= (mdh/msh) 686 | } 687 | 688 | ; Move window, using resolution difference to scale co-ordinates. 689 | WinMove,,, mdx + (x-msx)*(mdw/msw), mdy + (y-msy)*(mdh/msh), w, h 690 | } 691 | else 692 | { ; Window not on any monitor, move it to center. 693 | WinMove,,, mdx + (mdw-w)/2, mdy + (mdh-h)/2 694 | } 695 | 696 | if state = 1 697 | WinMaximize 698 | } 699 | } 700 | 701 | GetLastMinimizedWindow() 702 | { 703 | WinGet, w, List 704 | 705 | Loop %w% 706 | { 707 | wi := w%A_Index% 708 | WinGet, m, MinMax, ahk_id %wi% 709 | if m = -1 ; minimized 710 | { 711 | lastFound := wi 712 | break 713 | } 714 | } 715 | 716 | return "ahk_id " . (lastFound ? lastFound : 0) 717 | } 718 | 719 | 720 | ;================================== 功能代码 :由北风一叶提供 721 | ;下一个标签 722 | : 723 | send ^{tab} 724 | return 725 | 726 | ;上一个标签 727 | : 728 | send ^+{tab} 729 | return 730 | 731 | ;关闭当前标签 732 | : 733 | send ^{w} 734 | return 735 | 736 | ;新建标签 737 | : 738 | send ^{t} 739 | return 740 | 741 | ;激活第一个标签 742 | : 743 | send ^{1} 744 | return 745 | 746 | ;激活第二个标签 747 | : 748 | send ^{2} 749 | return 750 | 751 | ;激活第三个标签 752 | : 753 | send ^{3} 754 | return 755 | 756 | ;激活第四个标签 757 | : 758 | send ^{4} 759 | return 760 | 761 | ;激活第五个标签 762 | : 763 | send ^{5} 764 | return 765 | 766 | ;激活第六个标签 767 | : 768 | send ^{6} 769 | return 770 | 771 | ;激活第七个标签 772 | : 773 | send ^{7} 774 | return 775 | 776 | ;激活第八个标签 777 | : 778 | send ^{8} 779 | return 780 | 781 | ;激活第九个标签 782 | : 783 | send ^{8}^{tab} 784 | return 785 | 786 | ;激活最后一个标签 787 | : 788 | send ^{9} 789 | return 790 | -------------------------------------------------------------------------------- /src/VimDesktop/Plugins/plugins.ahk: -------------------------------------------------------------------------------- 1 | #include %A_ScriptDir%\plugins\General\General.ahk 2 | #include %A_ScriptDir%\plugins\totalcommander\totalcommander.ahk 3 | #include %A_ScriptDir%\plugins\wps\wps.ahk 4 | /* 5 | [ExtensionsTime] 6 | General=20131216115124 7 | totalcommander=20131218101631 8 | wps=20131216111856 9 | */ 10 | -------------------------------------------------------------------------------- /src/VimDesktop/Plugins/totalcommander/a-zhistory.icl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/victorwoo/vimdesktop/c88538ffe486bfbc6eb9e563826a5ac1ac7d58bf/src/VimDesktop/Plugins/totalcommander/a-zhistory.icl -------------------------------------------------------------------------------- /src/VimDesktop/Plugins/totalcommander/totalcommander.ahk: -------------------------------------------------------------------------------- 1 | totalcommander: 2 | ;======================================================= 3 | If not fileexist(A_ScriptDir "\plugins\totalcommander\totalcommander.ini") 4 | fileAppend,,%A_ScriptDir%\plugins\totalcommander\totalcommander.ini 5 | Global tcconfig := GetINIObj(A_ScriptDir "\plugins\totalcommander\totalcommander.ini") 6 | Global TCPath := tcconfig.GetValue("Config","TCPath") 7 | Global TCINI := tcconfig.GetValue("Config","TCINI") 8 | Global TCINIObj 9 | If Not FileExist(TCPath) 10 | { 11 | RegRead,TCDir,HKEY_CURRENT_USER,Software\Ghisler\Total Commander,InstallDir 12 | If FileExist(TCDir "\totalcmd.exe") 13 | l .= TCDir "\totalcmd.exe`n" 14 | If FileExist(TCDir "\totalcmd64.exe") 15 | l .= TCDir "\totalcmd64.exe`n" 16 | GUI,FindTC:Add,Edit,w300 ReadOnly R3,%TCDir% 17 | GUI,FindTC:Add,Button,w300 gTotalcomander_select_tc,TOTALCMD.EXE (&A) 18 | GUI,FindTC:Add,Button,w300 gTotalcomander_select_tc64,TOTALCMD64.EXE (&S) 19 | GUI,FindTC:Add,Button,w300 gTotalcomander_select_tcdir,TC目录路径不对? (&D) 20 | GUI,FindTC:Show,,Total Commander 设置路径 21 | } 22 | If not FileExist(TCINI) 23 | { 24 | SplitPath,TCPath,,dir 25 | TCINI := dir "\wincmd.ini" 26 | IniWrite,%TCINI%,%A_ScriptDir%\plugins\totalcommander\totalcommander.ini,config,tcini 27 | } 28 | tciniobj := GetINIObj(TCINI) 29 | If RegExMatch(TcPath,"i)totalcmd64\.exe$") 30 | { 31 | Global TCListBox := "LCLListBox" 32 | Global TCEdit := "Edit2" 33 | Global TInEdit := "TInEdit1" 34 | GLobal TCPanel1 := "Window1" 35 | Global TCPanel2 := "Window11" 36 | } 37 | Else 38 | { 39 | Global TCListBox := "TMyListBox" 40 | Global TCEdit := "Edit1" 41 | Global TInEdit := "TInEdit1" 42 | Global TCPanel1 := "TPanel1" 43 | Global TCPanel2 := "TMyPanel8" 44 | } 45 | Global Mark := [] 46 | Global NewFiles := [] 47 | vim.Comment("","返回正常模式") 48 | vim.Comment("","进入插入模式") 49 | vim.Comment("","打开/激活TC") 50 | 51 | vim.Comment("","a-z历史导航") 52 | vim.Comment("","向下选择") 53 | vim.Comment("","向上选择") 54 | vim.Comment("","标记功能") 55 | vim.Comment("","强制删除") 56 | vim.Comment("","显示标记") 57 | vim.Comment("","最大化左侧窗口") 58 | vim.Comment("","最大化右侧窗口") 59 | vim.Comment("","切换到最后一个标签") 60 | vim.Comment("","只复制文件名,不含扩展名") 61 | vim.Comment("","移动到[count]行,默认第一行") 62 | vim.Comment("","移动到[count]行,默认最后一行") 63 | vim.Comment("","移动到窗口中间行") 64 | vim.Comment("","文件模板") 65 | vim.Comment("","返回到上层文件夹,可返回到我的电脑") 66 | vim.Comment("","设置TC顶置") 67 | vim.comment("","打开驱动器列表:本侧") 68 | vim.comment("","打开驱动器列表:另侧") 69 | vim.comment("","移动到常用文件夹") 70 | vim.comment("","复制到常用文件夹") 71 | vim.comment("","后退另一侧") 72 | vim.comment("","前进另一侧") 73 | vim.comment("","连续搜索") 74 | 75 | 76 | vim.mode("normal","TQUICKSEARCH") 77 | vim.map("J","","TQUICKSEARCH") 78 | vim.map("K","","TQUICKSEARCH") 79 | ;vim.map("H","o","") 80 | ;vim.map("H","O","") 81 | ;vim.map("","","TQUICKSEARCH") 82 | 83 | vim.mode("insert","TTOTAL_CMD") 84 | vim.SetTimeOut(800,"TTOTAL_CMD") 85 | vim.map("","","TTOTAL_CMD") 86 | vim.mode("Search","TTOTAL_CMD") 87 | vim.map("","","TTOTAL_CMD") 88 | 89 | vim.mode("normal","TTOTAL_CMD") 90 | ;复制/移动到右侧 f取file的意思 filecopy 91 | vim.map("fc","","TTOTAL_CMD") 92 | vim.map("fx","","TTOTAL_CMD") 93 | ;ff复制到剪切板 fz剪切到剪切板 fv粘贴 94 | vim.map("ff","","TTOTAL_CMD") 95 | vim.map("fz","","TTOTAL_CMD") 96 | vim.map("fv","","TTOTAL_CMD") 97 | ;fb复制到收藏夹某个目录,fd移动到收藏夹的某个目录 98 | vim.map("fb","","TTOTAL_CMD") 99 | vim.map("fd","","TTOTAL_CMD") 100 | vim.map("ft","","TTOTAL_CMD") 101 | vim.map("f","","TTOTAL_CMD") 102 | vim.map("gh","","TTOTAL_CMD") 103 | vim.map("gl","","TTOTAL_CMD") 104 | vim.map("vh","","TTOTAL_CMD") 105 | vim.map("0","<0>","TTOTAL_CMD") 106 | vim.map("1","<1>","TTOTAL_CMD") 107 | vim.map("2","<2>","TTOTAL_CMD") 108 | vim.map("3","<3>","TTOTAL_CMD") 109 | vim.map("4","<4>","TTOTAL_CMD") 110 | vim.map("5","<5>","TTOTAL_CMD") 111 | vim.map("6","<6>","TTOTAL_CMD") 112 | vim.map("7","<7>","TTOTAL_CMD") 113 | vim.map("8","<8>","TTOTAL_CMD") 114 | vim.map("9","<9>","TTOTAL_CMD") 115 | vim.map("k","","TTOTAL_CMD") 116 | vim.map("K","","TTOTAL_CMD") 117 | vim.map("j","","TTOTAL_CMD") 118 | vim.map("J","","TTOTAL_CMD") 119 | vim.map("h","","TTOTAL_CMD") 120 | vim.map("H","","TTOTAL_CMD") 121 | vim.map("l","","TTOTAL_CMD") 122 | vim.map("L","","TTOTAL_CMD") 123 | vim.map("I","","TTOTAL_CMD") 124 | vim.map("i","","TTOTAL_CMD") 125 | vim.map("d","","TTOTAL_CMD") 126 | vim.map("D","","TTOTAL_CMD") 127 | vim.map("e","","TTOTAL_CMD") 128 | vim.map("E","","TTOTAL_CMD") 129 | vim.map("N","","TTOTAL_CMD") 130 | vim.map("n","","TTOTAL_CMD") 131 | vim.map("m","","TTOTAL_CMD") 132 | vim.map("M","","TTOTAL_CMD") 133 | vim.map("'","","TTOTAL_CMD") 134 | vim.map("u","","TTOTAL_CMD") 135 | vim.map("U","","TTOTAL_CMD") 136 | vim.map("o","","TTOTAL_CMD") 137 | vim.map("O","","TTOTAL_CMD") 138 | vim.map("q","","TTOTAL_CMD") 139 | vim.map("r","","TTOTAL_CMD") 140 | vim.map("R","","TTOTAL_CMD") 141 | vim.map("x","","TTOTAL_CMD") 142 | vim.map("X","","TTOTAL_CMD") 143 | vim.map("w","","TTOTAL_CMD") 144 | vim.map("y","","TTOTAL_CMD") 145 | vim.map("Y","","TTOTAL_CMD") 146 | vim.map("P","","TTOTAL_CMD") 147 | vim.map("p","","TTOTAL_CMD") 148 | vim.map("t","","TTOTAL_CMD") 149 | vim.map("T","","TTOTAL_CMD") 150 | vim.map("/","","TTOTAL_CMD") 151 | vim.map("?","","TTOTAL_CMD") 152 | vim.map("[","","TTOTAL_CMD") 153 | vim.map("{","","TTOTAL_CMD") 154 | vim.map("]","","TTOTAL_CMD") 155 | vim.map("}","","TTOTAL_CMD") 156 | vim.map("\","","TTOTAL_CMD") 157 | vim.map("|","","TTOTAL_CMD") 158 | vim.map("-","","TTOTAL_CMD") 159 | vim.map("=","","TTOTAL_CMD") 160 | vim.map(":","","TTOTAL_CMD") 161 | vim.map("G","","TTOTAL_CMD") 162 | vim.map("ga","","TTOTAL_CMD") 163 | vim.map("gg","","TTOTAL_CMD") 164 | vim.map("g$","","TTOTAL_CMD") 165 | vim.map("gn","","TTOTAL_CMD") 166 | vim.map("gp","","TTOTAL_CMD") 167 | vim.map("gc","","TTOTAL_CMD") 168 | vim.map("gb","","TTOTAL_CMD") 169 | vim.map("ge","","TTOTAL_CMD") 170 | vim.map("gw","","TTOTAL_CMD") 171 | vim.map("g1","","TTOTAL_CMD") 172 | vim.map("g2","","TTOTAL_CMD") 173 | vim.map("g3","","TTOTAL_CMD") 174 | vim.map("g4","","TTOTAL_CMD") 175 | vim.map("g5","","TTOTAL_CMD") 176 | vim.map("g6","","TTOTAL_CMD") 177 | vim.map("g7","","TTOTAL_CMD") 178 | vim.map("g8","","TTOTAL_CMD") 179 | vim.map("g9","","TTOTAL_CMD") 180 | vim.map("g0","","TTOTAL_CMD") 181 | vim.map("sn","","TTOTAL_CMD") 182 | vim.map("se","","TTOTAL_CMD") 183 | vim.map("ss","","TTOTAL_CMD") 184 | vim.map("sd","","TTOTAL_CMD") 185 | vim.map("sr","","TTOTAL_CMD") 186 | vim.map("s1","","TTOTAL_CMD") 187 | vim.map("s2","","TTOTAL_CMD") 188 | vim.map("s3","","TTOTAL_CMD") 189 | vim.map("s4","","TTOTAL_CMD") 190 | vim.map("s5","","TTOTAL_CMD") 191 | vim.map("s6","","TTOTAL_CMD") 192 | vim.map("s7","","TTOTAL_CMD") 193 | vim.map("s8","","TTOTAL_CMD") 194 | vim.map("s9","","TTOTAL_CMD") 195 | vim.map("s0","","TTOTAL_CMD") 196 | vim.map("v","","TTOTAL_CMD") 197 | vim.map("Vb","","TTOTAL_CMD") 198 | vim.map("Vd","","TTOTAL_CMD") 199 | vim.map("Vo","","TTOTAL_CMD") 200 | vim.map("Vr","","TTOTAL_CMD") 201 | vim.map("Vc","","TTOTAL_CMD") 202 | vim.map("Vt","","TTOTAL_CMD") 203 | vim.map("Vs","","TTOTAL_CMD") 204 | vim.map("Vn","","TTOTAL_CMD") 205 | vim.map("Vf","","TTOTAL_CMD") 206 | vim.map("Vw","","TTOTAL_CMD") 207 | vim.map("Ve","","TTOTAL_CMD") 208 | vim.map("zz","","TTOTAL_CMD") 209 | vim.map("zi","","TTOTAL_CMD") 210 | vim.map("zo","","TTOTAL_CMD") 211 | vim.map("zt","","TTOTAL_CMD") 212 | vim.map("zn","","TTOTAL_CMD") 213 | vim.map("zm","","TTOTAL_CMD") 214 | vim.map("zr","","TTOTAL_CMD") 215 | vim.map("zv","","TTOTAL_CMD") 216 | vim.map("zv","","TTOTAL_CMD") 217 | vim.map(".","","TTOTAL_CMD") 218 | /* 219 | ;vim.map("zs","","TTOTAL_CMD") 220 | KeyList := vim.listKey("TTOTAL_CMD") 221 | GUI,Add,ListView,w300 h500,a 222 | Loop,Parse,KeyList,`n 223 | { 224 | LV_Add("",A_LoopField) 225 | } 226 | GUI,Show ,w310 h510 227 | */ 228 | ;; 默认按键完 229 | ReadNewFile() 230 | GoSub,TCCOMMAND 231 | return 232 | : 233 | : 234 | : 235 | : 236 | : 237 | : 238 | : 239 | : 240 | : 241 | : 242 | Vim_HotKeyCount := 243 | return 244 | ; TTOTAL_CMD_CheckMode() 245 | TTOTAL_CMD_CheckMode() 246 | { 247 | WinGet,MenuID,ID,AHK_CLASS #32768 248 | If MenuID 249 | return True 250 | ControlGetFocus,ctrl,AHK_CLASS TTOTAL_CMD 251 | ; If RegExMatch(ctrl,TInEdit) 252 | ; Return True 253 | ; If RegExMatch(ctrl,TCEdit) 254 | ; Return True 255 | Ifinstring,ctrl,%TCListBox% 256 | Return False 257 | Return True 258 | } 259 | : 260 | Tooltip 261 | return 262 | ; {{{1 263 | : 264 | Send,{Esc} 265 | vim.Mode("normal","TTOTAL_CMD") 266 | ;emptymem() 267 | return 268 | ; {{{1 269 | : 270 | vim.Mode("Search","TTOTAL_CMD") 271 | return 272 | ; {{{1 273 | : 274 | vim.Mode("insert","TTOTAL_CMD") 275 | return 276 | ; {{{1 277 | : 278 | IfWinExist,AHK_CLASS TTOTAL_CMD 279 | { 280 | WinGet,AC,MinMax,AHK_CLASS TTOTAL_CMD 281 | If Ac = -1 282 | Winactivate,AHK_ClASS TTOTAL_CMD 283 | Else 284 | Ifwinnotactive,AHK_CLASS TTOTAL_CMD 285 | Winactivate,AHK_CLASS TTOTAL_CMD 286 | Else 287 | Winminimize,AHK_CLASS TTOTAL_CMD 288 | } 289 | Else 290 | { 291 | Run,%TCPath% 292 | Loop,4 293 | { 294 | IfWinNotActive,AHK_CLASS TTOTAL_CMD 295 | WinActivate,AHK_CLASS TTOTAL_CMD 296 | Else 297 | Break 298 | Sleep,500 299 | } 300 | } 301 | ;settimer,AUTHTC,on 302 | ;emptymem() 303 | return 304 | AUTHTC: 305 | AUTHTC() 306 | return 307 | AUTHTC() 308 | { 309 | WinGetText, string,ahk_class TNASTYNAGSCREEN 310 | If Strlen(string) 311 | { 312 | RegExMatch(string,"\d",idx) 313 | ControlClick,TButton%idx%,ahk_class TNASTYNAGSCREEN,,,,NA 314 | ;msgbox % idx 315 | settimer,AUTHTC,off 316 | } 317 | } 318 | ; {{{1 319 | : 320 | azHistory2() 321 | return 322 | azHistory2() 323 | { 324 | GoSub, 325 | sleep,200 326 | history := "" 327 | If Mod(LeftRight(),2) 328 | { 329 | If FileExist(f := tcconfig.GetValue("redirect","LeftHistory")) 330 | IniRead,history,%f%,LeftHistory 331 | Else 332 | IniRead,history,%TCINI%,LeftHistory 333 | } 334 | Else 335 | { 336 | If FileExist(f := tcconfig.GetValue("redirect","RightHistory")) 337 | IniRead,history,%f%,RightHistory 338 | Else 339 | IniRead,history,%TCINI%,RightHistory 340 | } 341 | history_obj := [] 342 | Global history_name_obj := [] 343 | Loop,Parse,history,`n 344 | max := A_index 345 | Loop,Parse,history,`n 346 | { 347 | idx := RegExReplace(A_LoopField,"=.*$") 348 | value := RegExReplace(A_LoopField,"^\d\d?=") 349 | name := value 350 | If RegExMatch(Value,"::\{20D04FE0\-3AEA\-1069\-A2D8\-08002B30309D\}\|") 351 | { 352 | name := RegExReplace(Value,"::\{20D04FE0\-3AEA\-1069\-A2D8\-08002B30309D\}\|") 353 | value := 2122 354 | } 355 | If RegExMatch(Value,"::\|") 356 | { 357 | name := RegExReplace(Value,"::\|") 358 | value := 2121 359 | } 360 | If RegExMatch(Value,"::\{21EC2020\-3AEA\-1069\-A2DD\-08002B30309D\}\\::\{2227A280\-3AEA\-1069\-A2DE\-08002B30309D\}\|") 361 | { 362 | name := RegExReplace(Value,"::\{21EC2020\-3AEA\-1069\-A2DD\-08002B30309D\}\\::\{2227A280\-3AEA\-1069\-A2DE\-08002B30309D\}\|") 363 | value := 2126 364 | } 365 | If RegExMatch(Value,"::\{F02C1A0D\-BE21\-4350\-88B0\-7367FC96EF3C\}\|") 366 | { 367 | name := RegExReplace(Value,"::\{F02C1A0D\-BE21\-4350\-88B0\-7367FC96EF3C\}\|") 368 | value := 2125 369 | } 370 | If RegExMatch(Value,"::\{26EE0668\-A00A\-44D7\-9371\-BEB064C98683\}\\0\|") 371 | { 372 | name := RegExReplace(Value,"::\{26EE0668\-A00A\-44D7\-9371\-BEB064C98683\}\\0\|") 373 | value := 2123 374 | } 375 | If RegExMatch(Value,"::\{645FF040\-5081\-101B\-9F08\-00AA002F954E\}\|") 376 | { 377 | name := RegExReplace(Value,"::\{645FF040\-5081\-101B\-9F08\-00AA002F954E\}\|") 378 | value := 2127 379 | } 380 | name .= A_Tab "[&" chr(max-idx+64) "]" 381 | history_obj[idx] := name 382 | history_name_obj[name] := value 383 | } 384 | Menu,az,UseErrorLevel 385 | Menu,az,add 386 | Menu,az,deleteall 387 | Loop,%max% 388 | { 389 | idx := max - A_Index 390 | name := history_obj[idx] 391 | Menu,az,Add,%name%,azHistorySelect 392 | Menu,az,icon,%name%,%A_ScriptDir%\plugins\totalcommander\a-zhistory.icl,%A_Index% 393 | } 394 | ControlGetFocus,TLB,ahk_class TTOTAL_CMD 395 | ControlGetPos,xn,yn,wn,,%TLB%,ahk_class TTOTAL_CMD 396 | Menu,az,show,%xn%,%yn% 397 | } 398 | azHistorySelect: 399 | azHistorySelect() 400 | return 401 | azHistorySelect() 402 | { 403 | Global history_name_obj 404 | If ( history_name_obj[A_ThisMenuItem] = 2122 ) or RegExMatch(A_ThisMenuItem,"::\{20D04FE0\-3AEA\-1069\-A2D8\-08002B30309D\}") 405 | GoSub, 406 | Else If ( history_name_obj[A_ThisMenuItem] = 2121 ) or RegExMatch(A_ThisMenuItem,"::(?!\{)") 407 | GoSub, 408 | Else If ( history_name_obj[A_ThisMenuItem] = 2126 ) or RegExMatch(A_ThisMenuItem,"::\{21EC2020\-3AEA\-1069\-A2DD\-08002B30309D\}\\::\{2227A280\-3AEA\-1069\-A2DE\-08002B30309D\}") 409 | GoSub, 410 | Else If ( history_name_obj[A_ThisMenuItem] = 2125 ) or RegExMatch(A_ThisMenuItem,"::\{F02C1A0D\-BE21\-4350\-88B0\-7367FC96EF3C\}") 411 | GoSub, 412 | Else If ( history_name_obj[A_ThisMenuItem] = 2123 ) or RegExMatch(A_ThisMenuItem,"::\{26EE0668\-A00A\-44D7\-9371\-BEB064C98683\}\\0") 413 | GoSub, 414 | Else If ( history_name_obj[A_ThisMenuItem] = 2127 ) or RegExMatch(A_ThisMenuItem,"::\{645FF040\-5081\-101B\-9F08\-00AA002F954E\}") 415 | GoSub, 416 | Else 417 | { 418 | ThisMenuItem := RegExReplace(A_ThisMenuItem,"\t.*$") 419 | ControlSetText,%TCEdit%,cd %ThisMenuItem%,ahk_class TTOTAL_CMD 420 | ControlSend,%TCEdit%,{enter},ahk_class TTOTAL_CMD 421 | } 422 | } 423 | ; {{{1 424 | : 425 | Send +{Down} 426 | return 427 | ; {{{1 428 | : 429 | Send +{Up} 430 | return 431 | ; {{{1 432 | : 433 | WinMaxLR(true) 434 | Return 435 | ; {{{1 436 | : 437 | WinMaxLR(false) 438 | Return 439 | WinMaxLR(lr) 440 | { 441 | If lr 442 | { 443 | ControlGetPos,x,y,w,h,%TCPanel2%,ahk_class TTOTAL_CMD 444 | ControlGetPos,tm1x,tm1y,tm1W,tm1H,%TCPanel1%,ahk_class TTOTAL_CMD 445 | If (tm1w < tm1h) ; 判断纵向还是横向 Ture为竖 false为横 446 | { 447 | ControlMove,%TCPanel1%,x+w,,,,ahk_class TTOTAL_CMD 448 | } 449 | else 450 | ControlMove,%TCPanel1%,0,y+h,,,ahk_class TTOTAL_CMD 451 | ControlClick, %TCPanel1%,ahk_class TTOTAL_CMD 452 | WinActivate ahk_class TTOTAL_CMD 453 | } 454 | Else 455 | { 456 | ControlMove,%TCPanel1%,0,0,,,ahk_class TTOTAL_CMD 457 | ControlClick,%TCPanel1%,ahk_class TTOTAL_CMD 458 | WinActivate ahk_class TTOTAL_CMD 459 | } 460 | } 461 | ; {{{1 462 | : 463 | GoSub, 464 | GoSub, 465 | return 466 | ; {{{1 467 | : 468 | CopyNameOnly() 469 | Return 470 | CopyNameOnly() 471 | { 472 | clipboard := 473 | GoSub, 474 | ClipWait 475 | If Not RegExMatch(clipboard,"^\..*") 476 | clipboard := RegExReplace(RegExReplace(clipboard,"\\$"),"\.[^\.]*$") 477 | } 478 | ; {{{1 479 | ; 强制删除 480 | : 481 | Send +{Delete} 482 | return 483 | ; {{{1 484 | ; 转到[count]行,缺省第一行 485 | : 486 | ; TODO: 是否需要? Vim_HotKeyCount := vim.GetCount() 487 | If ( count := vim.GetCount()) > 1 488 | GotoLine(count) 489 | Else 490 | GotoLine(1) 491 | return 492 | ; {{{1 493 | ; 转到[count]行, 最后一行 494 | : 495 | ; TODO: 是否需要? Vim_HotKeyCount := vim.GetCount() 496 | If ( count := vim.GetCount()) > 1 497 | GotoLine(count) 498 | Else 499 | GotoLine(0) 500 | return 501 | GotoLine(Index) 502 | { 503 | Vim_HotKeyCount := 0 504 | ControlGetFocus,Ctrl,AHK_CLASS TTOTAL_CMD 505 | If Index 506 | { 507 | ;Index-- 508 | ControlGet,text,List,,%ctrl%,AHK_CLASS TTOTAL_CMD 509 | Stringsplit,T,Text,`n 510 | Last := T0 - 1 511 | If Index > %Last% 512 | Index := Last 513 | Postmessage,0x19E,%Index%,1,%Ctrl%,AHK_CLASS TTOTAL_CMD 514 | } 515 | Else 516 | { 517 | ControlGet,text,List,,%ctrl%,AHK_CLASS TTOTAL_CMD 518 | Stringsplit,T,Text,`n 519 | Last := T0 - 1 520 | PostMessage, 0x19E, %Last% , 1 , %CTRL%, AHK_CLASS TTOTAL_CMD 521 | } 522 | } 523 | ; {{{1 524 | ; 移动到窗口中间 525 | : 526 | Half() 527 | Return 528 | Half() 529 | { 530 | winget,tid,id,ahk_class TTOTAL_CMD 531 | controlgetfocus,ctrl,ahk_id %tid% 532 | controlget,cid,hwnd,,%ctrl%,ahk_id %tid% 533 | controlgetpos,x1,y1,w1,h1,THeaderClick2,ahk_id %tid% 534 | controlgetpos,x,y,w,h,%ctrl%,ahk_id %tid% 535 | SendMessage,0x01A1,1,0,,ahk_id %cid% 536 | Hight := ErrorLevel 537 | SendMessage,0x018E,0,0,,ahk_id %cid% 538 | Top := ErrorLevel 539 | HalfLine := Ceil( ((h-h1)/Hight)/2 ) + Top 540 | PostMessage, 0x19E, %HalfLine%, 1, , AHK_id %cid% 541 | } 542 | ; {{{1 543 | ; 标记功能 544 | : 545 | Mark() 546 | Return 547 | Mark() 548 | { 549 | vim.mode("insert") 550 | GoSub, 551 | ControlGet,EditId,Hwnd,,AHK_CLASS TTOTAL_CMD 552 | ControlSetText,%TCEdit%,m,AHK_CLASS TTOTAL_CMD 553 | Postmessage,0xB1,2,2,%TCEdit%,AHK_CLASS TTOTAL_CMD 554 | SetTimer,,100 555 | } 556 | : 557 | MarkTimer() 558 | Return 559 | MarkTimer() 560 | { 561 | ControlGetFocus,ThisControl,AHK_CLASS TTOTAL_CMD 562 | ControlGetText,OutVar,%TCEdit%,AHK_CLASS TTOTAL_CMD 563 | Match_TCEdit := "i)^" . TCEdit . "$" 564 | If Not RegExMatch(ThisControl,Match_TCEdit) OR Not RegExMatch(Outvar,"i)^m.?") 565 | { 566 | vim.mode("normal") 567 | Settimer,,Off 568 | Return 569 | } 570 | If RegExMatch(OutVar,"i)^m.+") 571 | { 572 | vim.mode("normal") 573 | SetTimer,,off 574 | ControlSetText,%TCEdit%,,AHK_CLASS TTOTAL_CMD 575 | ControlSend,%TCEdit%,{Esc},AHK_CLASS TTOTAL_CMD 576 | ClipSaved := ClipboardAll 577 | Clipboard := 578 | Postmessage 1075, 2029, 0, , ahk_class TTOTAL_CMD 579 | ClipWait 580 | Path := Clipboard 581 | Clipboard := ClipSaved 582 | If StrLen(Path) > 80 583 | { 584 | SplitPath,Path,,PathDir 585 | Path1 := SubStr(Path,1,15) 586 | Path2 := SubStr(Path,RegExMatch(Path,"\\[^\\]*$")-Strlen(Path)) 587 | Path := Path1 . "..." . SubStr(Path2,1,65) "..." 588 | } 589 | M := SubStr(OutVar,2,1) 590 | mPath := "&" . m . ">>" . Path 591 | If RegExMatch(Mark["ms"],m) 592 | { 593 | DelM := Mark[m] 594 | Menu,MarkMenu,Delete,%DelM% 595 | Menu,MarkMenu,Add,%mPath%, 596 | Mark["ms"] := Mark["ms"] . m 597 | Mark[m] := mPath 598 | } 599 | Else 600 | { 601 | Menu,MarkMenu,Add,%mPath%, 602 | Mark["ms"] := Mark["ms"] . m 603 | Mark[m] := mPath 604 | } 605 | } 606 | } 607 | : 608 | AddMark() 609 | Return 610 | AddMark() 611 | { 612 | ThisMenuItem := SubStr(A_ThisMenuItem,5,StrLen(A_ThisMenuItem)) 613 | If RegExMatch(ThisMenuItem,"i)\\\\桌面$") 614 | { 615 | Postmessage 1075, 2121, 0, , ahk_class TTOTAL_CMD 616 | Return 617 | } 618 | If RegExMatch(ThisMenuItem,"i)\\\\计算机$") 619 | { 620 | Postmessage 1075, 2122, 0, , ahk_class TTOTAL_CMD 621 | Return 622 | } 623 | If RegExMatch(ThisMenuItem,"i)\\\\所有控制面板项$") 624 | { 625 | Postmessage 1075, 2123, 0, , ahk_class TTOTAL_CMD 626 | Return 627 | } 628 | If RegExMatch(ThisMenuItem,"i)\\\\Fonts$") 629 | { 630 | Postmessage 1075, 2124, 0, , ahk_class TTOTAL_CMD 631 | Return 632 | } 633 | If RegExMatch(ThisMenuItem,"i)\\\\网络$") 634 | { 635 | Postmessage 1075, 2125, 0, , ahk_class TTOTAL_CMD 636 | Return 637 | } 638 | If RegExMatch(ThisMenuItem,"i)\\\\打印机$") 639 | { 640 | Postmessage 1075, 2126, 0, , ahk_class TTOTAL_CMD 641 | Return 642 | } 643 | If RegExMatch(ThisMenuItem,"i)\\\\回收站$") 644 | { 645 | Postmessage 1075, 2127, 0, , ahk_class TTOTAL_CMD 646 | Return 647 | } 648 | ControlSetText, %TCEdit%, cd %ThisMenuItem%, ahk_class TTOTAL_CMD 649 | ControlSend, %TCEdit%, {Enter}, ahk_class TTOTAL_CMD 650 | Return 651 | } 652 | ; {{{1 653 | ; 显示标记 654 | : 655 | ListMark() 656 | Return 657 | ListMark() 658 | { 659 | If Not Mark["ms"] 660 | Return 661 | ControlGetFocus,TLB,ahk_class TTOTAL_CMD 662 | ControlGetPos,xn,yn,,,%TLB%,ahk_class TTOTAL_CMD 663 | Menu,MarkMenu,Show,%xn%,%yn% 664 | } 665 | ; {{{1 666 | ; 新建文件 667 | : 668 | CreateNewFile() 669 | return 670 | CreateNewFile() 671 | { 672 | ControlGetFocus,TLB,ahk_class TTOTAL_CMD 673 | ControlGetPos,xn,yn,,,%TLB%,ahk_class TTOTAL_CMD 674 | Menu,FileTemp,Add 675 | Menu,FileTemp,DeleteAll 676 | Menu,FileTemp,Add ,0 新建文件,:CreateNewFile 677 | Menu,FileTemp,Icon,0 新建文件,%A_WinDir%\system32\Shell32.dll,-152 678 | Menu,FileTemp,Add ,1 文件夹, 679 | Menu,FileTemp,Icon,1 文件夹,%A_WinDir%\system32\Shell32.dll,4 680 | Menu,FileTemp,Add ,2 快捷方式, 681 | Menu,FileTemp,Icon,2 快捷方式,%A_WinDir%\system32\Shell32.dll,264 682 | Menu,FileTemp,Add ,3 添加到新模板, 683 | Menu,FileTemp,Icon,3 添加到新模板,%A_WinDir%\system32\Shell32.dll,-155 684 | FileTempMenuCheck() 685 | Menu,FileTemp,Show,%xn%,%yn% 686 | } 687 | ; 检查文件模板功能 688 | FileTempMenuCheck() 689 | { 690 | Global TCPath 691 | Splitpath,TCPath,,TCDir 692 | Loop,%TCDir%\shellnew\*.* 693 | { 694 | If A_Index = 1 695 | Menu,FileTemp,Add 696 | ft := chr(64+A_Index) . " >> " . A_LoopFileName 697 | Menu,FileTemp,Add,%ft%,FileTempNew 698 | Ext := "." . A_LoopFileExt 699 | IconFile := RegGetNewFileIcon(Ext) 700 | IconFIle := RegExReplace(IconFile,"i)%systemroot%",A_WinDir) 701 | IconFilePath := RegExReplace(IconFile,",-?\d*","") 702 | IconFileIndex := RegExReplace(IconFile,".*,","") 703 | If Not FileExist(IconFilePath) 704 | Menu,FileTemp,Icon,%ft%,%A_WinDir%\system32\Shell32.dll,-152 705 | Else 706 | Menu,FileTemp,Icon,%ft%,%IconFilePath%,%IconFileIndex% 707 | } 708 | } 709 | ; 添加到文件模板中 710 | : 711 | AddToTempFiles() 712 | return 713 | AddToTempFiles() 714 | { 715 | ClipSaved := ClipboardAll 716 | Clipboard := 717 | GoSub, 718 | ClipWait,2 719 | If clipboard 720 | AddPath := clipboard 721 | Else 722 | Return 723 | clipboard := ClipSaved 724 | If FileExist(AddPath) 725 | Splitpath,AddPath,filename,,fileext,filenamenoext 726 | else 727 | Return 728 | Gui, Destroy 729 | Gui, Add, Text, Hidden, %AddPath% 730 | Gui, Add, Text, x12 y20 w50 h20 +Center, 模板源 731 | Gui, Add, Edit, x72 y20 w300 h20 Disabled, %FileName% 732 | Gui, Add, Text, x12 y50 w50 h20 +Center, 模板名 733 | Gui, Add, Edit, x72 y50 w300 h20 , %FileName% 734 | Gui, Add, Button, x162 y80 w90 h30 gAddTempOK default, 确认(&S) 735 | Gui, Add, Button, x282 y80 w90 h30 gNewFileClose , 取消(&C) 736 | Gui, Show, w400 h120, 添加模板 737 | If Fileext 738 | { 739 | Controlget,nf,hwnd,,edit2,A 740 | PostMessage,0x0B1,0,Strlen(filenamenoext),Edit2,A 741 | } 742 | } 743 | AddTempOK: 744 | AddTempOK() 745 | return 746 | AddTempOK() 747 | { 748 | Global TCPath 749 | GuiControlGet,SrcPath,,Static1 750 | Splitpath,SrcPath,filename,,fileext,filenamenoext 751 | GuiControlGet,NewFileName,,Edit2 752 | SNDir := RegExReplace(TCPath,"[^\\]*$") . "ShellNew\" 753 | If Not FileExist(SNDir) 754 | FileCreateDir,%SNDir% 755 | NewFile := SNDir . NewFileName 756 | FileCopy,%SrcPath%,%NewFile%,1 757 | Gui,Destroy 758 | } 759 | ; 新建文件模板 760 | FileTempNew: 761 | NewFile(RegExReplace(A_ThisMenuItem,".\s>>\s",RegExReplace(TCPath,"\\[^\\]*$","\shellnew\"))) 762 | return 763 | ; 新建文件 764 | NewFile: 765 | NewFile() 766 | return 767 | NewFile(File="") 768 | { 769 | Global NewFile 770 | If Not File 771 | File := RegExReplace(NewFiles[A_ThisMenuItemPos],"(.*\[|\]$)","") 772 | If Not FileExist(File) 773 | { 774 | RegRead,ShellNewDir,HKEY_USERS,.default\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders 775 | If Not ShellNewDir 776 | ShellNewDir := "C:\windows\Shellnew" 777 | File := ShellNewDir . "\" file 778 | If RegExMatch(SubStr(file,-7),"NullFile") 779 | { 780 | fileext := RegExReplace(NewFiles[A_ThisMenuItemPos],"(.*\(|\).*)") 781 | File := "New" . fileext 782 | FileName := "New" . fileext 783 | FileNamenoext := "New" 784 | } 785 | } 786 | Else 787 | Splitpath,file,filename,,fileext,filenamenoext 788 | Gui, Destroy 789 | Gui, Add, Text, x12 y20 w50 h20 +Center, 模板源 790 | Gui, Add, Edit, x72 y20 w300 h20 Disabled, %file% 791 | Gui, Add, Text, x12 y50 w50 h20 +Center, 新建文件 792 | Gui, Add, Edit, x72 y50 w300 h20 , %filename% 793 | Gui, Add, Button, x162 y80 w90 h30 gNewFileOk default, 确认(&S) 794 | Gui, Add, Button, x282 y80 w90 h30 gNewFileClose , 取消(&C) 795 | Gui, Show, w400 h120, 新建文件 796 | If Fileext 797 | { 798 | Controlget,nf,hwnd,,edit2,A 799 | PostMessage,0x0B1,0,Strlen(filenamenoext),Edit2,A 800 | } 801 | return 802 | } 803 | ; 关闭新建文件窗口 804 | NewFileClose: 805 | Gui,Destroy 806 | return 807 | 808 | ; 确认新建文件 809 | NewFileOK: 810 | NewFileOK() 811 | return 812 | NewFileOK() 813 | { 814 | GuiControlGet,SrcPath,,Edit1 815 | GuiControlGet,NewFileName,,Edit2 816 | ClipSaved := ClipboardAll 817 | Clipboard := 818 | GoSub, 819 | ClipWait,2 820 | If clipboard 821 | DstPath := Clipboard 822 | Else 823 | Return 824 | clipboard := ClipSaved 825 | If RegExMatch(DstPath,"^\\\\计算机$") 826 | Return 827 | If RegExMatch(DstPath,"i)\\\\所有控制面板项$") 828 | Return 829 | If RegExMatch(DstPath,"i)\\\\Fonts$") 830 | Return 831 | If RegExMatch(DstPath,"i)\\\\网络$") 832 | Return 833 | If RegExMatch(DstPath,"i)\\\\打印机$") 834 | Return 835 | If RegExMatch(DstPath,"i)\\\\回收站$") 836 | Return 837 | If RegExmatch(DstPath,"^\\\\桌面$") 838 | DstPath := A_Desktop 839 | NewFile := DstPath . "\" . NewFileName 840 | If FileExist(NewFile) 841 | { 842 | MsgBox, 4, 新建文件, 新建文件已存在,是否覆盖? 843 | IfMsgBox No 844 | Return 845 | } 846 | FileCopy,%SrcPath%,%NewFile%,1 847 | Gui,Destroy 848 | WinActivate,AHK_CLASS TTOTAL_CMD 849 | ControlGetFocus,FocusCtrl,AHK_Class TTOTAL_CMD 850 | IF RegExMatch(FocusCtrl,TCListBox) 851 | { 852 | GoSub, 853 | ControlGet,Text,List,,%FocusCtrl%,AHK_CLASS TTOTAL_CMD 854 | Loop,Parse,Text,`n 855 | { 856 | If RegExMatch(A_LoopField,NewFileName) 857 | { 858 | Index := A_Index - 1 859 | Postmessage,0x19E,%Index%,1,%FocusCtrl%,AHK_CLASS TTOTAL_CMD 860 | Break 861 | } 862 | } 863 | } 864 | } 865 | ;============================================================================ 866 | ; ReadNewFile() 867 | ; 新建文件菜单 868 | ReadNewFile() 869 | { 870 | NewFiles[0] := 0 871 | SetBatchLines -1 872 | Loop,HKEY_CLASSES_ROOT ,,1,0 873 | { 874 | If RegExMatch(A_LoopRegName,"^\..*") 875 | { 876 | Reg := A_LoopRegName 877 | Loop,HKEY_CLASSES_ROOT,%Reg%,1,1 878 | { 879 | If RegExMatch(A_LoopRegName,"i)shellnew") 880 | { 881 | NewReg := A_LoopRegSubKey "\shellnew" 882 | If RegGetNewFilePath(NewReg) 883 | { 884 | NewFiles[0]++ 885 | Index := NewFiles[0] 886 | NewFiles[Index] := RegGetNewFileDescribe(Reg) . "(" . Reg . ")[" . RegGetNewFilePath(NewReg) . "]" 887 | } 888 | } 889 | } 890 | } 891 | } 892 | LoopCount := NewFiles[0] 893 | Half := LoopCount/2 894 | Loop % LoopCount 895 | { 896 | If A_Index < %Half% 897 | { 898 | B_Index := NewFiles[0] - A_Index + 1 899 | C_Index := NewFiles[A_Index] 900 | NewFiles[A_Index] := NewFiles[B_Index] 901 | NewFiles[B_Index] := C_Index 902 | } 903 | } 904 | Menu,CreateNewFile,UseErrorLevel,On 905 | Loop % NewFiles[0] 906 | { 907 | File := RegExReplace(NewFiles[A_Index],"\(.*","") 908 | Exec := RegExReplace(NewFiles[A_Index],"(.*\(|\)\[.*)","") 909 | MenuFile := Chr(A_Index+64) . " >> " . File . "(" Exec . ")" 910 | Menu,CreateNewFile,Add,%MenuFile%,NewFile 911 | 912 | IconFile := RegGetNewFileIcon(Exec) 913 | IconFIle := RegExReplace(IconFile,"i)%systemroot%",A_WinDir) 914 | IconFilePath := RegExReplace(IconFile,",-?\d*","") 915 | If Not FileExist(IconFilePath) 916 | IconFilePath := "" 917 | IconFileIndex := RegExReplace(IconFile,".*,","") 918 | If Not RegExMatch(IconFileIndex,"^-?\d*$") 919 | IconFileIndex := "" 920 | If RegExMatch(Exec,"\.lnk") 921 | { 922 | IconFilePath := A_WinDir . "\system32\Shell32.dll" 923 | IconFileIndex := "264" 924 | } 925 | Menu,CreateNewFile,Icon,%MenuFile%,%IconFilePath%,%IconFileIndex% 926 | } 927 | } 928 | ; 获取新建文件的源 929 | ; reg 为后缀 930 | RegGetNewFilePath(reg) 931 | { 932 | RegRead,GetRegPath,HKEY_CLASSES_ROOT,%Reg%,FileName 933 | IF Not ErrorLevel 934 | Return GetRegPath 935 | RegRead,GetRegPath,HKEY_CLASSES_ROOT,%Reg%,NullFile 936 | IF Not ErrorLevel 937 | Return "NullFile" 938 | } 939 | ; RegGetNewFileType(reg) 940 | ; 获取新建文件类型名 941 | ; reg 为后缀 942 | RegGetNewFileType(reg) 943 | { 944 | RegRead,FileType,HKEY_CLASSES_ROOT,%Reg% 945 | If Not ErrorLevel 946 | Return FileType 947 | } 948 | ; 获取文件描述 949 | ; reg 为后缀 950 | RegGetNewFileDescribe(reg) 951 | { 952 | FileType := RegGetNewFileType(reg) 953 | RegRead,FileDesc,HKEY_CLASSES_ROOT,%FileType% 954 | If Not ErrorLevel 955 | Return FileDesc 956 | } 957 | ; 获取文件对应的图标 958 | ; reg 为后缀 959 | RegGetNewFileIcon(reg) 960 | { 961 | IconPath := RegGetNewFileType(reg) . "\DefaultIcon" 962 | RegRead,FileIcon,HKEY_CLASSES_ROOT,%IconPath% 963 | If Not ErrorLevel 964 | Return FileIcon 965 | } 966 | ; {{{1 967 | ; 返回到上层文件夹,可返回到我的电脑 968 | : 969 | IsRootDir() 970 | GoSub, 971 | return 972 | IsRootDir() 973 | { 974 | ClipSaved := ClipboardAll 975 | clipboard := 976 | GoSub, 977 | ClipWait,1 978 | Path := Clipboard 979 | Clipboard := ClipSaved 980 | If RegExMatch(Path,"^.:\\$") 981 | { 982 | GoSub, 983 | Path := "i)" . RegExReplace(Path,"\\","") 984 | ControlGetFocus,focus_control,AHK_CLASS TTOTAL_CMD 985 | ControlGet,outvar,list,,%focus_control%,AHK_CLASS TTOTAL_CMD 986 | Loop,Parse,Outvar,`n 987 | { 988 | If Not A_LoopField 989 | Break 990 | If RegExMatch(A_LoopField,Path) 991 | { 992 | Focus := A_Index - 1 993 | Break 994 | } 995 | } 996 | PostMessage, 0x19E, %Focus%, 1, %focus_control%, AHK_CLASS TTOTAL_CMD 997 | } 998 | } 999 | : 1000 | AlwayOnTop() 1001 | Return 1002 | AlwayOnTop() 1003 | { 1004 | WinGet,ExStyle,ExStyle,ahk_class TTOTAL_CMD 1005 | If (ExStyle & 0x8) 1006 | WinSet,AlwaysOnTop,off,ahk_class TTOTAL_CMD 1007 | else 1008 | WinSet,AlwaysOnTop,on,ahk_class TTOTAL_CMD 1009 | } 1010 | 1011 | ; LeftRight(){{{1 1012 | LeftRight(){ 1013 | 1014 | location := 0 1015 | ControlGetPos,x1,y1,,,%TCPanel1%,AHK_CLASS TTOTAL_CMD 1016 | If x1 > %y1% 1017 | location += 2 1018 | ControlGetFocus,TLB,ahk_class TTOTAL_CMD 1019 | ControlGetPos,x2,y2,wn,,%TLB%,ahk_class TTOTAL_CMD 1020 | If location 1021 | { 1022 | If x1 > %x2% 1023 | location += 1 1024 | } 1025 | Else 1026 | { 1027 | If y1 > %y2% 1028 | location += 1 1029 | } 1030 | return location 1031 | } 1032 | 1033 | ; 增强命令 By 流彩 {{{1 1034 | ;: >>打开驱动器列表:另侧{{{2 1035 | : 1036 | ControlGetFocus,CurrentFocus,AHK_CLASS TTOTAL_CMD 1037 | if CurrentFocus not in TMyListBox2,TMyListBox1 1038 | return 1039 | if CurrentFocus in TMyListBox2 1040 | SendPos(131) 1041 | else 1042 | SendPos(231) 1043 | Return 1044 | 1045 | ;: >>打开驱动器列表:本侧{{{2 1046 | : 1047 | ControlGetFocus,CurrentFocus,AHK_CLASS TTOTAL_CMD 1048 | if CurrentFocus not in TMyListBox2,TMyListBox1 1049 | return 1050 | if CurrentFocus in TMyListBox2 1051 | SendPos(231) 1052 | else 1053 | SendPos(131) 1054 | Return 1055 | 1056 | ;: >>常用文件夹:另一侧{{{2 1057 | : 1058 | ControlGetFocus,CurrentFocus,AHK_CLASS TTOTAL_CMD 1059 | if CurrentFocus not in TMyListBox2,TMyListBox1 1060 | return 1061 | if CurrentFocus in TMyListBox2 1062 | otherlist = TMyListBox1 1063 | else 1064 | otherlist = TMyListBox2 1065 | ControlFocus, %otherlist% ,ahk_class TTOTAL_CMD 1066 | SendPos(526) 1067 | SetTimer WaitMenuPop3 1068 | return 1069 | WaitMenuPop3: 1070 | winget,menupop,,ahk_class #32768 1071 | if menupop 1072 | { 1073 | SetTimer, WaitMenuPop3 ,Off 1074 | SetTimer, WaitMenuOff3 1075 | } 1076 | return 1077 | WaitMenuOff3: 1078 | winget,menupop,,ahk_class #32768 1079 | if not menupop 1080 | { 1081 | SetTimer,WaitMenuOff3, off 1082 | goto, goonhot 1083 | } 1084 | return 1085 | goonhot: 1086 | ControlFocus, %CurrentFocus% ,ahk_class TTOTAL_CMD 1087 | Return 1088 | 1089 | ;: >>复制到常用文件夹{{{2 1090 | : 1091 | ControlGetFocus,CurrentFocus,AHK_CLASS TTOTAL_CMD 1092 | if CurrentFocus not in TMyListBox2,TMyListBox1 1093 | return 1094 | if CurrentFocus in TMyListBox2 1095 | otherlist = TMyListBox1 1096 | else 1097 | otherlist = TMyListBox2 1098 | ControlFocus, %otherlist% ,ahk_class TTOTAL_CMD 1099 | SendPos(526) 1100 | SetTimer WaitMenuPop1 1101 | return 1102 | WaitMenuPop1: 1103 | winget,menupop,,ahk_class #32768 1104 | if menupop 1105 | { 1106 | SetTimer, WaitMenuPop1 ,Off 1107 | SetTimer, WaitMenuOff1 1108 | } 1109 | return 1110 | WaitMenuOff1: 1111 | winget,menupop,,ahk_class #32768 1112 | if not menupop 1113 | { 1114 | SetTimer,WaitMenuOff1, off 1115 | goto, gooncopy 1116 | } 1117 | return 1118 | gooncopy: 1119 | ControlFocus, %CurrentFocus% ,ahk_class TTOTAL_CMD 1120 | SendPos(3101) 1121 | return 1122 | 1123 | ;: >>移动到常用文件夹{{{2 1124 | : 1125 | If SendPos(0) 1126 | ControlGetFocus,CurrentFocus,AHK_CLASS TTOTAL_CMD 1127 | if CurrentFocus not in TMyListBox2,TMyListBox1 1128 | return 1129 | if CurrentFocus in TMyListBox2 1130 | otherlist = TMyListBox1 1131 | else 1132 | otherlist = TMyListBox2 1133 | ControlFocus, %otherlist% ,ahk_class TTOTAL_CMD 1134 | SendPos(526) 1135 | SetTimer WaitMenuPop2 1136 | return 1137 | WaitMenuPop2: 1138 | winget,menupop,,ahk_class #32768 1139 | if menupop 1140 | { 1141 | SetTimer, WaitMenuPop2 ,Off 1142 | SetTimer, WaitMenuOff2 1143 | } 1144 | return 1145 | WaitMenuOff2: 1146 | winget,menupop,,ahk_class #32768 1147 | if not menupop 1148 | { 1149 | SetTimer,WaitMenuOff2, off 1150 | goto, goonmove 1151 | } 1152 | return 1153 | GoonMove: 1154 | ControlFocus, %CurrentFocus% ,ahk_class TTOTAL_CMD 1155 | SendPos(1005) 1156 | return 1157 | 1158 | ;: >>后退另一侧{{{2 1159 | : 1160 | Send {Tab} 1161 | SendPos(570) 1162 | Send {Tab} 1163 | Return 1164 | 1165 | ;: >>前进另一侧{{{2 1166 | : 1167 | Send {Tab} 1168 | SendPos(571) 1169 | Send {Tab} 1170 | Return 1171 | 1172 | 1173 | : 1174 | return 1175 | 1176 | Totalcomander_select_tc: 1177 | Totalcomander_select_tc() 1178 | return 1179 | Totalcomander_select_tc(){ 1180 | GUI,FindTC:Default 1181 | GuiControlGet,dir,,Edit1 1182 | TCPath := dir "\totalcmd.exe" 1183 | TCINI := dir "\wincmd.ini" 1184 | GUi,FindTC:Destroy 1185 | f := TCConfig.filepath 1186 | IniWrite,%TCPath%,%f%,config,tcpath 1187 | IniWrite,%TCINI%,%f%,config,tcini 1188 | } 1189 | Totalcomander_select_tc64: 1190 | Totalcomander_select_tc64() 1191 | return 1192 | Totalcomander_select_tc64(){ 1193 | GUI,FindTC:Default 1194 | GuiControlGet,dir,,Edit1 1195 | TCPath := dir "\totalcmd64.exe" 1196 | TCINI := dir "\wincmd.ini" 1197 | GUi,FindTC:Destroy 1198 | f := TCConfig.filepath 1199 | IniWrite,%TCPath%,%f%,config,tcpath 1200 | IniWrite,%TCINI%,%f%,config,tcini 1201 | } 1202 | Totalcomander_select_tcdir: 1203 | Totalcomander_select_tcdir() 1204 | return 1205 | Totalcomander_select_tcdir(){ 1206 | FileSelectFolder,tcdir,,0,打开TC安装目录 1207 | GuiControl,,Edit1,%tcdir% 1208 | } 1209 | 1210 | 1211 | 1212 | 1213 | 1214 | 1215 | 1216 | 1217 | ; TC自带命令 {{{1 1218 | ;================================================== 1219 | ;=======使用VIM下的VOom 插件可以很方便的查看======= 1220 | ;================================================== 1221 | TCCOMMAND: 1222 | vim.Comment("","来源窗口: 显示文件备注") 1223 | vim.Comment("","来源窗口: 列表") 1224 | vim.Comment("","来源窗口: 详细信息") 1225 | vim.Comment("","来源窗口: 文件夹树") 1226 | vim.Comment("","来源窗口: 快速查看") 1227 | vim.Comment("","纵向/横向排列") 1228 | vim.Comment("","来源窗口: 快速查看(不用插件)") 1229 | vim.Comment("","来源窗口: 关闭快速查看窗口") 1230 | vim.Comment("","来源窗口: 可执行文件") 1231 | vim.Comment("","来源窗口: 所有文件") 1232 | vim.Comment("","来源窗口: 上次选中的文件") 1233 | vim.Comment("","来源窗口: 自定义类型") 1234 | vim.Comment("","来源窗口: 按文件名排序") 1235 | vim.Comment("","来源窗口: 按扩展名排序") 1236 | vim.Comment("","来源窗口: 按大小排序") 1237 | vim.Comment("","来源窗口: 按日期时间排序") 1238 | vim.Comment("","来源窗口: 不排序") 1239 | vim.Comment("","来源窗口: 反向排序") 1240 | vim.Comment("","来源窗口: 打开驱动器列表") 1241 | vim.Comment("","来源窗口: 缩略图") 1242 | vim.Comment("","来源窗口: 自定义视图菜单") 1243 | vim.Comment("","来源窗口: 焦点置于路径上") 1244 | vim.Comment("","左窗口: 显示文件备注") 1245 | vim.Comment("","左窗口: 列表") 1246 | vim.Comment("","左窗口: 详细信息") 1247 | vim.Comment("","左窗口: 文件夹树") 1248 | vim.Comment("","左窗口: 快速查看") 1249 | vim.Comment("","左窗口: 快速查看(不用插件)") 1250 | vim.Comment("","左窗口: 关闭快速查看窗口") 1251 | vim.Comment("","左窗口: 可执行文件") 1252 | vim.Comment(""," 左窗口: 所有文件") 1253 | vim.Comment("","左窗口: 上次选中的文件") 1254 | vim.Comment("","左窗口: 自定义类型") 1255 | vim.Comment("","左窗口: 按文件名排序") 1256 | vim.Comment("","左窗口: 按扩展名排序") 1257 | vim.Comment("","左窗口: 按大小排序") 1258 | vim.Comment("","左窗口: 按日期时间排序") 1259 | vim.Comment("","左窗口: 不排序") 1260 | vim.Comment("","左窗口: 反向排序") 1261 | vim.Comment("","左窗口: 打开驱动器列表") 1262 | vim.Comment("","左窗口: 焦点置于路径上") 1263 | vim.Comment("","左窗口: 展开所有文件夹") 1264 | vim.Comment("","左窗口: 只展开选中的文件夹") 1265 | vim.Comment("","窗口: 缩略图") 1266 | vim.Comment("","窗口: 自定义视图菜单") 1267 | vim.Comment("","右窗口: 显示文件备注") 1268 | vim.Comment("","右窗口: 列表") 1269 | vim.Comment("","详细信息") 1270 | vim.Comment("","右窗口: 文件夹树") 1271 | vim.Comment("","右窗口: 快速查看") 1272 | vim.Comment("","右窗口: 快速查看(不用插件)") 1273 | vim.Comment("","右窗口: 关闭快速查看窗口") 1274 | vim.Comment("","右窗口: 可执行文件") 1275 | vim.Comment("","右窗口: 所有文件") 1276 | vim.Comment("","右窗口: 上次选中的文件") 1277 | vim.Comment("","右窗口: 自定义类型") 1278 | vim.Comment("","右窗口: 按文件名排序") 1279 | vim.Comment("","右窗口: 按扩展名排序") 1280 | vim.Comment("","右窗口: 按大小排序") 1281 | vim.Comment("","右窗口: 按日期时间排序") 1282 | vim.Comment("","右窗口: 不排序") 1283 | vim.Comment("","右窗口: 反向排序") 1284 | vim.Comment("","右窗口: 打开驱动器列表") 1285 | vim.Comment("","右窗口: 焦点置于路径上") 1286 | vim.Comment("","右窗口: 展开所有文件夹") 1287 | vim.Comment("","右窗口: 只展开选中的文件夹") 1288 | vim.Comment("","右窗口: 缩略图") 1289 | vim.Comment("","右窗口: 自定义视图菜单") 1290 | vim.Comment("","查看(用查看程序)") 1291 | vim.Comment("","查看(用查看程序, 但不用插件/多媒体)") 1292 | vim.Comment("","编辑") 1293 | vim.Comment("","复制") 1294 | vim.Comment("","复制到当前窗口") 1295 | vim.Comment("","复制到另一窗口") 1296 | vim.Comment("","重命名/移动") 1297 | vim.Comment("","新建文件夹") 1298 | vim.Comment("","删除") 1299 | vim.Comment("","测试压缩包") 1300 | vim.Comment("","压缩文件") 1301 | vim.Comment("","解压文件") 1302 | vim.Comment("","重命名(Shift+F6)") 1303 | vim.Comment("","重命名当前文件") 1304 | vim.Comment("","移动(F6)") 1305 | vim.Comment("","显示属性") 1306 | vim.Comment("","创建快捷方式") 1307 | vim.Comment("","模仿按 ENTER 键") 1308 | vim.Comment("","以其他用户身份运行光标处的程序") 1309 | vim.Comment("","分割文件") 1310 | vim.Comment("","合并文件") 1311 | vim.Comment("","编码文件(MIME/UUE/XXE 格式)") 1312 | vim.Comment("","解码文件(MIME/UUE/XXE/BinHex 格式)") 1313 | vim.Comment("","创建校验文件") 1314 | vim.Comment("","验证校验和") 1315 | vim.Comment("","更改属性") 1316 | vim.Comment("","配置: 布局") 1317 | vim.Comment("","配置: 显示") 1318 | vim.Comment("","配置: 图标") 1319 | vim.Comment("","配置: 字体") 1320 | vim.Comment("","配置: 颜色") 1321 | vim.Comment("","配置: 制表符") 1322 | vim.Comment("","配置: 文件夹标签") 1323 | vim.Comment("","配置: 自定义列") 1324 | vim.Comment("","更改当前自定义列") 1325 | vim.Comment("","配置: 语言") 1326 | vim.Comment("","配置: 操作方式") 1327 | vim.Comment("","配置: 编辑/查看") 1328 | vim.Comment("","配置: 复制/删除") 1329 | vim.Comment("","配置: 刷新") 1330 | vim.Comment("","配置: 快速搜索") 1331 | vim.Comment("","配置: FTP") 1332 | vim.Comment("","配置: 插件") 1333 | vim.Comment("","配置: 缩略图") 1334 | vim.Comment("","配置: 日志文件") 1335 | vim.Comment("","配置: 隐藏文件") 1336 | vim.Comment("","配置: 压缩程序") 1337 | vim.Comment("","配置: ZIP 压缩程序") 1338 | vim.Comment("","配置: 其他/确认") 1339 | vim.Comment("","保存位置") 1340 | vim.Comment("","更改工具栏") 1341 | vim.Comment("","保存设置") 1342 | vim.Comment("","直接修改配置文件") 1343 | vim.Comment("","保存文件夹历史记录") 1344 | vim.Comment("","更改开始菜单") 1345 | vim.Comment("","映射网络驱动器") 1346 | vim.Comment("","断开网络驱动器") 1347 | vim.Comment("","共享当前文件夹") 1348 | vim.Comment("","取消文件夹共享") 1349 | vim.Comment("","显示系统共享文件夹") 1350 | vim.Comment("","显示本地文件的远程用户") 1351 | vim.Comment("","计算占用空间") 1352 | vim.Comment("","设置卷标") 1353 | vim.Comment("","版本信息") 1354 | vim.Comment("","打开命令提示符窗口") 1355 | vim.Comment("","比较文件夹") 1356 | vim.Comment("","比较文件夹(同时标出另一窗口没有的子文件夹)") 1357 | vim.Comment("","显示快捷菜单") 1358 | vim.Comment("","显示快捷菜单(内部关联)") 1359 | vim.Comment("","显示光标处文件的内部关联快捷菜单") 1360 | vim.Comment("","媒体中心遥控器播放/暂停键快捷菜单") 1361 | vim.Comment("","两边窗口同步更改文件夹") 1362 | vim.Comment("","编辑文件备注") 1363 | vim.Comment("","焦点置于左窗口") 1364 | vim.Comment("","焦点置于右窗口") 1365 | vim.Comment("","焦点置于命令行") 1366 | vim.Comment("","焦点置于工具栏") 1367 | vim.Comment("","计算所有文件夹占用的空间") 1368 | vim.Comment("","卸载所有插件") 1369 | vim.Comment("","标出新文件, 隐藏相同者") 1370 | vim.Comment("","交换左右窗口") 1371 | vim.Comment("","目标 = 来源") 1372 | vim.Comment("","刷新选中文件的缩略图") 1373 | vim.Comment("","直接电缆连接") 1374 | vim.Comment("","加载 NT 并口驱动程序") 1375 | vim.Comment("","卸载 NT 并口驱动程序") 1376 | vim.Comment("","打印文件列表") 1377 | vim.Comment("","打印文件列表(含子文件夹)") 1378 | vim.Comment("","打印文件内容") 1379 | vim.Comment("","选择一组文件") 1380 | vim.Comment("","选择一组: 文件和文件夹") 1381 | vim.Comment("","选择一组: 仅文件") 1382 | vim.Comment("","选择一组: 仅文件夹") 1383 | vim.Comment("","不选一组文件") 1384 | vim.Comment("","不选一组: 仅文件") 1385 | vim.Comment("","不选一组: 仅文件夹") 1386 | vim.Comment("","不选一组: 文件和/或文件夹(视配置而定)") 1387 | vim.Comment("","全部选择: 文件和/或文件夹(视配置而定)") 1388 | vim.Comment("","全部选择: 文件和文件夹") 1389 | vim.Comment("","全部选择: 仅文件") 1390 | vim.Comment("","全部选择: 仅文件夹") 1391 | vim.Comment("","全部取消: 文件和文件夹") 1392 | vim.Comment("","全部取消: 仅文件") 1393 | vim.Comment("","全部取消: 仅文件夹") 1394 | vim.Comment("","全部取消: 文件和/或文件夹(视配置而定)") 1395 | vim.Comment("","反向选择") 1396 | vim.Comment("","反向选择: 文件和文件夹") 1397 | vim.Comment("","反向选择: 仅文件") 1398 | vim.Comment("","反向选择: 仅文件夹") 1399 | vim.Comment("","选择扩展名相同的文件") 1400 | vim.Comment("","不选扩展名相同的文件") 1401 | vim.Comment("","选择文件名相同的文件") 1402 | vim.Comment("","不选文件名相同的文件") 1403 | vim.Comment("","选择文件名和扩展名相同的文件") 1404 | vim.Comment("","不选文件名和扩展名相同的文件") 1405 | vim.Comment("","选择同一路径下的文件(展开文件夹+搜索文件)") 1406 | vim.Comment("","不选同一路径下的文件(展开文件夹+搜索文件)") 1407 | vim.Comment("","恢复选择列表") 1408 | vim.Comment("","保存选择列表") 1409 | vim.Comment("","导出选择列表") 1410 | vim.Comment("","导出选择列表(ANSI)") 1411 | vim.Comment("","导出选择列表(Unicode)") 1412 | vim.Comment("","导出详细信息") 1413 | vim.Comment("","导出详细信息(ANSI)") 1414 | vim.Comment("","导出详细信息(Unicode)") 1415 | vim.Comment("","导入选择列表(从文件)") 1416 | vim.Comment("","导入选择列表(从剪贴板)") 1417 | vim.Comment("","设置权限(NTFS)") 1418 | vim.Comment("","审核文件(NTFS)") 1419 | vim.Comment("","获取所有权(NTFS)") 1420 | vim.Comment("","剪切选中的文件到剪贴板") 1421 | vim.Comment("","复制选中的文件到剪贴板") 1422 | vim.Comment("","从剪贴板粘贴到当前文件夹") 1423 | vim.Comment("","复制文件名") 1424 | vim.Comment("","复制文件名及完整路径") 1425 | vim.Comment("","复制文件名及网络路径") 1426 | vim.Comment("","复制来源路径") 1427 | vim.Comment("","复制目标路径") 1428 | vim.Comment("","复制文件详细信息") 1429 | vim.Comment("","复制文件详细信息及完整路径") 1430 | vim.Comment("","复制文件详细信息及网络路径") 1431 | vim.Comment("","FTP 连接") 1432 | vim.Comment("","新建 FTP 连接") 1433 | vim.Comment("","断开 FTP 连接") 1434 | vim.Comment("","显示隐藏文件") 1435 | vim.Comment("","中止当前 FTP 命令") 1436 | vim.Comment("","续传") 1437 | vim.Comment("","选择传输模式") 1438 | vim.Comment("","添加到下载列表") 1439 | vim.Comment("","按列表下载") 1440 | vim.Comment("","后退") 1441 | vim.Comment("","前进") 1442 | vim.Comment("","文件夹历史记录") 1443 | vim.Comment("","后退(非 FTP)") 1444 | vim.Comment("","前进(非 FTP)") 1445 | vim.Comment("","常用文件夹") 1446 | vim.Comment("","转到根文件夹") 1447 | vim.Comment("","转到上层文件夹") 1448 | vim.Comment("","打开光标处的文件夹或压缩包") 1449 | vim.Comment("","桌面") 1450 | vim.Comment("","我的电脑") 1451 | vim.Comment("","控制面板") 1452 | vim.Comment("","字体") 1453 | vim.Comment("","网上邻居") 1454 | vim.Comment("","打印机") 1455 | vim.Comment("","回收站") 1456 | vim.Comment("","更改文件夹") 1457 | vim.Comment("","在左窗口打开光标处的文件夹或压缩包") 1458 | vim.Comment("","在右窗口打开光标处的文件夹或压缩包") 1459 | vim.Comment("","编辑来源窗口的路径") 1460 | vim.Comment("","光标移到列表中的第一个文件") 1461 | vim.Comment("","转到下一个驱动器") 1462 | vim.Comment("","转到上一个驱动器") 1463 | vim.Comment("","转到下一个选中的文件") 1464 | vim.Comment("","转到上一个选中的文件") 1465 | vim.Comment("","转到驱动器 A") 1466 | vim.Comment("","转到驱动器 C") 1467 | vim.Comment("","转到驱动器 D") 1468 | vim.Comment("","转到驱动器 E") 1469 | vim.Comment("","可自定义其他驱动器") 1470 | vim.Comment("","最多 26 个") 1471 | vim.Comment("","帮助索引") 1472 | vim.Comment("","快捷键列表") 1473 | vim.Comment("","注册信息") 1474 | vim.Comment("","访问 Totalcmd 网站") 1475 | vim.Comment("","关于 Total Commander") 1476 | vim.Comment("","退出 Total Commander") 1477 | vim.Comment("","最小化 Total Commander") 1478 | vim.Comment("","最大化 Total Commander") 1479 | vim.Comment("","恢复正常大小") 1480 | vim.Comment("","清除命令行") 1481 | vim.Comment("","下一条命令") 1482 | vim.Comment("","上一条命令") 1483 | vim.Comment("","将路径复制到命令行") 1484 | vim.Comment("","批量重命名") 1485 | vim.Comment("","系统信息") 1486 | vim.Comment("","后台传输管理器") 1487 | vim.Comment("","搜索文件") 1488 | vim.Comment("","同步文件夹") 1489 | vim.Comment("","文件关联") 1490 | vim.Comment("","定义内部关联") 1491 | vim.Comment("","比较文件内容") 1492 | vim.Comment("","使用内部比较程序") 1493 | vim.Comment("","浏览内部命令") 1494 | vim.Comment("","显示/隐藏: 工具栏") 1495 | vim.Comment("","显示/隐藏: 驱动器按钮") 1496 | vim.Comment("","显示/隐藏: 两个驱动器按钮栏") 1497 | vim.Comment("","切换: 平坦/立体驱动器按钮") 1498 | vim.Comment("","切换: 平坦/立体用户界面") 1499 | vim.Comment("","显示/隐藏: 驱动器列表") 1500 | vim.Comment("","显示/隐藏: 当前文件夹") 1501 | vim.Comment("","显示/隐藏: 路径导航栏") 1502 | vim.Comment("","显示/隐藏: 排序制表符") 1503 | vim.Comment("","显示/隐藏: 状态栏") 1504 | vim.Comment("","显示/隐藏: 命令行") 1505 | vim.Comment("","显示/隐藏: 功能键按钮") 1506 | vim.Comment("","显示文件提示") 1507 | vim.Comment("","显示快速搜索窗口") 1508 | vim.Comment("","开启/关闭: 长文件名显示") 1509 | vim.Comment("","刷新来源窗口") 1510 | vim.Comment("","仅显示选中的文件") 1511 | vim.Comment("","开启/关闭: 隐藏或系统文件显示") 1512 | vim.Comment("","开启/关闭: 8.3 式文件名小写显示") 1513 | vim.Comment("","开启/关闭: 文件夹按名称排序") 1514 | vim.Comment("","展开所有文件夹") 1515 | vim.Comment("","只展开选中的文件夹") 1516 | vim.Comment("","窗口分隔栏位于 50%") 1517 | vim.Comment("","窗口分隔栏位于 100% TC 8.0+") 1518 | vim.Comment("","显示/隐藏: 文件夹标签") 1519 | vim.Comment("","显示/隐藏: XP 主题背景") 1520 | vim.Comment("","开启/关闭: 叠置图标显示") 1521 | vim.Comment("","显示/隐藏: 文件夹历史记录和常用文件夹按钮") 1522 | vim.Comment("","启用/禁用: 文件夹自动刷新") 1523 | vim.Comment("","启用/禁用: 自定义隐藏文件") 1524 | vim.Comment("","开启/关闭: 32 位 system32 目录重定向(64 位 Windows)") 1525 | vim.Comment("","关闭独立文件夹树面板") 1526 | vim.Comment("","一个独立文件夹树面板") 1527 | vim.Comment("","两个独立文件夹树面板") 1528 | vim.Comment("","切换独立文件夹树面板状态") 1529 | vim.Comment("","开启/关闭: 一个独立文件夹树面板") 1530 | vim.Comment("","开启/关闭: 两个独立文件夹树面板") 1531 | vim.Comment("","用户菜单 1") 1532 | vim.Comment("","用户菜单 2") 1533 | vim.Comment("","用户菜单 3") 1534 | vim.Comment("","用户菜单 4") 1535 | vim.Comment("","用户菜单 5") 1536 | vim.Comment("","用户菜单 6") 1537 | vim.Comment("","用户菜单 7") 1538 | vim.Comment("","用户菜单 8") 1539 | vim.Comment("","用户菜单 9") 1540 | vim.Comment("","可定义其他用户菜单") 1541 | vim.Comment("","新建标签") 1542 | vim.Comment("","新建标签(在后台)") 1543 | vim.Comment("","新建标签(并打开光标处的文件夹)") 1544 | vim.Comment("","新建标签(在另一窗口打开文件夹)") 1545 | vim.Comment("","下一个标签(Ctrl+Tab)") 1546 | vim.Comment("","上一个标签(Ctrl+Shift+Tab)") 1547 | vim.Comment("","关闭当前标签") 1548 | vim.Comment("","关闭所有标签") 1549 | vim.Comment("","显示标签菜单") 1550 | vim.Comment("","锁定/解锁当前标签") 1551 | vim.Comment("","锁定/解锁当前标签(可更改文件夹)") 1552 | vim.Comment("","交换左右窗口及其标签") 1553 | vim.Comment("","转到锁定标签的根文件夹") 1554 | vim.Comment("","来源窗口: 激活标签 1") 1555 | vim.Comment("","来源窗口: 激活标签 2") 1556 | vim.Comment("","来源窗口: 激活标签 3") 1557 | vim.Comment("","来源窗口: 激活标签 4") 1558 | vim.Comment("","来源窗口: 激活标签 5") 1559 | vim.Comment("","来源窗口: 激活标签 6") 1560 | vim.Comment("","来源窗口: 激活标签 7") 1561 | vim.Comment("","来源窗口: 激活标签 8") 1562 | vim.Comment("","来源窗口: 激活标签 9") 1563 | vim.Comment("","来源窗口: 激活标签 10") 1564 | vim.Comment("","目标窗口: 激活标签 1") 1565 | vim.Comment("","目标窗口: 激活标签 2") 1566 | vim.Comment("","目标窗口: 激活标签 3") 1567 | vim.Comment("","目标窗口: 激活标签 4") 1568 | vim.Comment("","目标窗口: 激活标签 5") 1569 | vim.Comment("","目标窗口: 激活标签 6") 1570 | vim.Comment("","目标窗口: 激活标签 7") 1571 | vim.Comment("","目标窗口: 激活标签 8") 1572 | vim.Comment("","目标窗口: 激活标签 9") 1573 | vim.Comment("","目标窗口: 激活标签 10") 1574 | vim.Comment("","左窗口: 激活标签 1") 1575 | vim.Comment("","左窗口: 激活标签 2") 1576 | vim.Comment("","左窗口: 激活标签 3") 1577 | vim.Comment("","左窗口: 激活标签 4") 1578 | vim.Comment("","左窗口: 激活标签 5") 1579 | vim.Comment("","左窗口: 激活标签 6") 1580 | vim.Comment("","左窗口: 激活标签 7") 1581 | vim.Comment("","左窗口: 激活标签 8") 1582 | vim.Comment("","左窗口: 激活标签 9") 1583 | vim.Comment("","左窗口: 激活标签 10") 1584 | vim.Comment("","右窗口: 激活标签 1") 1585 | vim.Comment("","右窗口: 激活标签 2") 1586 | vim.Comment("","右窗口: 激活标签 3") 1587 | vim.Comment("","右窗口: 激活标签 4") 1588 | vim.Comment("","右窗口: 激活标签 5") 1589 | vim.Comment("","右窗口: 激活标签 6") 1590 | vim.Comment("","右窗口: 激活标签 7") 1591 | vim.Comment("","右窗口: 激活标签 8") 1592 | vim.Comment("","右窗口: 激活标签 9") 1593 | vim.Comment("","右窗口: 激活标签 10") 1594 | vim.Comment("","来源窗口: 按第 1 列排序") 1595 | vim.Comment("","来源窗口: 按第 2 列排序") 1596 | vim.Comment("","来源窗口: 按第 3 列排序") 1597 | vim.Comment("","来源窗口: 按第 4 列排序") 1598 | vim.Comment("","来源窗口: 按第 5 列排序") 1599 | vim.Comment("","来源窗口: 按第 6 列排序") 1600 | vim.Comment("","来源窗口: 按第 7 列排序") 1601 | vim.Comment("","来源窗口: 按第 8 列排序") 1602 | vim.Comment("","来源窗口: 按第 9 列排序") 1603 | vim.Comment("","来源窗口: 按第 10 列排序") 1604 | vim.Comment("","目标窗口: 按第 1 列排序") 1605 | vim.Comment("","目标窗口: 按第 2 列排序") 1606 | vim.Comment("","目标窗口: 按第 3 列排序") 1607 | vim.Comment("","目标窗口: 按第 4 列排序") 1608 | vim.Comment("","目标窗口: 按第 5 列排序") 1609 | vim.Comment("","目标窗口: 按第 6 列排序") 1610 | vim.Comment("","目标窗口: 按第 7 列排序") 1611 | vim.Comment("","目标窗口: 按第 8 列排序") 1612 | vim.Comment("","目标窗口: 按第 9 列排序") 1613 | vim.Comment("","目标窗口: 按第 10 列排序") 1614 | vim.Comment("","左窗口: 按第 1 列排序") 1615 | vim.Comment("","左窗口: 按第 2 列排序") 1616 | vim.Comment("","左窗口: 按第 3 列排序") 1617 | vim.Comment("","左窗口: 按第 4 列排序") 1618 | vim.Comment("","左窗口: 按第 5 列排序") 1619 | vim.Comment("","左窗口: 按第 6 列排序") 1620 | vim.Comment("","左窗口: 按第 7 列排序") 1621 | vim.Comment("","左窗口: 按第 8 列排序") 1622 | vim.Comment("","左窗口: 按第 9 列排序") 1623 | vim.Comment("","左窗口: 按第 10 列排序") 1624 | vim.Comment("","右窗口: 按第 1 列排序") 1625 | vim.Comment("","右窗口: 按第 2 列排序") 1626 | vim.Comment("","右窗口: 按第 3 列排序") 1627 | vim.Comment("","右窗口: 按第 4 列排序") 1628 | vim.Comment("","右窗口: 按第 5 列排序") 1629 | vim.Comment("","右窗口: 按第 6 列排序") 1630 | vim.Comment("","右窗口: 按第 7 列排序") 1631 | vim.Comment("","右窗口: 按第 8 列排序") 1632 | vim.Comment("","右窗口: 按第 9 列排序") 1633 | vim.Comment("","右窗口: 按第 10 列排序") 1634 | vim.Comment("","来源窗口: 自定义列视图 1") 1635 | vim.Comment("","来源窗口: 自定义列视图 2") 1636 | vim.Comment("","来源窗口: 自定义列视图 3") 1637 | vim.Comment("","来源窗口: 自定义列视图 4") 1638 | vim.Comment("","来源窗口: 自定义列视图 5") 1639 | vim.Comment("","来源窗口: 自定义列视图 6") 1640 | vim.Comment("","来源窗口: 自定义列视图 7") 1641 | vim.Comment("","来源窗口: 自定义列视图 8") 1642 | vim.Comment("","来源窗口: 自定义列视图 9") 1643 | vim.Comment("","来源窗口: 自定义列视图 10") 1644 | vim.Comment("","左窗口: 自定义列视图 1") 1645 | vim.Comment("","左窗口: 自定义列视图 2") 1646 | vim.Comment("","左窗口: 自定义列视图 3") 1647 | vim.Comment("","左窗口: 自定义列视图 4") 1648 | vim.Comment("","左窗口: 自定义列视图 5") 1649 | vim.Comment("","左窗口: 自定义列视图 6") 1650 | vim.Comment("","左窗口: 自定义列视图 7") 1651 | vim.Comment("","左窗口: 自定义列视图 8") 1652 | vim.Comment("","左窗口: 自定义列视图 9") 1653 | vim.Comment("","左窗口: 自定义列视图 10") 1654 | vim.Comment("","右窗口: 自定义列视图 1") 1655 | vim.Comment("","右窗口: 自定义列视图 2") 1656 | vim.Comment("","右窗口: 自定义列视图 3") 1657 | vim.Comment("","右窗口: 自定义列视图 4") 1658 | vim.Comment("","右窗口: 自定义列视图 5") 1659 | vim.Comment("","右窗口: 自定义列视图 6") 1660 | vim.Comment("","右窗口: 自定义列视图 7") 1661 | vim.Comment("","右窗口: 自定义列视图 8") 1662 | vim.Comment("","右窗口: 自定义列视图 9") 1663 | vim.Comment("","右窗口: 自定义列视图 10") 1664 | vim.Comment("","来源窗口: 下一个自定义视图") 1665 | vim.Comment("","来源窗口: 上一个自定义视图") 1666 | vim.Comment("","目标窗口: 下一个自定义视图") 1667 | vim.Comment("","目标窗口: 上一个自定义视图") 1668 | vim.Comment("","左窗口: 下一个自定义视图") 1669 | vim.Comment("","左窗口: 上一个自定义视图") 1670 | vim.Comment("","右窗口: 下一个自定义视图") 1671 | vim.Comment("","右窗口: 上一个自定义视图") 1672 | vim.Comment("","所有文件都按需加载备注") 1673 | vim.Comment("","仅选中的文件按需加载备注") 1674 | vim.Comment("","停止后台加载备注") 1675 | return 1676 | SendPos(Number) 1677 | { 1678 | PostMessage 1075, %Number%, 0, , AHK_CLASS TTOTAL_CMD 1679 | } 1680 | ;: >>来源窗口: 显示文件备注{{{2 1681 | : 1682 | SendPos(300) 1683 | Return 1684 | ;: >>来源窗口: 列表{{{2 1685 | : 1686 | SendPos(301) 1687 | Return 1688 | ;: >>来源窗口: 详细信息{{{2 1689 | : 1690 | SendPos(302) 1691 | Return 1692 | ;: >>来源窗口: 文件夹树{{{2 1693 | : 1694 | SendPos(303) 1695 | ;: >>来源窗口: 快速查看{{{2 1696 | : 1697 | SendPos(304) 1698 | Return 1699 | ;: >>纵向排列{{{2 1700 | : 1701 | SendPos(305) 1702 | Return 1703 | ;: >>来源窗口: 快速查看(不用插件){{{2 1704 | : 1705 | SendPos(306) 1706 | Return 1707 | ;: >>来源窗口: 关闭快速查看窗口{{{2 1708 | : 1709 | SendPos(307) 1710 | Return 1711 | ;: >>来源窗口: 可执行文件{{{2 1712 | : 1713 | SendPos(311) 1714 | Return 1715 | ;: >>来源窗口: 所有文件{{{2 1716 | : 1717 | SendPos(312) 1718 | Return 1719 | ;: >>来源窗口: 上次选中的文件{{{2 1720 | : 1721 | SendPos(313) 1722 | Return 1723 | ;: >>来源窗口: 自定义类型{{{2 1724 | : 1725 | SendPos(314) 1726 | Return 1727 | ;: >>来源窗口: 按文件名排序{{{2 1728 | : 1729 | SendPos(321) 1730 | Return 1731 | ;: >>来源窗口: 按扩展名排序{{{2 1732 | : 1733 | SendPos(322) 1734 | Return 1735 | ;: >>来源窗口: 按大小排序{{{2 1736 | : 1737 | SendPos(323) 1738 | Return 1739 | ;: >>来源窗口: 按日期时间排序{{{2 1740 | : 1741 | SendPos(324) 1742 | Return 1743 | ;: >>来源窗口: 不排序{{{2 1744 | : 1745 | SendPos(325) 1746 | Return 1747 | ;: >>来源窗口: 反向排序{{{2 1748 | : 1749 | SendPos(330) 1750 | Return 1751 | ;: >>来源窗口: 打开驱动器列表{{{2 1752 | : 1753 | SendPos(331) 1754 | Return 1755 | ;: >>来源窗口: 缩略图{{{2 1756 | : 1757 | SendPos(269 ) 1758 | Return 1759 | ;: >>来源窗口: 自定义视图菜单{{{2 1760 | : 1761 | SendPos(270) 1762 | Return 1763 | ;: >>来源窗口: 焦点置于路径上{{{2 1764 | : 1765 | SendPos(332) 1766 | Return 1767 | ;左窗口 ========================================= 1768 | Return 1769 | ;: >>左窗口: 显示文件备注{{{2 1770 | : 1771 | SendPos(100) 1772 | Return 1773 | ;: >>左窗口: 列表{{{2 1774 | : 1775 | SendPos(101) 1776 | Return 1777 | ;: >>左窗口: 详细信息{{{2 1778 | : 1779 | SendPos(102) 1780 | Return 1781 | ;: >>左窗口: 文件夹树{{{2 1782 | : 1783 | SendPos(103) 1784 | Return 1785 | ;: >>左窗口: 快速查看{{{2 1786 | : 1787 | SendPos(104) 1788 | Return 1789 | ;: >>左窗口: 快速查看(不用插件){{{2 1790 | : 1791 | SendPos(106) 1792 | Return 1793 | ;: >>左窗口: 关闭快速查看窗口{{{2 1794 | : 1795 | SendPos(107) 1796 | Return 1797 | ;: >>左窗口: 可执行文件{{{2 1798 | : 1799 | SendPos(111) 1800 | Return 1801 | ;: >> 左窗口: 所有文件{{{2 1802 | : 1803 | SendPos(112) 1804 | Return 1805 | ;: >>左窗口: 上次选中的文件{{{2 1806 | : 1807 | SendPos(113) 1808 | Return 1809 | ;: >>左窗口: 自定义类型{{{2 1810 | : 1811 | SendPos(114) 1812 | Return 1813 | ;: >>左窗口: 按文件名排序{{{2 1814 | : 1815 | SendPos(121) 1816 | Return 1817 | ;: >>左窗口: 按扩展名排序{{{2 1818 | : 1819 | SendPos(122) 1820 | Return 1821 | ;: >>左窗口: 按大小排序{{{2 1822 | : 1823 | SendPos(123) 1824 | Return 1825 | ;: >>左窗口: 按日期时间排序{{{2 1826 | : 1827 | SendPos(124) 1828 | Return 1829 | ;: >>左窗口: 不排序{{{2 1830 | : 1831 | SendPos(125) 1832 | Return 1833 | ;: >>左窗口: 反向排序{{{2 1834 | : 1835 | SendPos(130) 1836 | Return 1837 | ;: >>左窗口: 打开驱动器列表{{{2 1838 | : 1839 | SendPos(131) 1840 | Return 1841 | ;: >>左窗口: 焦点置于路径上{{{2 1842 | : 1843 | SendPos(132) 1844 | Return 1845 | ;: >>左窗口: 展开所有文件夹{{{2 1846 | : 1847 | SendPos(203) 1848 | Return 1849 | ;: >> 左窗口: 只展开选中的文件夹{{{2 1850 | : 1851 | SendPos(204) 1852 | Return 1853 | ;: >>窗口: 缩略图{{{2 1854 | : 1855 | SendPos(69) 1856 | Return 1857 | ;: >> 窗口: 自定义视图菜单{{{2 1858 | : 1859 | SendPos(70) 1860 | Return 1861 | ;右窗口 ========================================= 1862 | Return 1863 | ;: >>右窗口: 显示文件备注{{{2 1864 | : 1865 | SendPos(200) 1866 | Return 1867 | ;: >>右窗口: 列表{{{2 1868 | : 1869 | SendPos(201) 1870 | Return 1871 | ;: >> 详细信息{{{2 1872 | : 1873 | SendPos(202) 1874 | Return 1875 | ;: >> 右窗口: 文件夹树{{{2 1876 | : 1877 | SendPos(203) 1878 | Return 1879 | ;: >> 右窗口: 快速查看{{{2 1880 | : 1881 | SendPos(204) 1882 | Return 1883 | ;: >> 右窗口: 快速查看(不用插件){{{2 1884 | : 1885 | SendPos(206) 1886 | Return 1887 | ;: >> 右窗口: 关闭快速查看窗口{{{2 1888 | : 1889 | SendPos(207) 1890 | Return 1891 | ;: >> 右窗口: 可执行文件{{{2 1892 | : 1893 | SendPos(211) 1894 | Return 1895 | ;: >> 右窗口: 所有文件{{{2 1896 | : 1897 | SendPos(212) 1898 | Return 1899 | ;: >> 右窗口: 上次选中的文件{{{2 1900 | : 1901 | SendPos(213) 1902 | Return 1903 | ;: >> 右窗口: 自定义类型{{{2 1904 | : 1905 | SendPos(214) 1906 | Return 1907 | ;: >> 右窗口: 按文件名排序{{{2 1908 | : 1909 | SendPos(221) 1910 | Return 1911 | ;: >> 右窗口: 按扩展名排序{{{2 1912 | : 1913 | SendPos(222) 1914 | Return 1915 | ;: >> 右窗口: 按大小排序{{{2 1916 | : 1917 | SendPos(223) 1918 | Return 1919 | ;: >> 右窗口: 按日期时间排序{{{2 1920 | : 1921 | SendPos(224) 1922 | Return 1923 | ;: >> 右窗口: 不排序{{{2 1924 | : 1925 | SendPos(225) 1926 | Return 1927 | ;: >> 右窗口: 反向排序{{{2 1928 | : 1929 | SendPos(230) 1930 | Return 1931 | ;: >> 右窗口: 打开驱动器列表{{{2 1932 | : 1933 | SendPos(231) 1934 | Return 1935 | ;: >> 右窗口: 焦点置于路径上{{{2 1936 | : 1937 | SendPos(232) 1938 | Return 1939 | ;: >>右窗口: 展开所有文件夹{{{2 1940 | : 1941 | SendPos(2035) 1942 | Return 1943 | ;: >>右窗口: 只展开选中的文件夹{{{2 1944 | : 1945 | SendPos(2048) 1946 | Return 1947 | ;: >> 右窗口: 缩略图{{{2 1948 | : 1949 | SendPos(169) 1950 | Return 1951 | ;: >> 右窗口: 自定义视图菜单{{{2 1952 | : 1953 | SendPos(170) 1954 | Return 1955 | ;文件操作 ========================================= 1956 | Return 1957 | ;: >> 查看(用查看程序){{{2 1958 | : 1959 | SendPos(903) 1960 | Return 1961 | ;: >>查看(用查看程序, 但不用插件/多媒体){{{2 1962 | : 1963 | SendPos(1006) 1964 | Return 1965 | ;: >> 编辑{{{2 1966 | : 1967 | SendPos(904) 1968 | Return 1969 | ;: >>复制{{{2 1970 | : 1971 | SendPos(905) 1972 | Return 1973 | ;: >>复制到当前窗口{{{2 1974 | : 1975 | SendPos(3100) 1976 | Return 1977 | ;: >>复制到另一窗口{{{2 1978 | : 1979 | SendPos(3101) 1980 | Return 1981 | ;: >>重命名/移动{{{2 1982 | : 1983 | SendPos(906) 1984 | Return 1985 | ;: >>新建文件夹{{{2 1986 | : 1987 | SendPos(907) 1988 | Return 1989 | ;: >>删除{{{2 1990 | : 1991 | SendPos(908) 1992 | Return 1993 | ;: >>测试压缩包{{{2 1994 | : 1995 | SendPos(518) 1996 | Return 1997 | ;: >>压缩文件{{{2 1998 | : 1999 | SendPos(508) 2000 | Return 2001 | ;: >>解压文件{{{2 2002 | : 2003 | SendPos(509) 2004 | Return 2005 | ;: >>重命名(Shift+F6){{{2 2006 | : 2007 | SendPos(1002) 2008 | Return 2009 | ;: >>重命名当前文件{{{2 2010 | : 2011 | SendPos(1007) 2012 | Return 2013 | ;: >>移动(F6){{{2 2014 | : 2015 | SendPos(1005) 2016 | Return 2017 | ;: >>显示属性{{{2 2018 | : 2019 | SendPos(1003) 2020 | Return 2021 | ;: >>创建快捷方式{{{2 2022 | : 2023 | SendPos(1004) 2024 | Return 2025 | ;: >>模仿按 ENTER 键{{{2 2026 | : 2027 | SendPos(1001) 2028 | Return 2029 | ;: >>以其他用户身份运行光标处的程序{{{2 2030 | : 2031 | SendPos(2800) 2032 | Return 2033 | ;: >>分割文件{{{2 2034 | : 2035 | SendPos(560) 2036 | Return 2037 | ;: >>合并文件{{{2 2038 | : 2039 | SendPos(561) 2040 | Return 2041 | ;: >>编码文件(MIME/UUE/XXE 格式){{{2 2042 | : 2043 | SendPos(562) 2044 | Return 2045 | ;: >>解码文件(MIME/UUE/XXE/BinHex 格式){{{2 2046 | : 2047 | SendPos(563) 2048 | Return 2049 | ;: >>创建校验文件{{{2 2050 | : 2051 | SendPos(564) 2052 | Return 2053 | ;: >>验证校验和{{{2 2054 | : 2055 | SendPos(565) 2056 | Return 2057 | ;: >>更改属性{{{2 2058 | : 2059 | SendPos(502) 2060 | Return 2061 | ;配置 ========================================= 2062 | Return 2063 | ;: >>配置: 布局{{{2 2064 | : 2065 | SendPos(490) 2066 | Return 2067 | ;: >>配置: 显示{{{2 2068 | : 2069 | SendPos(486) 2070 | Return 2071 | ;: >>配置: 图标{{{2 2072 | : 2073 | SendPos(477) 2074 | Return 2075 | ;: >>配置: 字体{{{2 2076 | : 2077 | SendPos(492) 2078 | Return 2079 | ;: >>配置: 颜色{{{2 2080 | : 2081 | SendPos(494) 2082 | Return 2083 | ;: >>配置: 制表符{{{2 2084 | : 2085 | SendPos(497) 2086 | Return 2087 | ;: >>配置: 文件夹标签{{{2 2088 | : 2089 | SendPos(488) 2090 | Return 2091 | ;: >>配置: 自定义列{{{2 2092 | : 2093 | SendPos(483) 2094 | Return 2095 | ;: >>更改当前自定义列{{{2 2096 | : 2097 | SendPos(2920) 2098 | Return 2099 | ;: >>配置: 语言{{{2 2100 | : 2101 | SendPos(499) 2102 | Return 2103 | ;: >>配置: 操作方式{{{2 2104 | : 2105 | SendPos(516) 2106 | Return 2107 | ;: >>配置: 编辑/查看{{{2 2108 | : 2109 | SendPos(496) 2110 | Return 2111 | ;: >>配置: 复制/删除{{{2 2112 | : 2113 | SendPos(487) 2114 | Return 2115 | ;: >>配置: 刷新{{{2 2116 | : 2117 | SendPos(478) 2118 | Return 2119 | ;: >>配置: 快速搜索{{{2 2120 | : 2121 | SendPos(479) 2122 | Return 2123 | ;: >>配置: FTP{{{2 2124 | : 2125 | SendPos(489) 2126 | Return 2127 | ;: >>配置: 插件{{{2 2128 | : 2129 | SendPos(484) 2130 | Return 2131 | ;: >>配置: 缩略图{{{2 2132 | : 2133 | SendPos(482) 2134 | Return 2135 | ;: >>配置: 日志文件{{{2 2136 | : 2137 | SendPos(481) 2138 | Return 2139 | ;: >>配置: 隐藏文件{{{2 2140 | : 2141 | SendPos(480) 2142 | Return 2143 | ;: >>配置: 压缩程序{{{2 2144 | : 2145 | SendPos(491) 2146 | Return 2147 | ;: >>配置: ZIP 压缩程序{{{2 2148 | : 2149 | SendPos(485) 2150 | Return 2151 | ;: >>配置: 其他/确认{{{2 2152 | : 2153 | SendPos(495) 2154 | Return 2155 | ;: >>保存位置{{{2 2156 | : 2157 | SendPos(493) 2158 | Return 2159 | ;: >>更改工具栏{{{2 2160 | : 2161 | SendPos(498) 2162 | Return 2163 | ;: >>保存设置{{{2 2164 | : 2165 | SendPos(580) 2166 | Return 2167 | ;: >>直接修改配置文件{{{2 2168 | : 2169 | SendPos(581) 2170 | Return 2171 | ;: >>保存文件夹历史记录{{{2 2172 | : 2173 | SendPos(582) 2174 | Return 2175 | ;: >>更改开始菜单{{{2 2176 | : 2177 | SendPos(700) 2178 | Return 2179 | ;网络 ========================================= 2180 | Return 2181 | ;: >>映射网络驱动器{{{2 2182 | : 2183 | SendPos(512) 2184 | Return 2185 | ;: >>断开网络驱动器{{{2 2186 | : 2187 | SendPos(513) 2188 | Return 2189 | ;: >>共享当前文件夹{{{2 2190 | : 2191 | SendPos(514) 2192 | Return 2193 | ;: >>取消文件夹共享{{{2 2194 | : 2195 | SendPos(515) 2196 | Return 2197 | ;: >>显示系统共享文件夹{{{2 2198 | : 2199 | SendPos(2204) 2200 | Return 2201 | ;: >>显示本地文件的远程用户{{{2 2202 | : 2203 | SendPos(2203) 2204 | Return 2205 | ;其他 ========================================= 2206 | Return 2207 | ;: >>计算占用空间{{{2 2208 | : 2209 | SendPos(503) 2210 | Return 2211 | ;: >>设置卷标{{{2 2212 | : 2213 | SendPos(505) 2214 | Return 2215 | ;: >>版本信息{{{2 2216 | : 2217 | SendPos(510) 2218 | Return 2219 | ;: >>打开命令提示符窗口{{{2 2220 | : 2221 | SendPos(511) 2222 | Return 2223 | ;: >>比较文件夹{{{2 2224 | : 2225 | SendPos(533) 2226 | Return 2227 | ;: >>比较文件夹(同时标出另一窗口没有的子文件夹){{{2 2228 | : 2229 | SendPos(536) 2230 | Return 2231 | ;: >>显示快捷菜单{{{2 2232 | : 2233 | SendPos(2500) 2234 | Return 2235 | ;: >>显示快捷菜单(内部关联){{{2 2236 | : 2237 | SendPos(2927) 2238 | Return 2239 | ;: >>显示光标处文件的内部关联快捷菜单{{{2 2240 | : 2241 | SendPos(2928) 2242 | Return 2243 | ;: >>媒体中心遥控器播放/暂停键快捷菜单{{{2 2244 | : 2245 | SendPos(2930) 2246 | Return 2247 | ;: >>两边窗口同步更改文件夹{{{2 2248 | : 2249 | SendPos(2600) 2250 | Return 2251 | ;: >>编辑文件备注{{{2 2252 | : 2253 | SendPos(2700) 2254 | Return 2255 | ;: >>焦点置于左窗口{{{2 2256 | : 2257 | SendPos(4001) 2258 | Return 2259 | ;: >>焦点置于右窗口{{{2 2260 | : 2261 | SendPos(4002) 2262 | Return 2263 | ;: >>焦点置于命令行{{{2 2264 | : 2265 | SendPos(4003) 2266 | Return 2267 | ;: >>焦点置于工具栏{{{2 2268 | : 2269 | SendPos(4004) 2270 | Return 2271 | ;: >>计算所有文件夹占用的空间{{{2 2272 | : 2273 | SendPos(2014) 2274 | Return 2275 | ;: >>卸载所有插件{{{2 2276 | : 2277 | SendPos(2913) 2278 | Return 2279 | ;: >>标出新文件, 隐藏相同者{{{2 2280 | : 2281 | SendPos(534) 2282 | Return 2283 | ;: >>交换左右窗口{{{2 2284 | : 2285 | SendPos(531) 2286 | Return 2287 | ;: >>目标 = 来源{{{2 2288 | : 2289 | SendPos(532) 2290 | Return 2291 | ;: >>刷新选中文件的缩略图{{{2 2292 | : 2293 | SendPos(2918) 2294 | Return 2295 | ;并口 ========================================= 2296 | Return 2297 | ;: >>直接电缆连接{{{2 2298 | : 2299 | SendPos(2300) 2300 | Return 2301 | ;: >>加载 NT 并口驱动程序{{{2 2302 | : 2303 | SendPos(2301) 2304 | Return 2305 | ;: >>卸载 NT 并口驱动程序{{{2 2306 | : 2307 | SendPos(2302) 2308 | Return 2309 | ;打印 ========================================= 2310 | Return 2311 | ;: >>打印文件列表{{{2 2312 | : 2313 | SendPos(2027) 2314 | Return 2315 | ;: >>打印文件列表(含子文件夹){{{2 2316 | : 2317 | SendPos(2028) 2318 | Return 2319 | ;: >>打印文件内容{{{2 2320 | : 2321 | SendPos(504) 2322 | Return 2323 | ;选择 ========================================= 2324 | Return 2325 | ;: >>选择一组文件{{{2 2326 | : 2327 | SendPos(521) 2328 | Return 2329 | ;: >>选择一组: 文件和文件夹{{{2 2330 | : 2331 | SendPos(3311) 2332 | Return 2333 | ;: >>选择一组: 仅文件{{{2 2334 | : 2335 | SendPos(3312) 2336 | Return 2337 | ;: >>选择一组: 仅文件夹{{{2 2338 | : 2339 | SendPos(3313) 2340 | Return 2341 | ;: >>不选一组文件{{{2 2342 | : 2343 | SendPos(522) 2344 | Return 2345 | ;: >>不选一组: 仅文件{{{2 2346 | : 2347 | SendPos(3314) 2348 | Return 2349 | ;: >>不选一组: 仅文件夹{{{2 2350 | : 2351 | SendPos(3315) 2352 | Return 2353 | ;: >>不选一组: 文件和/或文件夹(视配置而定){{{2 2354 | : 2355 | SendPos(3316) 2356 | Return 2357 | ;: >>全部选择: 文件和/或文件夹(视配置而定){{{2 2358 | : 2359 | SendPos(523) 2360 | Return 2361 | ;: >>全部选择: 文件和文件夹{{{2 2362 | : 2363 | SendPos(3301) 2364 | Return 2365 | ;: >>全部选择: 仅文件{{{2 2366 | : 2367 | SendPos(3302) 2368 | Return 2369 | ;: >>全部选择: 仅文件夹{{{2 2370 | : 2371 | SendPos(3303) 2372 | Return 2373 | ;: >>全部取消: 文件和文件夹{{{2 2374 | : 2375 | SendPos(524) 2376 | Return 2377 | ;: >>全部取消: 仅文件{{{2 2378 | : 2379 | SendPos(3304) 2380 | Return 2381 | ;: >>全部取消: 仅文件夹{{{2 2382 | : 2383 | SendPos(3305) 2384 | Return 2385 | ;: >>全部取消: 文件和/或文件夹(视配置而定){{{2 2386 | : 2387 | SendPos(3306) 2388 | Return 2389 | ;: >>反向选择{{{2 2390 | : 2391 | SendPos(525) 2392 | Return 2393 | ;: >>反向选择: 文件和文件夹{{{2 2394 | : 2395 | SendPos(3321) 2396 | Return 2397 | ;: >>反向选择: 仅文件{{{2 2398 | : 2399 | SendPos(3322) 2400 | Return 2401 | ;: >>反向选择: 仅文件夹{{{2 2402 | : 2403 | SendPos(3323) 2404 | Return 2405 | ;: >>选择扩展名相同的文件{{{2 2406 | : 2407 | SendPos(527) 2408 | Return 2409 | ;: >>不选扩展名相同的文件{{{2 2410 | : 2411 | SendPos(528) 2412 | Return 2413 | ;: >>选择文件名相同的文件{{{2 2414 | : 2415 | SendPos(541) 2416 | Return 2417 | ;: >>不选文件名相同的文件{{{2 2418 | : 2419 | SendPos(542) 2420 | Return 2421 | ;: >>选择文件名和扩展名相同的文件{{{2 2422 | : 2423 | SendPos(543) 2424 | Return 2425 | ;: >>不选文件名和扩展名相同的文件{{{2 2426 | : 2427 | SendPos(544) 2428 | Return 2429 | ;: >>选择同一路径下的文件(展开文件夹+搜索文件){{{2 2430 | : 2431 | SendPos(537) 2432 | Return 2433 | ;: >>不选同一路径下的文件(展开文件夹+搜索文件){{{2 2434 | : 2435 | SendPos(538) 2436 | Return 2437 | ;: >>恢复选择列表{{{2 2438 | : 2439 | SendPos(529) 2440 | Return 2441 | ;: >>保存选择列表{{{2 2442 | : 2443 | SendPos(530) 2444 | Return 2445 | ;: >>导出选择列表{{{2 2446 | : 2447 | SendPos(2031) 2448 | Return 2449 | ;: >>导出选择列表(ANSI){{{2 2450 | : 2451 | SendPos(2041) 2452 | Return 2453 | ;: >>导出选择列表(Unicode){{{2 2454 | : 2455 | SendPos(2042) 2456 | Return 2457 | ;: >>导出详细信息{{{2 2458 | : 2459 | SendPos(2039) 2460 | Return 2461 | ;: >>导出详细信息(ANSI){{{2 2462 | : 2463 | SendPos(2043) 2464 | Return 2465 | ;: >>导出详细信息(Unicode){{{2 2466 | : 2467 | SendPos(2044) 2468 | Return 2469 | ;: >>导入选择列表(从文件){{{2 2470 | : 2471 | SendPos(2032) 2472 | Return 2473 | ;: >>导入选择列表(从剪贴板){{{2 2474 | : 2475 | SendPos(2033) 2476 | Return 2477 | ;安全 ========================================= 2478 | Return 2479 | ;: >>设置权限(NTFS){{{2 2480 | : 2481 | SendPos(2200) 2482 | Return 2483 | ;: >>审核文件(NTFS){{{2 2484 | : 2485 | SendPos(2201) 2486 | Return 2487 | ;: >>获取所有权(NTFS){{{2 2488 | : 2489 | SendPos(2202) 2490 | Return 2491 | ;剪贴板 ========================================= 2492 | Return 2493 | ;: >>剪切选中的文件到剪贴板{{{2 2494 | : 2495 | SendPos(2007) 2496 | Return 2497 | ;: >>复制选中的文件到剪贴板{{{2 2498 | : 2499 | SendPos(2008) 2500 | Return 2501 | ;: >>从剪贴板粘贴到当前文件夹{{{2 2502 | : 2503 | SendPos(2009) 2504 | Return 2505 | ;: >>复制文件名{{{2 2506 | : 2507 | SendPos(2017) 2508 | Return 2509 | ;: >>复制文件名及完整路径{{{2 2510 | : 2511 | SendPos(2018) 2512 | Return 2513 | ;: >>复制文件名及网络路径{{{2 2514 | : 2515 | SendPos(2021) 2516 | Return 2517 | ;: >>复制来源路径{{{2 2518 | : 2519 | SendPos(2029) 2520 | Return 2521 | ;: >>复制目标路径{{{2 2522 | : 2523 | SendPos(2030) 2524 | Return 2525 | ;: >>复制文件详细信息{{{2 2526 | : 2527 | SendPos(2036) 2528 | Return 2529 | ;: >>复制文件详细信息及完整路径{{{2 2530 | : 2531 | SendPos(2037) 2532 | Return 2533 | ;: >>复制文件详细信息及网络路径{{{2 2534 | : 2535 | SendPos(2038) 2536 | Return 2537 | ;FTP ========================================= 2538 | Return 2539 | ;: >>FTP 连接{{{2 2540 | : 2541 | SendPos(550) 2542 | Return 2543 | ;: >>新建 FTP 连接{{{2 2544 | : 2545 | SendPos(551) 2546 | Return 2547 | ;: >>断开 FTP 连接{{{2 2548 | : 2549 | SendPos(552) 2550 | Return 2551 | ;: >>显示隐藏文件{{{2 2552 | : 2553 | SendPos(553) 2554 | Return 2555 | ;: >>中止当前 FTP 命令{{{2 2556 | : 2557 | SendPos(554) 2558 | Return 2559 | ;: >>续传{{{2 2560 | : 2561 | SendPos(555) 2562 | Return 2563 | ;: >>选择传输模式{{{2 2564 | : 2565 | SendPos(556) 2566 | Return 2567 | ;: >>添加到下载列表{{{2 2568 | : 2569 | SendPos(557) 2570 | Return 2571 | ;: >>按列表下载{{{2 2572 | : 2573 | SendPos(558) 2574 | Return 2575 | ;导航 ========================================= 2576 | Return 2577 | ;: >>后退{{{2 2578 | : 2579 | SendPos(570) 2580 | Return 2581 | ;: >>前进{{{2 2582 | : 2583 | SendPos(571) 2584 | Return 2585 | ;: >>文件夹历史记录{{{2 2586 | : 2587 | Vim_HotkeyCount := 0 2588 | SendPos(572) 2589 | Return 2590 | ;: >>后退(非 FTP){{{2 2591 | : 2592 | SendPos(573) 2593 | Return 2594 | ;: >>前进(非 FTP){{{2 2595 | : 2596 | SendPos(574) 2597 | Return 2598 | ;: >>常用文件夹{{{2 2599 | : 2600 | Vim_HotkeyCount := 0 2601 | SendPos(526) 2602 | Return 2603 | ;: >>转到根文件夹{{{2 2604 | : 2605 | SendPos(2001) 2606 | Return 2607 | ;: >>转到上层文件夹{{{2 2608 | : 2609 | SendPos(2002) 2610 | Return 2611 | ;: >>打开光标处的文件夹或压缩包{{{2 2612 | : 2613 | SendPos(2003) 2614 | Return 2615 | ;: >>桌面{{{2 2616 | : 2617 | SendPos(2121) 2618 | Return 2619 | ;: >>我的电脑{{{2 2620 | : 2621 | SendPos(2122) 2622 | Return 2623 | ;: >>控制面板{{{2 2624 | : 2625 | SendPos(2123) 2626 | Return 2627 | ;: >>字体{{{2 2628 | : 2629 | SendPos(2124) 2630 | Return 2631 | ;: >>网上邻居{{{2 2632 | : 2633 | SendPos(2125) 2634 | Return 2635 | ;: >>打印机{{{2 2636 | : 2637 | SendPos(2126) 2638 | Return 2639 | ;: >>回收站{{{2 2640 | : 2641 | SendPos(2127) 2642 | Return 2643 | ;: >>更改文件夹{{{2 2644 | : 2645 | SendPos(500) 2646 | Return 2647 | ;: >>在左窗口打开光标处的文件夹或压缩包{{{2 2648 | : 2649 | SendPos(2024) 2650 | Return 2651 | ;: >>在右窗口打开光标处的文件夹或压缩包{{{2 2652 | : 2653 | SendPos(2025) 2654 | Return 2655 | ;: >>编辑来源窗口的路径{{{2 2656 | : 2657 | SendPos(2912) 2658 | Return 2659 | ;: >>光标移到列表中的第一个文件{{{2 2660 | : 2661 | SendPos(2050) 2662 | Return 2663 | ;: >>转到下一个驱动器{{{2 2664 | : 2665 | SendPos(2051) 2666 | Return 2667 | ;: >>转到上一个驱动器{{{2 2668 | : 2669 | SendPos(2052) 2670 | Return 2671 | ;: >>转到下一个选中的文件{{{2 2672 | : 2673 | SendPos(2053) 2674 | Return 2675 | ;: >>转到上一个选中的文件{{{2 2676 | : 2677 | SendPos(2054) 2678 | Return 2679 | ;: >>转到驱动器 A{{{2 2680 | : 2681 | SendPos(2061) 2682 | Return 2683 | ;: >>转到驱动器 C{{{2 2684 | : 2685 | SendPos(2063) 2686 | Return 2687 | ;: >>转到驱动器 D{{{2 2688 | : 2689 | SendPos(2064) 2690 | Return 2691 | ;: >>转到驱动器 E{{{2 2692 | : 2693 | SendPos(2065) 2694 | Return 2695 | ;: >>可自定义其他驱动器{{{2 2696 | : 2697 | SendPos(2066) 2698 | Return 2699 | ;: >>最多 26 个{{{2 2700 | : 2701 | SendPos(2086) 2702 | Return 2703 | ;帮助 ========================================= 2704 | Return 2705 | ;: >>帮助索引{{{2 2706 | : 2707 | SendPos(610) 2708 | Return 2709 | ;: >>快捷键列表{{{2 2710 | : 2711 | SendPos(620) 2712 | Return 2713 | ;: >>注册信息{{{2 2714 | : 2715 | SendPos(630) 2716 | Return 2717 | ;: >>访问 Totalcmd 网站{{{2 2718 | : 2719 | SendPos(640) 2720 | Return 2721 | ;: >>关于 Total Commander{{{2 2722 | : 2723 | SendPos(690) 2724 | Return 2725 | ;窗口 ========================================= 2726 | Return 2727 | ;: >>退出 Total Commander{{{2 2728 | : 2729 | SendPos(24340) 2730 | Return 2731 | ;: >>最小化 Total Commander{{{2 2732 | : 2733 | SendPos(2000) 2734 | Return 2735 | ;: >>最大化 Total Commander{{{2 2736 | : 2737 | SendPos(2015) 2738 | Return 2739 | ;: >>恢复正常大小{{{2 2740 | : 2741 | SendPos(2016) 2742 | Return 2743 | ;命令行 ========================================= 2744 | Return 2745 | ;: >>清除命令行{{{2 2746 | : 2747 | SendPos(2004) 2748 | Return 2749 | ;: >>下一条命令{{{2 2750 | : 2751 | SendPos(2005) 2752 | Return 2753 | ;: >>上一条命令{{{2 2754 | : 2755 | SendPos(2006) 2756 | Return 2757 | ;: >>将路径复制到命令行{{{2 2758 | : 2759 | SendPos(2019) 2760 | Return 2761 | ;工具 ========================================= 2762 | Return 2763 | ;: >>批量重命名{{{2 2764 | : 2765 | SendPos(2400) 2766 | Return 2767 | ;: >>系统信息{{{2 2768 | : 2769 | SendPos(506) 2770 | Return 2771 | ;: >>后台传输管理器{{{2 2772 | : 2773 | SendPos(559) 2774 | Return 2775 | ;: >>搜索文件{{{2 2776 | : 2777 | SendPos(501) 2778 | Return 2779 | ;: >>同步文件夹{{{2 2780 | : 2781 | SendPos(2020) 2782 | Return 2783 | ;: >>文件关联{{{2 2784 | : 2785 | SendPos(507) 2786 | Return 2787 | ;: >>定义内部关联{{{2 2788 | : 2789 | SendPos(519) 2790 | Return 2791 | ;: >>比较文件内容{{{2 2792 | : 2793 | SendPos(2022) 2794 | Return 2795 | ;: >>使用内部比较程序{{{2 2796 | : 2797 | SendPos(2040) 2798 | Return 2799 | ;: >>浏览内部命令{{{2 2800 | : 2801 | SendPos(2924) 2802 | Return 2803 | ;视图 ========================================= 2804 | Return 2805 | ;: >>显示/隐藏: 工具栏{{{2 2806 | : 2807 | SendPos(2901) 2808 | Return 2809 | ;: >>显示/隐藏: 驱动器按钮{{{2 2810 | : 2811 | SendPos(2902) 2812 | Return 2813 | ;: >>显示/隐藏: 两个驱动器按钮栏{{{2 2814 | : 2815 | SendPos(2903) 2816 | Return 2817 | ;: >>切换: 平坦/立体驱动器按钮{{{2 2818 | : 2819 | SendPos(2904) 2820 | Return 2821 | ;: >>切换: 平坦/立体用户界面{{{2 2822 | : 2823 | SendPos(2905) 2824 | Return 2825 | ;: >>显示/隐藏: 驱动器列表{{{2 2826 | : 2827 | SendPos(2906) 2828 | Return 2829 | ;: >>显示/隐藏: 当前文件夹{{{2 2830 | : 2831 | SendPos(2907) 2832 | Return 2833 | ;: >>显示/隐藏: 路径导航栏{{{2 2834 | : 2835 | SendPos(2926) 2836 | Return 2837 | ;: >>显示/隐藏: 排序制表符{{{2 2838 | : 2839 | SendPos(2908) 2840 | Return 2841 | ;: >>显示/隐藏: 状态栏{{{2 2842 | : 2843 | SendPos(2909) 2844 | Return 2845 | ;: >>显示/隐藏: 命令行{{{2 2846 | : 2847 | SendPos(2910) 2848 | Return 2849 | ;: >>显示/隐藏: 功能键按钮{{{2 2850 | : 2851 | SendPos(2911) 2852 | Return 2853 | ;: >>显示文件提示{{{2 2854 | : 2855 | SendPos(2914) 2856 | Return 2857 | ;: >>显示快速搜索窗口{{{2 2858 | : 2859 | SendPos(2915) 2860 | Return 2861 | ;: >>开启/关闭: 长文件名显示{{{2 2862 | : 2863 | SendPos(2010) 2864 | Return 2865 | ;: >>刷新来源窗口{{{2 2866 | : 2867 | SendPos(540) 2868 | Return 2869 | ;: >>仅显示选中的文件{{{2 2870 | : 2871 | SendPos(2023) 2872 | Return 2873 | ;: >>开启/关闭: 隐藏或系统文件显示{{{2 2874 | : 2875 | SendPos(2011) 2876 | Return 2877 | ;: >>开启/关闭: 8.3 式文件名小写显示{{{2 2878 | : 2879 | SendPos(2013) 2880 | Return 2881 | ;: >>开启/关闭: 文件夹按名称排序{{{2 2882 | : 2883 | SendPos(2012) 2884 | Return 2885 | ;: >>展开所有文件夹{{{2 2886 | : 2887 | SendPos(2026) 2888 | Return 2889 | ;: >>只展开选中的文件夹{{{2 2890 | : 2891 | SendPos(2046) 2892 | Return 2893 | ;: >>窗口分隔栏位于 50%{{{2 2894 | : 2895 | SendPos(909) 2896 | Return 2897 | ;: >>窗口分隔栏位于 100%{{{2 2898 | : 2899 | SendPos(910) 2900 | Return 2901 | ;: >>显示/隐藏: 文件夹标签{{{2 2902 | : 2903 | SendPos(2916) 2904 | Return 2905 | ;: >>显示/隐藏: XP 主题背景{{{2 2906 | : 2907 | SendPos(2923) 2908 | Return 2909 | ;: >>开启/关闭: 叠置图标显示{{{2 2910 | : 2911 | SendPos(2917) 2912 | Return 2913 | ;: >>显示/隐藏: 文件夹历史记录和常用文件夹按钮{{{2 2914 | : 2915 | SendPos(2919) 2916 | Return 2917 | ;: >>启用/禁用: 文件夹自动刷新{{{2 2918 | : 2919 | SendPos(2921) 2920 | Return 2921 | ;: >>启用/禁用: 自定义隐藏文件{{{2 2922 | : 2923 | SendPos(2922) 2924 | Return 2925 | ;: >>开启/关闭: 32 位 system32 目录重定向(64 位 Windows){{{2 2926 | : 2927 | SendPos(2925) 2928 | Return 2929 | ;: >>关闭独立文件夹树面板{{{2 2930 | : 2931 | SendPos(3200) 2932 | Return 2933 | ;: >>一个独立文件夹树面板{{{2 2934 | : 2935 | SendPos(3201) 2936 | Return 2937 | ;: >>两个独立文件夹树面板{{{2 2938 | : 2939 | SendPos(3202) 2940 | Return 2941 | ;: >>切换独立文件夹树面板状态{{{2 2942 | : 2943 | SendPos(3203) 2944 | Return 2945 | ;: >>开启/关闭: 一个独立文件夹树面板{{{2 2946 | : 2947 | SendPos(3204) 2948 | Return 2949 | ;: >>开启/关闭: 两个独立文件夹树面板{{{2 2950 | : 2951 | SendPos(3205) 2952 | Return 2953 | ;用户 ========================================= 2954 | Return 2955 | ;: >>用户菜单 1{{{2 2956 | : 2957 | SendPos(701) 2958 | Return 2959 | ;: >>用户菜单 2{{{2 2960 | : 2961 | SendPos(702) 2962 | Return 2963 | ;: >>用户菜单 3{{{2 2964 | : 2965 | SendPos(703) 2966 | Return 2967 | ;: >>...{{{2 2968 | : 2969 | SendPos(704) 2970 | Return 2971 | ;: >>5{{{2 2972 | : 2973 | SendPos(70) 2974 | Return 2975 | ;: >>6{{{2 2976 | : 2977 | SendPos(70) 2978 | Return 2979 | ;: >>7{{{2 2980 | : 2981 | SendPos(70) 2982 | Return 2983 | ;: >>8{{{2 2984 | : 2985 | SendPos(70) 2986 | Return 2987 | ;: >>9{{{2 2988 | : 2989 | SendPos(70) 2990 | Return 2991 | ;: >>可定义其他用户菜单{{{2 2992 | : 2993 | SendPos(710) 2994 | Return 2995 | ;标签 ========================================= 2996 | Return 2997 | ;: >>新建标签{{{2 2998 | : 2999 | SendPos(3001) 3000 | Return 3001 | ;: >>新建标签(在后台){{{2 3002 | : 3003 | SendPos(3002) 3004 | Return 3005 | ;: >>新建标签(并打开光标处的文件夹){{{2 3006 | : 3007 | SendPos(3003) 3008 | Return 3009 | ;: >>新建标签(在另一窗口打开文件夹){{{2 3010 | : 3011 | SendPos(3004) 3012 | Return 3013 | ;: >>下一个标签(Ctrl+Tab){{{2 3014 | : 3015 | SendPos(3005) 3016 | Return 3017 | ;: >>上一个标签(Ctrl+Shift+Tab){{{2 3018 | : 3019 | SendPos(3006) 3020 | Return 3021 | ;: >>关闭当前标签{{{2 3022 | : 3023 | SendPos(3007) 3024 | Return 3025 | ;: >>关闭所有标签{{{2 3026 | : 3027 | SendPos(3008) 3028 | Return 3029 | ;: >>显示标签菜单{{{2 3030 | : 3031 | SendPos(3009) 3032 | Return 3033 | ;: >>锁定/解锁当前标签{{{2 3034 | : 3035 | SendPos(3010) 3036 | Return 3037 | ;: >>锁定/解锁当前标签(可更改文件夹){{{2 3038 | : 3039 | SendPos(3012) 3040 | Return 3041 | ;: >>交换左右窗口及其标签{{{2 3042 | : 3043 | SendPos(535) 3044 | Return 3045 | ;: >>转到锁定标签的根文件夹{{{2 3046 | : 3047 | SendPos(3011) 3048 | Return 3049 | ;: >>来源窗口: 激活标签 1{{{2 3050 | : 3051 | SendPos(5001) 3052 | Return 3053 | ;: >>来源窗口: 激活标签 2{{{2 3054 | : 3055 | SendPos(5002) 3056 | Return 3057 | ;: >>...{{{2 3058 | : 3059 | SendPos(5003) 3060 | Return 3061 | ;: >>最多 99 个{{{2 3062 | : 3063 | SendPos(5004) 3064 | Return 3065 | ;: >>5{{{2 3066 | : 3067 | SendPos(5005) 3068 | Return 3069 | ;: >>6{{{2 3070 | : 3071 | SendPos(5006) 3072 | Return 3073 | ;: >>7{{{2 3074 | : 3075 | SendPos(5007) 3076 | Return 3077 | ;: >>8{{{2 3078 | : 3079 | SendPos(5008) 3080 | Return 3081 | ;: >>9{{{2 3082 | : 3083 | SendPos(5009) 3084 | Return 3085 | ;: >>0{{{2 3086 | : 3087 | SendPos(5010) 3088 | Return 3089 | ;: >>目标窗口: 激活标签 1{{{2 3090 | : 3091 | SendPos(5101) 3092 | Return 3093 | ;: >>目标窗口: 激活标签 2{{{2 3094 | : 3095 | SendPos(5102) 3096 | Return 3097 | ;: >>...{{{2 3098 | : 3099 | SendPos(5103) 3100 | Return 3101 | ;: >>最多 99 个{{{2 3102 | : 3103 | SendPos(5104) 3104 | Return 3105 | ;: >>5{{{2 3106 | : 3107 | SendPos(5105) 3108 | Return 3109 | ;: >>6{{{2 3110 | : 3111 | SendPos(5106) 3112 | Return 3113 | ;: >>7{{{2 3114 | : 3115 | SendPos(5107) 3116 | Return 3117 | ;: >>8{{{2 3118 | : 3119 | SendPos(5108) 3120 | Return 3121 | ;: >>9{{{2 3122 | : 3123 | SendPos(5109) 3124 | Return 3125 | ;: >>0{{{2 3126 | : 3127 | SendPos(5110) 3128 | Return 3129 | ;: >>左窗口: 激活标签 1{{{2 3130 | : 3131 | SendPos(5201) 3132 | Return 3133 | ;: >>左窗口: 激活标签 2{{{2 3134 | : 3135 | SendPos(5202) 3136 | Return 3137 | ;: >>...{{{2 3138 | : 3139 | SendPos(5203) 3140 | Return 3141 | ;: >>最多 99 个{{{2 3142 | : 3143 | SendPos(5204) 3144 | Return 3145 | ;: >>5{{{2 3146 | : 3147 | SendPos(5205) 3148 | Return 3149 | ;: >>6{{{2 3150 | : 3151 | SendPos(5206) 3152 | Return 3153 | ;: >>7{{{2 3154 | : 3155 | SendPos(5207) 3156 | Return 3157 | ;: >>8{{{2 3158 | : 3159 | SendPos(5208) 3160 | Return 3161 | ;: >>9{{{2 3162 | : 3163 | SendPos(5209) 3164 | Return 3165 | ;: >>0{{{2 3166 | : 3167 | SendPos(5210) 3168 | Return 3169 | ;: >>右窗口: 激活标签 1{{{2 3170 | : 3171 | SendPos(5301) 3172 | Return 3173 | ;: >>右窗口: 激活标签 2{{{2 3174 | : 3175 | SendPos(5302) 3176 | Return 3177 | ;: >>...{{{2 3178 | : 3179 | SendPos(5303) 3180 | Return 3181 | ;: >>最多 99 个{{{2 3182 | : 3183 | SendPos(5304) 3184 | Return 3185 | ;: >>5{{{2 3186 | : 3187 | SendPos(5305) 3188 | Return 3189 | ;: >>6{{{2 3190 | : 3191 | SendPos(5306) 3192 | Return 3193 | ;: >>7{{{2 3194 | : 3195 | SendPos(5307) 3196 | Return 3197 | ;: >>8{{{2 3198 | : 3199 | SendPos(5308) 3200 | Return 3201 | ;: >>9{{{2 3202 | : 3203 | SendPos(5309) 3204 | Return 3205 | ;: >>0{{{2 3206 | : 3207 | SendPos(5310) 3208 | Return 3209 | ;排序 ========================================= 3210 | Return 3211 | ;: >>来源窗口: 按第 1 列排序{{{2 3212 | : 3213 | SendPos(6001) 3214 | Return 3215 | ;: >>来源窗口: 按第 2 列排序{{{2 3216 | : 3217 | SendPos(6002) 3218 | Return 3219 | ;: >>...{{{2 3220 | : 3221 | SendPos(6003) 3222 | Return 3223 | ;: >>最多 99 列{{{2 3224 | : 3225 | SendPos(6004) 3226 | Return 3227 | ;: >>5{{{2 3228 | : 3229 | SendPos(6005) 3230 | Return 3231 | ;: >>6{{{2 3232 | : 3233 | SendPos(6006) 3234 | Return 3235 | ;: >>7{{{2 3236 | : 3237 | SendPos(6007) 3238 | Return 3239 | ;: >>8{{{2 3240 | : 3241 | SendPos(6008) 3242 | Return 3243 | ;: >>9{{{2 3244 | : 3245 | SendPos(6009) 3246 | Return 3247 | ;: >>0{{{2 3248 | : 3249 | SendPos(6010) 3250 | Return 3251 | ;: >>9{{{2 3252 | : 3253 | SendPos(6099) 3254 | Return 3255 | ;: >>目标窗口: 按第 1 列排序{{{2 3256 | : 3257 | SendPos(6101) 3258 | Return 3259 | ;: >>目标窗口: 按第 2 列排序{{{2 3260 | : 3261 | SendPos(6102) 3262 | Return 3263 | ;: >>...{{{2 3264 | : 3265 | SendPos(6103) 3266 | Return 3267 | ;: >>最多 99 列{{{2 3268 | : 3269 | SendPos(6104) 3270 | Return 3271 | ;: >>5{{{2 3272 | : 3273 | SendPos(6105) 3274 | Return 3275 | ;: >>6{{{2 3276 | : 3277 | SendPos(6106) 3278 | Return 3279 | ;: >>7{{{2 3280 | : 3281 | SendPos(6107) 3282 | Return 3283 | ;: >>8{{{2 3284 | : 3285 | SendPos(6108) 3286 | Return 3287 | ;: >>9{{{2 3288 | : 3289 | SendPos(6109) 3290 | Return 3291 | ;: >>0{{{2 3292 | : 3293 | SendPos(6110) 3294 | Return 3295 | ;: >>9{{{2 3296 | : 3297 | SendPos(6199) 3298 | Return 3299 | ;: >>左窗口: 按第 1 列排序{{{2 3300 | : 3301 | SendPos(6201) 3302 | Return 3303 | ;: >>左窗口: 按第 2 列排序{{{2 3304 | : 3305 | SendPos(6202) 3306 | Return 3307 | ;: >>...{{{2 3308 | : 3309 | SendPos(6203) 3310 | Return 3311 | ;: >>最多 99 列{{{2 3312 | : 3313 | SendPos(6204) 3314 | Return 3315 | ;: >>5{{{2 3316 | : 3317 | SendPos(6205) 3318 | Return 3319 | ;: >>6{{{2 3320 | : 3321 | SendPos(6206) 3322 | Return 3323 | ;: >>7{{{2 3324 | : 3325 | SendPos(6207) 3326 | Return 3327 | ;: >>8{{{2 3328 | : 3329 | SendPos(6208) 3330 | Return 3331 | ;: >>9{{{2 3332 | : 3333 | SendPos(6209) 3334 | Return 3335 | ;: >>0{{{2 3336 | : 3337 | SendPos(6210) 3338 | Return 3339 | ;: >>9{{{2 3340 | : 3341 | SendPos(6299) 3342 | Return 3343 | ;: >>右窗口: 按第 1 列排序{{{2 3344 | : 3345 | SendPos(6301) 3346 | Return 3347 | ;: >>右窗口: 按第 2 列排序{{{2 3348 | : 3349 | SendPos(6302) 3350 | Return 3351 | ;: >>...{{{2 3352 | : 3353 | SendPos(6303) 3354 | Return 3355 | ;: >>最多 99 列{{{2 3356 | : 3357 | SendPos(6304) 3358 | Return 3359 | ;: >>5{{{2 3360 | : 3361 | SendPos(6305) 3362 | Return 3363 | ;: >>6{{{2 3364 | : 3365 | SendPos(6306) 3366 | Return 3367 | ;: >>7{{{2 3368 | : 3369 | SendPos(6307) 3370 | Return 3371 | ;: >>8{{{2 3372 | : 3373 | SendPos(6308) 3374 | Return 3375 | ;: >>9{{{2 3376 | : 3377 | SendPos(6309) 3378 | Return 3379 | ;: >>0{{{2 3380 | : 3381 | SendPos(6310) 3382 | Return 3383 | ;: >>9{{{2 3384 | : 3385 | SendPos(6399) 3386 | Return 3387 | ;自定义列视图 ========================================= 3388 | Return 3389 | ;: >>来源窗口: 自定义列视图 1{{{2 3390 | : 3391 | SendPos(271) 3392 | Return 3393 | ;: >>来源窗口: 自定义列视图 2{{{2 3394 | : 3395 | SendPos(272) 3396 | Return 3397 | ;: >>...{{{2 3398 | : 3399 | SendPos(273) 3400 | Return 3401 | ;: >>最多 29 个{{{2 3402 | : 3403 | SendPos(274) 3404 | Return 3405 | ;: >>5{{{2 3406 | : 3407 | SendPos(275) 3408 | Return 3409 | ;: >>6{{{2 3410 | : 3411 | SendPos(276) 3412 | Return 3413 | ;: >>7{{{2 3414 | : 3415 | SendPos(277) 3416 | Return 3417 | ;: >>8{{{2 3418 | : 3419 | SendPos(278) 3420 | Return 3421 | ;: >>9{{{2 3422 | : 3423 | SendPos(279) 3424 | Return 3425 | ;: >>左窗口: 自定义列视图 1{{{2 3426 | : 3427 | SendPos(710) 3428 | Return 3429 | ;: >>左窗口: 自定义列视图 2{{{2 3430 | : 3431 | SendPos(72) 3432 | Return 3433 | ;: >>...{{{2 3434 | : 3435 | SendPos(73) 3436 | Return 3437 | ;: >>最多 29 个{{{2 3438 | : 3439 | SendPos(74) 3440 | Return 3441 | ;: >>5{{{2 3442 | : 3443 | SendPos(75) 3444 | Return 3445 | ;: >>6{{{2 3446 | : 3447 | SendPos(76) 3448 | Return 3449 | ;: >>7{{{2 3450 | : 3451 | SendPos(77) 3452 | Return 3453 | ;: >>8{{{2 3454 | : 3455 | SendPos(78) 3456 | Return 3457 | ;: >>9{{{2 3458 | : 3459 | SendPos(79) 3460 | Return 3461 | ;: >>右窗口: 自定义列视图 1{{{2 3462 | : 3463 | SendPos(171) 3464 | Return 3465 | ;: >>右窗口: 自定义列视图 2{{{2 3466 | : 3467 | SendPos(172) 3468 | Return 3469 | ;: >>...{{{2 3470 | : 3471 | SendPos(173) 3472 | Return 3473 | ;: >>最多 29 个{{{2 3474 | : 3475 | SendPos(174) 3476 | Return 3477 | ;: >>5{{{2 3478 | : 3479 | SendPos(175) 3480 | Return 3481 | ;: >>6{{{2 3482 | : 3483 | SendPos(176) 3484 | Return 3485 | ;: >>7{{{2 3486 | : 3487 | SendPos(177) 3488 | Return 3489 | ;: >>8{{{2 3490 | : 3491 | SendPos(178) 3492 | Return 3493 | ;: >>9{{{2 3494 | : 3495 | SendPos(179) 3496 | Return 3497 | ;: >>来源窗口: 下一个自定义视图{{{2 3498 | : 3499 | SendPos(5501) 3500 | Return 3501 | ;: >>来源窗口: 上一个自定义视图{{{2 3502 | : 3503 | SendPos(5502) 3504 | Return 3505 | ;: >>目标窗口: 下一个自定义视图{{{2 3506 | : 3507 | SendPos(5503) 3508 | Return 3509 | ;: >>目标窗口: 上一个自定义视图{{{2 3510 | : 3511 | SendPos(5504) 3512 | Return 3513 | ;: >>左窗口: 下一个自定义视图{{{2 3514 | : 3515 | SendPos(5505) 3516 | Return 3517 | ;: >>左窗口: 上一个自定义视图{{{2 3518 | : 3519 | SendPos(5506) 3520 | Return 3521 | ;: >>右窗口: 下一个自定义视图{{{2 3522 | : 3523 | SendPos(5507) 3524 | Return 3525 | ;: >>右窗口: 上一个自定义视图{{{2 3526 | : 3527 | SendPos(5508) 3528 | Return 3529 | ;: >>所有文件都按需加载备注{{{2 3530 | : 3531 | SendPos(5512) 3532 | Return 3533 | ;: >>仅选中的文件按需加载备注{{{2 3534 | : 3535 | SendPos(5513) 3536 | Return 3537 | ;: >>停止后台加载备注{{{2 3538 | : 3539 | SendPos(5514) 3540 | Return 3541 | -------------------------------------------------------------------------------- /src/VimDesktop/Plugins/totalcommander/totalcommander.ini: -------------------------------------------------------------------------------- 1 | [config] 2 | tcpath=E:\Program Files\totalcmd\totalcmd.exe 3 | tcini=E:\Program Files\totalcmd\wincmd.ini 4 | [redirect] 5 | lefthistory= 6 | righthistory= 7 | -------------------------------------------------------------------------------- /src/VimDesktop/Plugins/wps/wps.ahk: -------------------------------------------------------------------------------- 1 | WPS: 2 | return 3 | Global wpsApp 4 | vim.mode("insert","QWidget") 5 | ;vim.map("","","QWidget") 6 | 7 | vim.mode("normal","QWidget") 8 | wpsW := vim.VimWindows["QWidget"] 9 | wpsW.winMaxCount := 9999 10 | vim.map("h","","QWidget") 11 | vim.map("l","","QWidget") 12 | vim.map("j","","QWidget") 13 | vim.map("k","","QWidget") 14 | 15 | vim.Comment("","向左移动一个字符",0) 16 | vim.Comment("","向右移动一个字符",0) 17 | vim.Comment("","向下移动一行",0) 18 | vim.Comment("","向上移动一行",0) 19 | 20 | vim.map("1","<1>","QWidget") 21 | vim.map("2","<2>","QWidget") 22 | vim.map("3","<3>","QWidget") 23 | vim.map("4","<4>","QWidget") 24 | vim.map("5","<5>","QWidget") 25 | vim.map("6","<6>","QWidget") 26 | vim.map("7","<7>","QWidget") 27 | vim.map("8","<8>","QWidget") 28 | vim.map("9","<9>","QWidget") 29 | vim.map("0","<0>","QWidget") 30 | 31 | ;Msgbox % vim.ListKey("QWidget") 32 | return 33 | 34 | QWidget_CheckMode() { 35 | winGet,name,ProcessName,ahk_class QWidget 36 | 37 | If RegExMatch(name,"i)^wps\.exe$") 38 | { 39 | If Not Strlen(wpsApp.version) 40 | wpsApp := ComObjectCreate("WPS.Application") 41 | } 42 | Else 43 | Return True 44 | } 45 | 46 | : 47 | vim.mode("normal","QWidget") 48 | return 49 | : 50 | vim.mode("insert","QWidget") 51 | return 52 | 53 | 54 | 55 | : 56 | WPS_NextChar() 57 | Return 58 | 59 | WPS_NextChar(){ 60 | Selection := wpsApp.Selection 61 | Selection.Next(1,vim.GetCount()).Select 62 | } 63 | 64 | : 65 | WPS_PreviousChar() 66 | Return 67 | 68 | WPS_PreviousChar(){ 69 | Selection := wpsApp.Selection 70 | Selection.Previous(1,Vim.GetCount()).Select 71 | } 72 | 73 | : 74 | WPS_NextLine() 75 | Return 76 | 77 | : 78 | WPS_PreviousLine() 79 | Return 80 | 81 | WPS_NextLine(){ 82 | ;OLDpos := wpsApp.Range.Start 83 | Loop % Vim.GetCount() 84 | DelaySend("{Down}") 85 | ;wpsApp.Selection.Range.END := wpsApp.Selection.Range.Start + 1 86 | Pos := wpsApp.Selection.Start 87 | MsgBox % Pos 88 | wpsApp.Selection.Start := wpsApp.Selection.Start - 1 89 | wpsApp.Selection.END := Pos 90 | wpsApp.Selection.Select 91 | } 92 | WPS_PreviousLine(){ 93 | Loop % Vim.GetCount() 94 | DelaySend("{UP}") 95 | Pos := wpsApp.Selection.Start 96 | wpsApp.Selection.END := wpsApp.Selection.Start + 1 97 | wpsApp.Selection.Select 98 | } 99 | WPS_NextPara(){ 100 | Range := wpsApp.Selection.Next(4,Vim.GetCount()) 101 | Range.END := Range.Start + 1 102 | Range.Select 103 | } 104 | DelaySend(Keys){ 105 | Delay := A_KeyDelay 106 | Setkeydelay,10 107 | Send,%Keys% 108 | Setkeydelay,%Delay% 109 | } 110 | -------------------------------------------------------------------------------- /src/VimDesktop/check.ahk: -------------------------------------------------------------------------------- 1 | #NoTrayIcon 2 | Send_WM_COPYDATA("exitapp") 3 | FileEncoding,utf-8 4 | ExtensionsAHK := A_ScriptDir "\plugins\plugins.ahk" 5 | /*If Not FileExist(ExtensionsAHK) 6 | FileAppend,,%ExtensionsAHK% 7 | FileRead,Extensions,%ExtensionsAHK% 8 | ; 验证Extensions里Include的插件是否存在 9 | Loop,Parse,Extensions,`n,`r 10 | { 11 | If Not RegExMatch(A_LoopField,"i)^#include") 12 | Continue 13 | If FileExist(RegExReplace(A_LoopField,"i)^#include\s%A_ScriptDir%\\")) 14 | { 15 | Match := "\t" ToMatch(SubStr(A_LoopField,35)) "\t" 16 | If Not RegExMatch(ExtensionsNames,Match) 17 | NewExtensions .= A_LoopField "`r`n" 18 | ExtensionsNames .= A_Tab Substr(A_LoopField,35) A_Tab 19 | } 20 | } 21 | */ 22 | ; 清理无用#include 23 | Filedelete,%ExtensionsAHK% 24 | FileAppend,%NewExtensions%,%ExtensionsAHK% 25 | ; 查询是否有新插件加入 26 | Loop,%A_ScriptDir%\Plugins\*.*,2 27 | plugins .= "#include `%A_ScriptDir`%\plugins\" A_LoopFileName "\" A_LoopFileName ".ahk`n" 28 | FileAppend,%plugins%,%ExtensionsAHK% 29 | ; 保存修改时间 30 | SaveTime := "/*`r`n[ExtensionsTime]`r`n" 31 | Loop,%A_ScriptDir%\plugins\*.*,2 32 | { 33 | plugin := A_ScriptDir "\plugins\" A_LoopFileName "\" A_LoopFileName ".ahk" 34 | FileGetTime,ExtensionsTime,%plugin%,M 35 | SaveTime .= A_LoopFileName "=" ExtensionsTime "`r`n" 36 | } 37 | SaveTime .= "*/`r`n" 38 | FileAppend,%SaveTime%,%ExtensionsAHK% 39 | FileRead,Extensions,%ExtensionsAHK% 40 | Run %A_AHKPath% "%A_ScriptDir%\vimd.ahk" 41 | Exit 42 | Send_WM_COPYDATA(ByRef StringToSend, ByRef TargetScriptTitle="vimd.ahk ahk_class AutoHotkey") 43 | { 44 | VarSetCapacity(CopyDataStruct, 3*A_PtrSize, 0) 45 | SizeInBytes := (StrLen(StringToSend) + 1) * (A_IsUnicode ? 2 : 1) 46 | NumPut(SizeInBytes, CopyDataStruct, A_PtrSize) 47 | NumPut(&StringToSend, CopyDataStruct, 2*A_PtrSize) 48 | Prev_DetectHiddenWindows := A_DetectHiddenWindows 49 | Prev_TitleMatchMode := A_TitleMatchMode 50 | DetectHiddenWindows On 51 | SetTitleMatchMode 2 52 | SendMessage, 0x4a, 0, &CopyDataStruct,, %TargetScriptTitle% 53 | DetectHiddenWindows %Prev_DetectHiddenWindows% 54 | SetTitleMatchMode %Prev_TitleMatchMode% 55 | return ErrorLevel 56 | } 57 | 58 | 59 | ToMatch(str){ 60 | str := RegExReplace(str,"\+|\?|\.|\*|\{|\}|\(|\)|\||\^|\$|\[|\]|\\","\$0") 61 | Return RegExReplace(str,"\s","\s") 62 | } 63 | ; ToReplace(str) {{{2 64 | ; 65 | ToReplace(str){ 66 | If RegExMatch(str,"\$") 67 | return Regexreplace(str,"\$","$$$$") 68 | Else 69 | Return str 70 | } 71 | -------------------------------------------------------------------------------- /src/VimDesktop/lib/7za.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/victorwoo/vimdesktop/c88538ffe486bfbc6eb9e563826a5ac1ac7d58bf/src/VimDesktop/lib/7za.exe -------------------------------------------------------------------------------- /src/VimDesktop/lib/Acc.ahk: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ; Acc.ahk Standard Library 3 | ; by Sean 4 | ; Updated by jethrow: 5 | ; Modified ComObjEnwrap params from (9,pacc) --> (9,pacc,1) 6 | ; Changed ComObjUnwrap to ComObjValue in order to avoid AddRef (thanks fincs) 7 | ; Added Acc_GetRoleText & Acc_GetStateText 8 | ; Added additional functions - commented below 9 | ; Removed original Acc_Children function 10 | ; Added Acc_Error, Acc_ChildrenByRole, & Acc_Get functions 11 | ; last updated 10/25/2012 12 | ;------------------------------------------------------------------------------ 13 | 14 | Acc_Init() 15 | { 16 | Static h 17 | If Not h 18 | h:=DllCall("LoadLibrary","Str","oleacc","Ptr") 19 | } 20 | Acc_ObjectFromEvent(ByRef _idChild_, hWnd, idObject, idChild) 21 | { 22 | Acc_Init() 23 | If DllCall("oleacc\AccessibleObjectFromEvent", "Ptr", hWnd, "UInt", idObject, "UInt", idChild, "Ptr*", pacc, "Ptr", VarSetCapacity(varChild,8+2*A_PtrSize,0)*0+&varChild)=0 24 | Return ComObjEnwrap(9,pacc,1), _idChild_:=NumGet(varChild,8,"UInt") 25 | } 26 | 27 | Acc_ObjectFromPoint(ByRef _idChild_ = "", x = "", y = "") 28 | { 29 | Acc_Init() 30 | If DllCall("oleacc\AccessibleObjectFromPoint", "Int64", x==""||y==""?0*DllCall("GetCursorPos","Int64*",pt)+pt:x&0xFFFFFFFF|y<<32, "Ptr*", pacc, "Ptr", VarSetCapacity(varChild,8+2*A_PtrSize,0)*0+&varChild)=0 31 | Return ComObjEnwrap(9,pacc,1), _idChild_:=NumGet(varChild,8,"UInt") 32 | } 33 | 34 | Acc_ObjectFromWindow(hWnd, idObject = 0) 35 | { 36 | Acc_Init() 37 | If DllCall("oleacc\AccessibleObjectFromWindow", "Ptr", hWnd, "UInt", idObject&=0xFFFFFFFF, "Ptr", -VarSetCapacity(IID,16)+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x719B3800AA000C81,NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,"Int64"),"Int64"), "Ptr*", pacc)=0 38 | Return ComObjEnwrap(9,pacc,1) 39 | } 40 | 41 | Acc_WindowFromObject(pacc) 42 | { 43 | If DllCall("oleacc\WindowFromAccessibleObject", "Ptr", IsObject(pacc)?ComObjValue(pacc):pacc, "Ptr*", hWnd)=0 44 | Return hWnd 45 | } 46 | 47 | Acc_GetRoleText(nRole) 48 | { 49 | nSize := DllCall("oleacc\GetRoleText", "Uint", nRole, "Ptr", 0, "Uint", 0) 50 | VarSetCapacity(sRole, (A_IsUnicode?2:1)*nSize) 51 | DllCall("oleacc\GetRoleText", "Uint", nRole, "str", sRole, "Uint", nSize+1) 52 | Return sRole 53 | } 54 | 55 | Acc_GetStateText(nState) 56 | { 57 | nSize := DllCall("oleacc\GetStateText", "Uint", nState, "Ptr", 0, "Uint", 0) 58 | VarSetCapacity(sState, (A_IsUnicode?2:1)*nSize) 59 | DllCall("oleacc\GetStateText", "Uint", nState, "str", sState, "Uint", nSize+1) 60 | Return sState 61 | } 62 | 63 | Acc_SetWinEventHook(eventMin, eventMax, pCallback) 64 | { 65 | Return DllCall("SetWinEventHook", "Uint", eventMin, "Uint", eventMax, "Uint", 0, "Ptr", pCallback, "Uint", 0, "Uint", 0, "Uint", 0) 66 | } 67 | 68 | Acc_UnhookWinEvent(hHook) 69 | { 70 | Return DllCall("UnhookWinEvent", "Ptr", hHook) 71 | } 72 | /* Win Events: 73 | 74 | pCallback := RegisterCallback("WinEventProc") 75 | WinEventProc(hHook, event, hWnd, idObject, idChild, eventThread, eventTime) 76 | { 77 | Critical 78 | Acc := Acc_ObjectFromEvent(_idChild_, hWnd, idObject, idChild) 79 | ; Code Here: 80 | 81 | } 82 | */ 83 | 84 | ; Written by jethrow 85 | Acc_Role(Acc, ChildId=0) { 86 | try return ComObjType(Acc,"Name")="IAccessible"?Acc_GetRoleText(Acc.accRole(ChildId)):"invalid object" 87 | } 88 | Acc_State(Acc, ChildId=0) { 89 | try return ComObjType(Acc,"Name")="IAccessible"?Acc_GetStateText(Acc.accState(ChildId)):"invalid object" 90 | } 91 | Acc_Location(Acc, ChildId=0, byref Position="") { ; adapted from Sean's code 92 | try Acc.accLocation(ComObj(0x4003,&x:=0), ComObj(0x4003,&y:=0), ComObj(0x4003,&w:=0), ComObj(0x4003,&h:=0), ChildId) 93 | catch 94 | return 95 | Position := "x" NumGet(x,0,"int") " y" NumGet(y,0,"int") " w" NumGet(w,0,"int") " h" NumGet(h,0,"int") 96 | return {x:NumGet(x,0,"int"), y:NumGet(y,0,"int"), w:NumGet(w,0,"int"), h:NumGet(h,0,"int")} 97 | } 98 | Acc_Parent(Acc) { 99 | try parent:=Acc.accParent 100 | return parent?Acc_Query(parent): 101 | } 102 | Acc_Child(Acc, ChildId=0) { 103 | try child:=Acc.accChild(ChildId) 104 | return child?Acc_Query(child): 105 | } 106 | Acc_Query(Acc) { ; thanks Lexikos - www.autohotkey.com/forum/viewtopic.php?t=81731&p=509530#509530 107 | try return ComObj(9, ComObjQuery(Acc,"{618736e0-3c3d-11cf-810c-00aa00389b71}"), 1) 108 | } 109 | Acc_Error(p="") { 110 | static setting:=0 111 | return p=""?setting:setting:=p 112 | } 113 | Acc_Children(Acc) { 114 | if ComObjType(Acc,"Name") != "IAccessible" 115 | ErrorLevel := "Invalid IAccessible Object" 116 | else { 117 | Acc_Init(), cChildren:=Acc.accChildCount, Children:=[] 118 | if DllCall("oleacc\AccessibleChildren", "Ptr",ComObjValue(Acc), "Int",0, "Int",cChildren, "Ptr",VarSetCapacity(varChildren,cChildren*(8+2*A_PtrSize),0)*0+&varChildren, "Int*",cChildren)=0 { 119 | Loop %cChildren% 120 | i:=(A_Index-1)*(A_PtrSize*2+8)+8, child:=NumGet(varChildren,i), Children.Insert(NumGet(varChildren,i-8)=9?Acc_Query(child):child), NumGet(varChildren,i-8)=9?ObjRelease(child): 121 | return Children.MaxIndex()?Children: 122 | } else 123 | ErrorLevel := "AccessibleChildren DllCall Failed" 124 | } 125 | if Acc_Error() 126 | throw Exception(ErrorLevel,-1) 127 | } 128 | Acc_ChildrenByRole(Acc, Role) { 129 | if ComObjType(Acc,"Name")!="IAccessible" 130 | ErrorLevel := "Invalid IAccessible Object" 131 | else { 132 | Acc_Init(), cChildren:=Acc.accChildCount, Children:=[] 133 | if DllCall("oleacc\AccessibleChildren", "Ptr",ComObjValue(Acc), "Int",0, "Int",cChildren, "Ptr",VarSetCapacity(varChildren,cChildren*(8+2*A_PtrSize),0)*0+&varChildren, "Int*",cChildren)=0 { 134 | Loop %cChildren% { 135 | i:=(A_Index-1)*(A_PtrSize*2+8)+8, child:=NumGet(varChildren,i) 136 | if NumGet(varChildren,i-8)=9 137 | AccChild:=Acc_Query(child), ObjRelease(child), Acc_Role(AccChild)=Role?Children.Insert(AccChild): 138 | else 139 | Acc_Role(Acc, child)=Role?Children.Insert(child): 140 | } 141 | return Children.MaxIndex()?Children:, ErrorLevel:=0 142 | } else 143 | ErrorLevel := "AccessibleChildren DllCall Failed" 144 | } 145 | if Acc_Error() 146 | throw Exception(ErrorLevel,-1) 147 | } 148 | Acc_Get(Cmd, ChildPath="", ChildID=0, WinTitle="", WinText="", ExcludeTitle="", ExcludeText="") { 149 | static properties := {Action:"DefaultAction", DoAction:"DoDefaultAction", Keyboard:"KeyboardShortcut"} 150 | AccObj := IsObject(WinTitle)? WinTitle 151 | : Acc_ObjectFromWindow( WinExist(WinTitle, WinText, ExcludeTitle, ExcludeText), 0 ) 152 | if ComObjType(AccObj, "Name") != "IAccessible" 153 | ErrorLevel := "Could not access an IAccessible Object" 154 | else { 155 | StringReplace, ChildPath, ChildPath, _, %A_Space%, All 156 | AccError:=Acc_Error(), Acc_Error(true) 157 | Loop Parse, ChildPath, ., %A_Space% 158 | try { 159 | if A_LoopField is digit 160 | Children:=Acc_Children(AccObj), m2:=A_LoopField ; mimic "m2" output in else-statement 161 | else 162 | RegExMatch(A_LoopField, "(\D*)(\d*)", m), Children:=Acc_ChildrenByRole(AccObj, m1), m2:=(m2?m2:1) 163 | if Not Children.HasKey(m2) 164 | throw 165 | AccObj := Children[m2] 166 | } catch { 167 | ErrorLevel:="Cannot access ChildPath Item #" A_Index " -> " A_LoopField, Acc_Error(AccError) 168 | if Acc_Error() 169 | throw Exception("Cannot access ChildPath Item", -1, "Item #" A_Index " -> " A_LoopField) 170 | return 171 | } 172 | Acc_Error(AccError) 173 | StringReplace, Cmd, Cmd, %A_Space%, , All 174 | properties.HasKey(Cmd)? Cmd:=properties[Cmd]: 175 | try { 176 | if (Cmd = "Location") 177 | AccObj.accLocation(ComObj(0x4003,&x:=0), ComObj(0x4003,&y:=0), ComObj(0x4003,&w:=0), ComObj(0x4003,&h:=0), ChildId) 178 | , ret_val := "x" NumGet(x,0,"int") " y" NumGet(y,0,"int") " w" NumGet(w,0,"int") " h" NumGet(h,0,"int") 179 | else if (Cmd = "Object") 180 | ret_val := AccObj 181 | else if Cmd in Role,State 182 | ret_val := Acc_%Cmd%(AccObj, ChildID+0) 183 | else if Cmd in ChildCount,Selection,Focus 184 | ret_val := AccObj["acc" Cmd] 185 | else 186 | ret_val := AccObj["acc" Cmd](ChildID+0) 187 | } catch { 188 | ErrorLevel := """" Cmd """ Cmd Not Implemented" 189 | if Acc_Error() 190 | throw Exception("Cmd Not Implemented", -1, Cmd) 191 | return 192 | } 193 | return ret_val, ErrorLevel:=0 194 | } 195 | if Acc_Error() 196 | throw Exception(ErrorLevel,-1) 197 | } -------------------------------------------------------------------------------- /src/VimDesktop/lib/anchor.ahk: -------------------------------------------------------------------------------- 1 | /* 2 | Function: Anchor 3 | Defines how controls should be automatically positioned relative to the new dimensions of a window when resized. 4 | 5 | Parameters: 6 | cl - a control HWND, associated variable name or ClassNN to operate on 7 | a - (optional) one or more of the anchors: 'x', 'y', 'w' (width) and 'h' (height), 8 | optionally followed by a relative factor, e.g. "x h0.5" 9 | r - (optional) true to redraw controls, recommended for GroupBox and Button types 10 | 11 | Examples: 12 | > "xy" ; bounds a control to the bottom-left edge of the window 13 | > "w0.5" ; any change in the width of the window will resize the width of the control on a 2:1 ratio 14 | > "h" ; similar to above but directrly proportional to height 15 | 16 | Remarks: 17 | To assume the current window size for the new bounds of a control (i.e. resetting) simply omit the second and third parameters. 18 | However if the control had been created with DllCall() and has its own parent window, 19 | the container AutoHotkey created GUI must be made default with the +LastFound option prior to the call. 20 | For a complete example see anchor-example.ahk. 21 | 22 | License: 23 | - Version 4.60a 24 | - Dedicated to the public domain (CC0 1.0) 25 | */ 26 | Anchor(i, a = "", r = false) { 27 | static c, cs = 12, cx = 255, cl = 0, g, gs = 8, gl = 0, gpi, gw, gh, z = 0, k = 0xffff 28 | If z = 0 29 | VarSetCapacity(g, gs * 99, 0), VarSetCapacity(c, cs * cx, 0), z := true 30 | If (!WinExist("ahk_id" . i)) { 31 | GuiControlGet, t, Hwnd, %i% 32 | If ErrorLevel = 0 33 | i := t 34 | Else ControlGet, i, Hwnd, , %i% 35 | } 36 | VarSetCapacity(gi, 68, 0), DllCall("GetWindowInfo", "UInt", gp := DllCall("GetParent", "UInt", i), "UInt", &gi) 37 | , giw := NumGet(gi, 28, "Int") - NumGet(gi, 20, "Int"), gih := NumGet(gi, 32, "Int") - NumGet(gi, 24, "Int") 38 | If (gp != gpi) { 39 | gpi := gp 40 | Loop, %gl% 41 | If (NumGet(g, cb := gs * (A_Index - 1)) == gp) { 42 | gw := NumGet(g, cb + 4, "Short"), gh := NumGet(g, cb + 6, "Short"), gf := 1 43 | Break 44 | } 45 | If (!gf) 46 | NumPut(gp, g, gl), NumPut(gw := giw, g, gl + 4, "Short"), NumPut(gh := gih, g, gl + 6, "Short"), gl += gs 47 | } 48 | ControlGetPos, dx, dy, dw, dh, , ahk_id %i% 49 | Loop, %cl% 50 | If (NumGet(c, cb := cs * (A_Index - 1)) == i) { 51 | If a = 52 | { 53 | cf = 1 54 | Break 55 | } 56 | giw -= gw, gih -= gh, as := 1, dx := NumGet(c, cb + 4, "Short"), dy := NumGet(c, cb + 6, "Short") 57 | , cw := dw, dw := NumGet(c, cb + 8, "Short"), ch := dh, dh := NumGet(c, cb + 10, "Short") 58 | Loop, Parse, a, xywh 59 | If A_Index > 1 60 | av := SubStr(a, as, 1), as += 1 + StrLen(A_LoopField) 61 | , d%av% += (InStr("yh", av) ? gih : giw) * (A_LoopField + 0 ? A_LoopField : 1) 62 | DllCall("SetWindowPos", "UInt", i, "Int", 0, "Int", dx, "Int", dy 63 | , "Int", InStr(a, "w") ? dw : cw, "Int", InStr(a, "h") ? dh : ch, "Int", 4) 64 | If r != 0 65 | DllCall("RedrawWindow", "UInt", i, "UInt", 0, "UInt", 0, "UInt", 0x0101) ; RDW_UPDATENOW | RDW_INVALIDATE 66 | Return 67 | } 68 | If cf != 1 69 | cb := cl, cl += cs 70 | bx := NumGet(gi, 48), by := NumGet(gi, 16, "Int") - NumGet(gi, 8, "Int") - gih - NumGet(gi, 52) 71 | If cf = 1 72 | dw -= giw - gw, dh -= gih - gh 73 | NumPut(i, c, cb), NumPut(dx - bx, c, cb + 4, "Short"), NumPut(dy - by, c, cb + 6, "Short") 74 | , NumPut(dw, c, cb + 8, "Short"), NumPut(dh, c, cb + 10, "Short") 75 | Return, true 76 | } 77 | -------------------------------------------------------------------------------- /src/VimDesktop/lib/ini.ahk: -------------------------------------------------------------------------------- 1 |  2 | ; class INI {{{1 3 | ; Create By Linxinhong 4 | class INI { 5 | ; __new(p) {{{2 6 | __new(p) { 7 | this.filepath := p 8 | this.timestamp := "" 9 | this.CheckTime() 10 | } 11 | ; Read() {{{2 12 | Read(i="") { 13 | this.env := [] 14 | this.content := [] 15 | If not strlen(i) 16 | { 17 | p := this.filepath 18 | FileRead,i,%p% 19 | } 20 | Loop,Parse,i,`n,`r 21 | { 22 | this.content[0] := A_Index 23 | this.content[A_Index] := A_LoopField 24 | LoopString := Trim(A_LoopField) 25 | ;If not Strlen(LoopString) ;空白行 26 | ; continue 27 | If InStr(SubStr(LoopString,1,1),"[") And InStr(SubStr(LoopString,Strlen(LoopString)),"]") { 28 | sec := SubStr(LoopString,2,Strlen(LoopString)-2) 29 | this.content["`nsections"] .= sec "`n" 30 | this.content[sec "`nnumber"] := 0 31 | continue 32 | } 33 | this.content[sec "`nall"] .= A_LoopField "`n" 34 | If InStr(SubStr(LoopString,1,1),";") { 35 | this.content[sec "`ncomment"] .= LoopString "`n" 36 | continue 37 | } 38 | If InStr(LoopString,"=") 39 | { 40 | k := Trim(SubStr(LoopString,1,InStr(LoopString , "=" ) -1 )) 41 | v := Trim(SubStr(LoopString,InStr(LoopString, "=") + 1)) 42 | } 43 | Else 44 | k := LoopString 45 | If Strlen(k) 46 | this.content[sec "`nkeys"] .= k "`n" 47 | this.content[sec "`nkeyValue"] .= LoopString "`n" 48 | this.content[sec "`n" k] := v 49 | idx := this.content[sec "`nnumber"] + 1 50 | this.content[sec "`nnumber"] := idx 51 | ;this.content[sec "`nnumber" idx] := k "=" v 52 | this.content[sec "`nnumber" idx] := A_LoopField 53 | If sec = Env 54 | { 55 | e := [] 56 | e.vaild := True 57 | e.var := v 58 | this.Env[k] := e 59 | If RegExMatch(this.filepath,"i)\\menuz\.ini$") 60 | GlobalSetEnvs(k,e) 61 | } 62 | } 63 | cnt := this.content[0] 64 | this.content[0] := cnt - 1 65 | this.content[cnt] := "" 66 | } 67 | ; Write() {{{2 68 | Write() { 69 | p := this.filepath 70 | cnt := this.content[0] 71 | Loop %cnt% 72 | rs .= this.content[A_Index] "`n" 73 | ;rs := RTrim(rs,"`r`n") 74 | FileDelete,%p% 75 | FileAppend,%rs%,%p% 76 | FileGetTime,t,%p% 77 | this.timestamp := t 78 | return rs 79 | } 80 | ; CheckTime() {{{2 81 | CheckTime() { 82 | p := this.filepath 83 | FileGetTime,t,%p% 84 | If this.timestamp <> t { 85 | this.timestamp := t 86 | this.Read() 87 | } 88 | else 89 | return this.timestamp 90 | } 91 | 92 | ; Adjust(src,dst="",mothed="md") {{{2 93 | Adjust(src,dst="",mothed="m") { 94 | this.CheckTime() 95 | sl := this.GetSections() 96 | If InStr(mothed,"m") or InStr(mothed,"c"){ 97 | If src.number 98 | { 99 | temp := this.content[src.section "`nnumber" src.number] 100 | space := "`n" 101 | } 102 | else 103 | temp := this.content[src.section "`nall"] 104 | If InStr(mothed,"m") 105 | If src.number 106 | this.content[src.section "`nall"] := this.Adjust_delete(this.content[src.section "`nall"],temp) 107 | else 108 | this.content[src.section "`nall"] := "" 109 | If InStr(mothed,"u") 110 | If dst.number 111 | this.content[dst.section "`nall"] := this.Adjust_insert_up(this.content[dst.section "`nall"],this.content[dst.section "`nnumber" dst.number],temp) 112 | Else 113 | this.content[dst.section "`nall"] := temp space this.content[dst.section "`nall"] 114 | else 115 | If dst.number 116 | this.content[dst.section "`nall"] := this.Adjust_insert_down(this.content[dst.section "`nall"],this.content[dst.section "`nnumber" dst.number],temp) 117 | Else 118 | this.content[dst.section "`nall"] := this.content[dst.section "`nall"] temp 119 | } 120 | If InStr(mothed,"t"){ 121 | If RegExMatch(dst.section,"i)^" this._ToMatch(src.section) "$"){ 122 | all := this.content[src.section "`nall"] 123 | m1 := this._ToMatch(this.content[src.section "`nnumber" src.number]) 124 | m2 := this._ToMatch(this.content[src.section "`nnumber" dst.number]) 125 | Loop,Parse,all,`n 126 | { 127 | If RegExMatch(A_LoopField,m1) and src.number{ 128 | idx1 := A_Index 129 | temp1 := A_LoopField 130 | continue 131 | } 132 | If RegExMatch(A_LoopField,m2) and dst.number{ 133 | idx2 := A_Index 134 | temp2 := A_LoopField 135 | continue 136 | } 137 | If idx1 and idx2 138 | break 139 | } 140 | If not src.number 141 | temp1 := this.content[src.section "`nall"] 142 | If not dst.number 143 | temp2 := this.content[src.section "`nall"] 144 | Loop,Parse,all,`n 145 | { 146 | If A_Index = %idx1% 147 | ns .= temp2 "`n" 148 | Else If A_Index = %idx2% 149 | ns .= temp1 "`n" 150 | Else 151 | ns .= A_LoopField "`n" 152 | } 153 | this.content[src.section "`nall"] := ns 154 | } 155 | Else { 156 | If src.number 157 | temp_s := this.content[src.section "`nnumber" src.number] 158 | Else 159 | temp_s := this.content[src.section "`nall"] 160 | If dst.number 161 | temp_d := this.content[dst.section "`nnumber" dst.number] 162 | Else 163 | temp_d := this.content[dst.section "`nall"] 164 | ;temp_s := RegExReplace(temp_s,"\n$") 165 | ;temp_d := RegExReplace(temp_d,"\n$") 166 | If src.number 167 | this.content[src.section "`nall"] := this.Adjust_trans(this.content[src.section "`nall"],this.content[src.section "`nnumber" src.number],temp_d) 168 | Else 169 | this.content[src.section "`nall"] := temp_d 170 | If dst.number 171 | this.content[dst.section "`nall"] := this.Adjust_trans(this.content[dst.section "`nall"],this.content[dst.section "`nnumber" dst.number],temp_s) 172 | Else 173 | this.content[dst.section "`nall"] := temp_s 174 | ;msgbox % this.content[src.section "`nall"] "`n" this.content[dst.section "`nall"] 175 | } 176 | } 177 | rs := this.content["`nall"] 178 | Loop,Parse,sl,`n 179 | { 180 | If not strlen(A_LoopField) 181 | continue 182 | rs .= "[" A_LoopField "]`n" 183 | If RegExMatch(this.content[A_LoopField "`nall"],"\n$") 184 | rs .= this.content[A_LoopField "`nall"] 185 | Else 186 | rs .= this.content[A_LoopField "`nall"] "`n" 187 | } 188 | this.Read(rs) 189 | this.Write() 190 | } 191 | Adjust_trans(s,k,t) { 192 | If not strlen(k) 193 | return 194 | m := this._ToMatch(k) 195 | Loop,Parse,s,`n 196 | { 197 | If RegExMatch(A_LoopField,m) 198 | rs .= t "`n" 199 | else 200 | rs .= A_LoopField "`n" 201 | } 202 | return substr(rs,1,strlen(rs)-1) 203 | } 204 | Adjust_delete(s,k) { 205 | If not strlen(k) 206 | return 207 | m := this._ToMatch(k) 208 | Loop,Parse,s,`n 209 | { 210 | If RegExMatch(A_LoopField,m) 211 | continue 212 | rs .= A_LoopField "`n" 213 | } 214 | return substr(rs,1,strlen(rs)-1) 215 | } 216 | Adjust_insert_up(s,k,i) { 217 | If not strlen(k) 218 | return 219 | m := this._ToMatch(k) 220 | Loop,Parse,s,`n 221 | { 222 | If RegExMatch(A_LoopField,m) 223 | rs .= i "`n" 224 | rs .= A_LoopField "`n" 225 | } 226 | return substr(rs,1,strlen(rs)-1) 227 | } 228 | Adjust_insert_down(s,k,i) { 229 | If not strlen(k) 230 | return 231 | m := this._ToMatch(k) 232 | found := 0 233 | Loop,Parse,s,`n 234 | { 235 | If found = 1 236 | { 237 | rs .= i "`n" 238 | found := 2 239 | } 240 | If RegExMatch(A_LoopField,m) And (found = 0) 241 | found := 1 242 | rs .= A_LoopField "`n" 243 | } 244 | return substr(rs,1,strlen(rs)-1) 245 | } 246 | ; Insert(section,Number,string,d=1) {{{2 247 | Insert(section,Number,string,d=1) { 248 | this.CheckTime() 249 | sl := this.GetSections() 250 | If d 251 | this.content[section "`nall"] := this.Adjust_insert_down(this.content[section "`nall"],this.content[section "`nnumber" Number],string) 252 | Else 253 | this.content[section "`nall"] := this.Adjust_insert_up(this.content[section "`nall"],this.content[section "`nnumber" Number],string) 254 | rs := this.content["`nall"] 255 | Loop,Parse,sl,`n 256 | { 257 | If not strlen(A_LoopField) 258 | continue 259 | rs .= "[" A_LoopField "]`n" 260 | If RegExMatch(this.content[A_LoopField "`nall"],"\n$") 261 | rs .= this.content[A_LoopField "`nall"] 262 | Else 263 | rs .= this.content[A_LoopField "`nall"] "`n" 264 | } 265 | this.Read(rs) 266 | this.Write() 267 | } 268 | iniwrite(section,key,string){ 269 | p := this.filePath 270 | iniwrite,%string%,%p%,%section%,%key% 271 | } 272 | iniread(section,key,default=""){ 273 | p := this.filePath 274 | iniread,v,%p%,%section%,%key%,%default% 275 | return v 276 | } 277 | 278 | ; GetINI() {{{2 279 | GetINI() { 280 | this.CheckTime() 281 | cnt := this.content[0] 282 | Loop %cnt% 283 | rs .= this.content[A_Index] "`n" 284 | return rs 285 | } 286 | ; GetSections() {{{2 287 | GetSections() { 288 | this.CheckTime() 289 | return this.content["`nsections"] 290 | } 291 | ; GetSectionsF(fuzzy) {{{2 292 | GetSectionsF(fuzzy) { 293 | this.CheckTime() 294 | r := "" 295 | l := this.GetSections() 296 | Loop,Parse,l,`n 297 | { 298 | If InStr(A_LoopField,"|") { 299 | s := A_LoopField 300 | Loop , Parse , s, | 301 | { 302 | If A_LoopField = %fuzzy% 303 | { 304 | r .= s "`n" 305 | Break 306 | } 307 | } 308 | } 309 | Else If A_LoopField = %fuzzy% 310 | r .= A_LoopField "`n" 311 | } 312 | Return RTrim(r,"`n") 313 | } 314 | ; GetSectionsR(regex) {{{2 315 | GetSectionsR(regex) { 316 | this.CheckTime() 317 | r := "" 318 | l := this.GetSections() 319 | Loop,Parse,l,`n 320 | { 321 | If RegExMatch(A_LoopField,regex) 322 | r .= A_LoopField "`n" 323 | } 324 | return RTrim(r,"`n") 325 | } 326 | ; GetKeys(section) {{{2 327 | GetKeys(section) { 328 | this.CheckTime() 329 | return this.content[section "`nkeys"] 330 | } 331 | ; GetValue(section,Key) {{{2 332 | GetValue(section,Key) { 333 | this.CheckTime() 334 | return this.content[section "`n" key] 335 | } 336 | ; GetKeyValue(section) {{{2 337 | GetKeyValue(section) { 338 | this.CheckTime() 339 | return this.content[section "`nkeyValue"] 340 | } 341 | ; GetValueN(section,idx) {{{2 342 | GetValueN(section,idx) { 343 | LoopString := this.GetKeyValueN(section,idx) 344 | return Trim(SubStr(LoopString,InStr(LoopString, "=") + 1)) 345 | } 346 | ; GetKeyValueN(section,idx) {{{2 347 | GetKeyValueN(section,idx) { 348 | this.CheckTime() 349 | return this.content[section "`nnumber" idx] 350 | } 351 | ; GetComment() {{{2 352 | GetComment(sec) { 353 | this.CheckTime() 354 | return this.content[sec "`ncomment"] 355 | } 356 | ; GetKeycomment(sec) {{{2 357 | GetKeycomment(sec) { 358 | this.CheckTime() 359 | return this.content[sec "`nall"] 360 | } 361 | ; ReplaceEnv(string) {{{2 362 | ReplaceEnv(string) { 363 | Global globalenv 364 | this.CheckTime() 365 | p1 := 1 366 | Loop { 367 | p2 := RegExMatch(string,"%[^%]*%",m,p1) 368 | If Not p2 { 369 | If P1 > 1 370 | r .= over 371 | Else 372 | r := string 373 | Break 374 | } 375 | Else If Strlen(m) { 376 | env := SubStr(m,2,strlen(m)-2) 377 | e := This.Env[env] 378 | g := GlobalGetEnvs(env) 379 | If not ErrorLevel 380 | Rstring := g 381 | Else If e.Vaild 382 | Rstring := e.Var 383 | Else If RegExMatch(env,"i)(^apps$)|(^Script$)|(^config$)|(^Extensions$)|(^icons$)",MZVar) 384 | RString := A_ScriptDir "\" MZVar 385 | Else If RegExMatch(env,"i)(^A_WorkingDir$)|(^A_ScriptDir$)|(^A_ScriptName$)|(^A_ScriptFullPath$)|(^A_ScriptHwnd$)|(^A_LineNumber$)|(^A_LineFile$)|(^A_ThisFunc$)|(^A_ThisLabel$)|(^A_AhkVersion$)|(^A_AhkPath$)|(^A_IsUnicode$)|(^A_IsCompiled$)|(^A_ExitReason$)|(^A_YYYY$)|(^A_MM$)|(^A_DD$)|(^A_MMMM$)|(^A_MMM$)|(^A_DDDD$)|(^A_DDD$)|(^A_WDay$)|(^A_YDay$)|(^A_YWeek$)|(^A_Hour$)|(^A_Min$)|(^A_Sec$)|(^A_MSec$)|(^A_Now$)|(^A_NowUTC$)|(^A_TickCount$)|(^A_IsSuspended$)|(^A_IsPaused$)|(^A_IsCritical$)|(^A_BatchLines$)|(^A_TitleMatchMode$)|(^A_TitleMatchModeSpeed$)|(^A_DetectHiddenWindows$)|(^A_DetectHiddenText$)|(^A_AutoTrim$)|(^A_StringCaseSense$)|(^A_FileEncoding$)|(^A_FormatInteger$)|(^A_FormatFloat$)|(^A_KeyDelay$)|(^A_WinDelay$)|(^A_ControlDelay$)|(^A_MouseDelay$)|(^A_DefaultMouseSpeed$)|(^A_RegView$)|(^A_IconHidden$)|(^A_IconTip$)|(^A_IconFile$)|(^A_IconNumber$)|(^A_TimeIdle$)|(^A_TimeIdlePhysical$)|(^A_Gui$)|(^A_GuiControl$)|(^A_GuiWidth$)|(^A_GuiHeight$)|(^A_GuiX$)|(^A_GuiY$)|(^A_GuiEvent$)|(^A_EventInfo$)|(^A_ThisHotkey$)|(^A_PriorHotkey$)|(^A_PriorKey$)|(^A_TimeSinceThisHotkey$)|(^A_TimeSincePriorHotkey$)|(^A_Temp$)|(^A_OSType$)|(^A_OSVersion$)|(^A_Is64bitOS$)|(^A_PtrSize$)|(^A_Language$)|(^A_ComputerName$)|(^A_UserName$)|(^A_WinDir$)|(^A_ProgramFiles$)|(^A_AppData$)|(^A_AppDataCommon$)|(^A_Desktop$)|(^A_DesktopCommon$)|(^A_StartMenu$)|(^A_StartMenuCommon$)|(^A_Programs$)|(^A_ProgramsCommon$)|(^A_Startup$)|(^A_StartupCommon$)|(^A_MyDocuments$)|(^A_IsAdmin$)|(^A_ScreenWidth$)|(^A_ScreenHeight$)|(^A_IPAddress1$)|(^A_IPAddress2$)|(^A_IPAddress3$)|(^A_IPAddress4$)|(^A_Cursor$)|(^A_CaretX$)|(^A_CaretY$)",ahkVar) 386 | RString := %ahkVar% 387 | Else If RegExMatch(env,"i)(^ALLUSERSPROFILE$)|(^APPDATA$)|(^CommonProgramFiles$)|(^COMPUTERNAME$)|(^ComSpec$)|(^FP_NO_HOST_CHECK$)|(^HOMEDRIVE$)|(^HOMEPATH$)|(^LOCALAPPDATA$)|(^LOGONSERVER$)|(^NUMBER_OF_PROCESSORS$)|(^OS$)|(^Path$)|(^PROCESSOR_ARCHITECTURE$)|(^PROCESSOR_IDENTIFIER$)|(^PROCESSOR_LEVEL$)|(^PROCESSOR_REVISION$)|(^ProgramData$)|(^ProgramFiles$)|(^PROMPT$)|(^PSModulePath$)|(^SESSIONNAME$)|(^SystemDrive$)|(^SystemRoot$)|(^TEMP$)|(^TMP$)|(^USERDOMAIN$)|(^USERNAME$)|(^USERPROFILE$)|(^windir$)",sysVar) 388 | { 389 | EnvGet,getsysVar,%sysVar% 390 | ;msgbox % sysvar "`n" getsysVar 391 | RString := getsysVar 392 | } 393 | Else 394 | RString := m 395 | } 396 | inter := SubStr(string,p1,p2-p1) 397 | p1 := p2 + Strlen(m) 398 | over := SubStr(string,p1) 399 | r .= inter RString 400 | } 401 | Return r 402 | } 403 | ; GetEnvs(e) {{{2 404 | GetEnvs(e) { 405 | this.CheckTime() 406 | Return GlobalGetEnvs(e) 407 | } 408 | ; SetEnvs(e,v) {{{2 409 | SetEnvs(e,v) { 410 | this.CheckTime() 411 | return GlobalSetEnvs(e,v) 412 | } 413 | ; Set(s,k="",v="") {{{2 414 | Set(s,k="",v="") { 415 | cnt := this.content[0] 416 | If not this.GetSectionsR("i)^" this._ToMatch(s) "$") { 417 | this.content[0] := cnt + 1 418 | this.content[cnt+1] := "[" s "]" 419 | this.content["`nsections"] .= sec "`n" 420 | this.content[sec "`nnumber"] := 0 421 | } 422 | If strlen(k) { 423 | cnt := this.content[0] 424 | this.content[0] := cnt + 1 425 | this.content[cnt+1] := k "=" v "`n" 426 | 427 | this.content[s "`nkeys"] .= k "`n" 428 | this.content[s "`nkeyValue"] .= k "=" v "`n" 429 | this.content[s "`n" k] := v 430 | idx := this.content[s "`nnumber"] + 1 431 | this.content[s "`nnumber"] := idx 432 | this.content[s "`nnumber" idx] := k "=" v 433 | } 434 | } 435 | _ToMatch(str){ 436 | str := RegExReplace(str,"\+|\?|\.|\*|\{|\}|\(|\)|\||\^|\$|\[|\]|\\","\$0") 437 | Return RegExReplace(str,"\s","\s") 438 | } 439 | } 440 | 441 | ; GetINIObj(p) {{{1 442 | GetINIObj(i){ 443 | global SaveINIObj 444 | p := ConvertPath(i) 445 | If not IsObject(SaveINIObj) 446 | SaveINIObj := [] 447 | If Not FileExist(p) 448 | return 449 | r := SaveINIObj[p] 450 | If not strlen(r.filePath) { 451 | r := new INI(p) 452 | SaveINIObj[p] := r 453 | } 454 | return r 455 | } 456 | 457 | ; ConvertPath(p,type="l") {{{1 458 | ConvertPath(p,type="l") { 459 | Loop,%p%,1 460 | lp := A_LoopFileLongPath 461 | Loop,%lp%,1 462 | { 463 | If type = r 464 | Return SubStr(lp,Strlen(A_Loopfiledir)+2) 465 | If type = l 466 | Return A_LoopFileLongPath 467 | If type = s 468 | Return A_LoopFileShortPath 469 | } 470 | } 471 | 472 | ; GlobalGetEnvs(e) {{{1 473 | GlobalGetEnvs(e){ 474 | global globalenv 475 | v := globalenv[e] 476 | If v.Vaild 477 | { 478 | ErrorLevel := False 479 | return v.var 480 | } 481 | Else 482 | { 483 | ErrorLevel := True 484 | return e 485 | } 486 | } 487 | ; GlobalSetEnvs(e,v) {{{1 488 | GlobalSetEnvs(e,v){ 489 | global globalenv 490 | If not IsObject(globalenv) 491 | globalenv := [] 492 | globalenv[e] := v 493 | } 494 | -------------------------------------------------------------------------------- /src/VimDesktop/lib/vimcore.ahk: -------------------------------------------------------------------------------- 1 | /* 2 | API 函数列表: 3 | vim.mode("模式","ahk_class") ; 设置运行的模式 4 | vim.map("热键","Label标签","ahk_class") ;映射热键 5 | vim.settimeout("按键超时时间","ahk_class") ;设置按键超时时间 6 | vim.listkey("ahk_class") ;显示所有映射的热键体 7 | vim.control("on/off","ahk_class") ;启用/禁用映射的热键 8 | vim.comment("标签","描述","是否允许多次运行(0/1)") 9 | 内置Label: 10 | 重复上一次动作 11 | */ 12 | #UseHook On 13 | Setkeydelay,-1 14 | return 15 | 16 | 17 | ; 此函数可以根据自己的喜好进行修改 18 | ShowComment(more="") { 19 | WinGetClass,win,A 20 | w := vim.Vaild(win) 21 | mode := w.GetMode() 22 | msg := mode.KeyTemp "`n=============================`n" 23 | ; GUIControl,,Edit1,%msg% 24 | 25 | If Strlen(more) 26 | { 27 | Loop,Parse,more,`n 28 | { 29 | key := Trim(A_LoopField) 30 | action := mode.KeyBody[key] 31 | ;comment := vim.CommentList[action] 32 | comment := GetCommentDest(action) 33 | If Strlen(comment) 34 | msg .= key " >> " comment "`n" 35 | Else 36 | msg .= key " >> " action "`n" 37 | 38 | } 39 | Tooltip % msg 40 | ;GUI,VIMINFO:Show 41 | } 42 | Else 43 | Tooltip 44 | ;GUI,VIMINFO:Show,Hide 45 | } 46 | 47 | 48 | 49 | ; ==================== 50 | ; ==================== 51 | ; 内部脚本,请匆修改! 52 | ; ==================== 53 | ; ==================== 54 | 55 | ; 初始化 vimcore 56 | Init() { 57 | OnMessage(0x05,"GuiSize") 58 | GoSub,vimnew 59 | } 60 | 61 | vimnew: 62 | Global vim := new vimcore 63 | return 64 | 65 | 66 | ; 以下为class封装,请匆修改 67 | Class vimcore { 68 | __New() { 69 | This.vimWindows := [] 70 | This.vimGlobal := new This.vimClass("") 71 | This.TimeOutClass := "" 72 | This.ExcludeList := [] 73 | ;This.ExcludeList["AutoHotkey"] := True 74 | This.CommentList := [] 75 | This.CommentType := [] 76 | This.UseHotkey := [] 77 | } 78 | 79 | Vaild(win) { 80 | if Strlen(win) = 0 81 | Return This.vimGlobal 82 | w := This.vimWindows[win] 83 | if w.winVaild 84 | return w 85 | Else 86 | return This.vimGlobal 87 | } 88 | 89 | mode(mode,win="") { 90 | if Strlen(win) = 0 91 | w := This.vimGlobal 92 | Else 93 | w := This.vimWindows[win] 94 | If not w.winVaild 95 | { 96 | w := new This.vimClass(win) 97 | This.vimWindows[win] := w 98 | } 99 | w.SetMode(mode) 100 | ShowComment() 101 | } 102 | 103 | sMap(key,label,win=""){ 104 | This.UseHotkey[key] := True 105 | this.Map(key,label,win) 106 | } 107 | Map(key,label,win="") { 108 | If not RegExMatch(Key,"[^\s]") 109 | return 110 | if Strlen(win) = 0 111 | w := This.vimGlobal 112 | Else 113 | w := This.vimWindows[win] 114 | If not w.winVaild 115 | { 116 | w := new This.vimClass(win) 117 | This.vimWindows[win] := w 118 | } 119 | mode := w.GetMode() 120 | mode.SetHotkey(key,label) 121 | } 122 | 123 | Comment(action,desc,complex=1) { 124 | This.CommentList[action] := desc 125 | This.CommentType[action] := complex 126 | } 127 | 128 | do() { 129 | WinGetClass,win,A 130 | w := This.Vaild(win) 131 | m := w.GetMode() 132 | If This.ExcludeList[win] And not this.UseHotkey[m.GetThisHotkey()] 133 | { 134 | Send,% m.TransSendKey(A_ThisHotkey) 135 | return 136 | } 137 | If w.winVaild { 138 | mode := w.GetMode() 139 | If Mode.KeyList[A_ThisHotkey] 140 | mode.Try() 141 | Else 142 | { 143 | w := This.vimGlobal 144 | mode := w.GetMode() 145 | mode.Try() 146 | } 147 | } 148 | } 149 | 150 | Filter(String) { 151 | 152 | WinGetClass,win,A 153 | 154 | If This.ExcludeList[win] 155 | return 156 | w := This.Vaild(win) 157 | 158 | If w.winVaild { 159 | mode := w.GetMode() 160 | mode.query(string) 161 | } 162 | } 163 | 164 | Exclude(win) { 165 | This.ExcludeList[win] := True 166 | } 167 | 168 | Include(win) { 169 | This.ExcludeList[win] := False 170 | } 171 | 172 | 173 | ListKey(win="",mode="") { 174 | w := This.Vaild(win) 175 | If strlen(mode) { 176 | m := w.winmode[mode] 177 | For k , l in m.KeyBody 178 | msg .= k " " l "`n" 179 | return msg 180 | } 181 | Else { 182 | For n , m in w.winMode 183 | { 184 | msg .= "====`n" n "`n----`n" 185 | mode := m 186 | For k , l in m.KeyBody 187 | msg .= k " " l "`n" 188 | } 189 | return msg 190 | } 191 | } 192 | 193 | copy(win1,win2) { 194 | 195 | w2 := This.vimWindows[win2] 196 | 197 | If w2.winVaild 198 | return False 199 | 200 | w1 := This.Vaild(win1) 201 | w1.winName := win2 202 | For n , m in w1.WinMode 203 | { 204 | mode := m 205 | mode.win := win2 206 | w1.WinMode[n] := mode 207 | For k , l in m.KeyList 208 | { 209 | Hotkey,IfWinActive,ahk_class %win2% 210 | Hotkey,%k%, 211 | } 212 | } 213 | This.vimWindows[win2] := w1 214 | return True 215 | } 216 | 217 | Control(switch,win="") { 218 | w := This.Vaild(win) 219 | If switch = on 220 | { 221 | For n , m in w.winMode 222 | { 223 | mode := m 224 | For k , l in m.KeyList 225 | { 226 | Hotkey,%k%,on 227 | } 228 | } 229 | } 230 | If switch = off 231 | { 232 | For n , m in w.winMode 233 | { 234 | mode := m 235 | For k , l in m.KeyList 236 | { 237 | Hotkey,%k%,off 238 | } 239 | } 240 | } 241 | } 242 | 243 | test() { 244 | msgbox vim test 245 | } 246 | 247 | SetTimeOut(tick,win="") { 248 | w := This.Vaild(win) 249 | If not w.winVaild 250 | { 251 | w := new This.vimClass(win) 252 | This.vimWindows[win] := w 253 | } 254 | w.TimeOut := tick 255 | } 256 | 257 | TimeOut() { 258 | w := This.Vaild(This.TimeOutClass) 259 | mode := w.GetMode() 260 | mode.KeyTemp := "" 261 | ;GoSub,% mode.TimeOutAction 262 | mode.ExecSub(mode.TimeOutAction) 263 | ; ShowComment() 264 | mode.TimeOutAction := "" 265 | } 266 | 267 | Repeat() { 268 | WinGetClass,win,A 269 | w := This.vimWindows[win] 270 | If not w.winVaild 271 | w := This.vimGlobal 272 | If w.winVaild { 273 | mode := w.GetMode() 274 | mode.KeyCount := w.winRepeatCount 275 | mode.ExecSub(w.winRepeat,Ture) 276 | } 277 | } 278 | 279 | GetWin() { 280 | WinGetClass,win,A 281 | Return This.Vaild(win) 282 | } 283 | 284 | GetCount() { 285 | w := This.GetWin() 286 | m := w.GetMode() 287 | Return m.KeyCount ? m.KeyCount : 1 288 | } 289 | 290 | Class vimClass { 291 | 292 | __New(win) { 293 | This.winName := win 294 | This.winVaild := 1 295 | This.winControl := 0 296 | This.winTimeOut := 0 297 | THis.winMaxCount := 99 298 | This.winKeyList := [] 299 | This.winMode := [] 300 | This.winThisMode := "" 301 | This.winRepeat := "" 302 | This.winRepeatCount := 0 303 | } 304 | ;设置窗口类下的模式 305 | SetMode(md) { 306 | m := This.winMode[md] 307 | If Strlen(m.Mode) = 0 { 308 | This.winThisMode := md 309 | m := new This.Mode(md,This.winName) 310 | This.winMode[md] := m 311 | } 312 | Else 313 | This.winThisMode := md 314 | return m 315 | } 316 | ;获取窗口类下的模式 317 | 318 | GetMode() { 319 | m := This.winMode[This.winThisMode] 320 | return m 321 | } 322 | 323 | 324 | 325 | Class Mode { 326 | __New(mode,win) { 327 | This.Mode := mode 328 | This.win := win ;可变 329 | If Strlen(win) 330 | This.CheckMode := win "_CheckMode" 331 | Else 332 | This.CheckMode := "CheckMode" 333 | This.KeyTemp := "" 334 | This.KeyString := "" 335 | This.KeyCount := 0 336 | This.TimeOut := 0 337 | This.TimeOutTick := 0 338 | This.TimeOutAction := "" 339 | This.KeyBody := [] 340 | This.KeyList := [] 341 | This.KeyMap := [] 342 | } 343 | 344 | test() { 345 | msgbox % This.Mode 346 | } 347 | 348 | Try(){ 349 | checkMode := This.CheckMode 350 | settimer,,off 351 | Key := This.GetThisHotkey() 352 | If ( Not This.KeyList[A_ThisHotkey] ) or ( IsFunc(CheckMode) AND (%CheckMode%()) ) { 353 | Send,% This.TransSendKey(A_ThisHotkey) 354 | ShowComment() 355 | return 356 | } 357 | _SaveKeyTemp := This.KeyTemp 358 | This.KeyTemp .= Key 359 | P := 1 360 | more := "" 361 | moreCount := 0 362 | Loop { 363 | P := RegExMatch(This.KeyString,"i)\t" This.ToMatch(This.keyTemp) "[^\t]*",m,P) 364 | If P { 365 | ;msgbox % This.KeyString "`np=" p "`nm=" m 366 | more .= m "`n" 367 | P += Strlen(m) 368 | moreCount++ 369 | } 370 | Else 371 | Break 372 | } 373 | more := RTrim(more,"`n") 374 | If moreCount = 0 375 | { 376 | This.KeyTemp := "" 377 | 378 | action := This.KeyBody[_SaveKeyTemp] 379 | If Strlen(action) { 380 | This.ExecSub(Action) 381 | } 382 | Else { 383 | action := This.KeyBody[Key] 384 | If Strlen(action) { 385 | If InvalidMode 386 | ShowComment() 387 | Else 388 | This.ExecSub(Action) 389 | } 390 | Else { 391 | If RegExMatch(This.KeyString,"i)\t" This.ToMatch(key) "[^\t]*") 392 | { 393 | If InvalidMode 394 | ShowComment() 395 | Else 396 | This.Try() 397 | } 398 | Else 399 | { 400 | Send,% This.TransSendKey(A_ThisHotkey) 401 | ShowComment() 402 | } 403 | return 404 | } 405 | } 406 | } 407 | Else If moreCount = 1 408 | { 409 | Action := This.KeyBody[This.KeyTemp] 410 | If Strlen(Action) { 411 | This.ExecSub(Action) 412 | This.KeyTemp := "" 413 | } 414 | Else 415 | ShowComment(more) 416 | } 417 | Else 418 | { 419 | TimeOut := 0 - GetTimeOutClass(This.win) 420 | If Timeout And This.KeyBody[This.KeyTemp]{ 421 | This.TimeOutAction := This.KeyBody[This.KeyTemp] 422 | This.TimeOutTick := A_TickCount 423 | SetTimeOutClass(This.win) 424 | Settimer,,%TimeOut% 425 | } 426 | ErrorLevel := True 427 | ShowComment(more) 428 | return more 429 | } 430 | } 431 | 432 | 433 | ExecSub(action) { 434 | w := vim.vaild(This.win) 435 | If RegExMatch(Action,"(?<=^<)\d(?=>$)",cnt) { 436 | This.KeyCount := This.KeyCount * 10 + cnt 437 | MaxCount := w.winMaxCount 438 | If This.KeyCount > MaxCount 439 | This.KeyCount := MaxCount 440 | Tooltip % This.KeyCount 441 | return false 442 | } 443 | Else { 444 | ShowComment() 445 | If This.KeyCount And GetCommentType(Action) 446 | cnt := This.KeyCount 447 | Else 448 | cnt := 1 449 | ;cnt := This.KeyCount ? This.KeyCount : 1 450 | If RegExMatch(action,"^<.*>$") { 451 | If IsLabel(action) { 452 | Loop,%cnt% 453 | GoSub % Action 454 | } 455 | Else { 456 | Msgbox %Action%不存在,请检查脚本 457 | Return 458 | } 459 | } 460 | If RegExMatch(action,"^\(.*\)$") { 461 | file := SubStr(action,2,Strlen(action)-2) 462 | Run,%File%,,UseErrorLevel,ExecID 463 | If ErrorLevel 464 | { 465 | msgbox 运行%file%失败 466 | return 467 | } 468 | Else 469 | { 470 | WinWait,AHK_PID %ExecID%,,1 471 | WinActivate,AHK_PID %ExecID% 472 | } 473 | } 474 | If RegExMatch(Action,"^\{.*\}$") { 475 | Text := Substr(Action,2,Strlen(Action)-2) 476 | Loop,%cnt% 477 | Send,%Text% 478 | } 479 | 480 | This.KeyCount := 0 481 | If rpt 482 | return 483 | If not RegExMatch(action,"i)^$") { 484 | w.winRepeatCount := cnt 485 | w.winRepeat := Action 486 | } 487 | } 488 | EmptyMem() 489 | } 490 | 491 | SetHotkey(key,label) { 492 | ;msgbox % This.win 493 | If Strlen(This.win) > 0 { 494 | class := This.win 495 | Hotkey,IfWinActive,ahk_class %class% 496 | } 497 | Else 498 | Hotkey,IfWinActive 499 | 500 | mKey := "" 501 | Loop,Parse,Key 502 | { 503 | If Asc(A_LoopField) >= 65 And Asc(A_LoopField) <= 90 504 | mKey .= "" . Chr(Asc(A_LoopField)+32) 505 | Else 506 | mKey .= A_LoopField 507 | } 508 | Hotkey_OK := True 509 | ;Idx := This.KeyList[0] ? This.KeyList[0] : 1 510 | cnt := 1 511 | _SaveList := [] 512 | for,i,k in This.ResolveHotkey(mKey) 513 | { 514 | Hotkey,%k%,,On,UseErrorLevel 515 | If ErrorLevel 516 | { 517 | Msgbox 映射错误 518 | Hotkey_OK := False 519 | Break 520 | } 521 | ;If Not This.KeyList[k] { 522 | ; This.KeyList[idx] := k 523 | ; idx++ 524 | ;} 525 | _SaveList[cnt] := k 526 | cnt++ 527 | This.KeyList[k] := This.KeyList[k] ? This.KeyList[k] + 1 : 1 528 | } 529 | ;This.KeyList[0] := idx 530 | If Not Hotkey_OK { 531 | For i , k IN _SaveList 532 | { 533 | This.KeyList[k] := This.KeyList[k] - 1 534 | If This.KeyList[k] = 0 { 535 | Hotkey,%k%,off 536 | } 537 | } 538 | } 539 | Else { 540 | This.KeyBody[mkey] := label 541 | If not RegExMatch(This.KeyString,"\t" This.ToMatch(mKey) "[^\t]*") 542 | This.KeyString .= A_Tab mKey A_Tab 543 | } 544 | } 545 | 546 | ResolveHotkey(KeyList) 547 | { 548 | Keys := [] 549 | NewKeyList := [] 550 | n := 1 551 | Loop 552 | { 553 | Pos := RegExMatch(KeyList,"<[^<>]*>",A_Index) 554 | If Pos 555 | { 556 | LoopKey := SubStr(KeyList,1,Pos-1) 557 | Loop,Parse,LoopKey 558 | { 559 | If Asc(A_LoopField) >= 65 And Asc(A_LoopField) <= 90 560 | { 561 | Keys[n] := "shift" 562 | n++ 563 | Keys[n] := Chr(Asc(A_LoopField)+32) 564 | } 565 | Else 566 | Keys[n] := A_LoopField 567 | n++ 568 | } 569 | KeyList := SubStr(KeyList,Pos,Strlen(KeyList)) 570 | Pos := RegExMatch(KeyList,">") 571 | Keys[n] := SubStr(KeyList,2,Pos-2) 572 | KeyList := SubStr(KeyList,Pos+1,Strlen(KeyList)) 573 | n++ 574 | } 575 | Else 576 | { 577 | Loop,Parse,KeyList 578 | { 579 | If Asc(A_LoopField) >= 65 And Asc(A_LoopField) <= 90 580 | { 581 | Keys[n] := "shift" 582 | n++ 583 | Keys[n] := Chr(Asc(A_LoopField)+32) 584 | } 585 | Else 586 | Keys[n] := A_LoopField 587 | n++ 588 | } 589 | Break 590 | } 591 | } 592 | n := 1 593 | For,i,key in Keys 594 | { 595 | If RegExMatch(key,"i)(l|r)?(ctrl|shift|win|alt)") 596 | { 597 | List .= Key " & " 598 | Continue 599 | } 600 | Else 601 | { 602 | List .= Key 603 | NewKeyList[n] := List 604 | List := 605 | } 606 | n++ 607 | } 608 | Return NewKeyList 609 | } 610 | 611 | GetThisHotkey(G_ThisHotkey="") 612 | { 613 | If Strlen(G_ThisHotkey) = 0 614 | G_ThisHotkey := A_ThisHotkey 615 | GetKeyState,Var,CapsLock,T 616 | If Var = D 617 | { 618 | If RegExMatch(ThisHotkey,"i)^(l|r)?shift\s&\s[a-z]$") 619 | ThisHotkey := Substr(ThisHotkey,0) 620 | Else If RegExMatch(G_ThisHotkey,"^[a-z]$") 621 | ThisHotkey := "shift & " . G_ThisHotkey 622 | Else 623 | ThisHotkey := A_ThisHotkey 624 | } 625 | Else 626 | ThisHotkey := G_ThisHotkey 627 | Loop 628 | { 629 | If RegExMatch(ThisHotkey,"(?]$))(?!>)",m) { 630 | ThisHotkey := RegExReplace(ThisHotkey,This.ToMatch(m),"<" m ">") 631 | } 632 | Else 633 | { 634 | ThisHotkey := RegExReplace(ThisHotkey,"\s&\s") 635 | Break 636 | } 637 | } 638 | ;msgbox % Thishotkey 639 | Return ThisHotKey 640 | } 641 | 642 | ; TransSendKey(hotkey) {{{2 643 | ; 在SendKey时,将hotkey转换为Send能支持的格式 644 | TransSendKey(hotkey) 645 | { 646 | Loop 647 | { 648 | If RegExMatch(Hotkey,"i)^(f\d\d?)|esc|escpa|space|tab|enter|bs|del|ins|home|end|pgup|pgdn|up|down|left|right|!|#|\+|\^|\{|\}$") 649 | { 650 | Hotkey := "{" . Hotkey . "}" 651 | Break 652 | } 653 | If StrLen(hotkey) > 1 AND Not RegExMatch(Hotkey,"^\+.$") 654 | { 655 | Hotkey := "{" . hotkey . "}" 656 | If RegExMatch(hotkey,"i)(shift|lshift|rshift)(\s\&\s)?.+$") 657 | Hotkey := "+" . RegExReplace(hotkey,"i)(shift|lshift|rshift)(\s\&\s)?") 658 | If RegExMatch(hotkey,"i)(ctrl|lctrl|rctrl|control|lcontrol|rcontrol)(\s\&\s)?.+$") 659 | Hotkey := "^" . RegExReplace(hotkey,"i)(ctrl|lctrl|rctrl|control|lcontrol|rcontrol)(\s\&\s)?") 660 | If RegExMatch(hotkey,"i)(lwin|rwin)(\s\&\s)?.+$") 661 | Hotkey := "#" . RegExReplace(hotkey,"i)(lwin|rwin)(\s\&\s)?") 662 | If RegExMatch(hotkey,"i)(alt|lalt|ralt)(\s\&\s)?.+$") 663 | Hotkey := "!" . RegExReplace(hotkey,"i)(alt|lalt|ralt)(\s\&\s)?")A 664 | } 665 | If RegExMatch(Hotkey,"^\+.$") 666 | { 667 | Hotkey := SubStr(Hotkey,1,1) . "{" . SubStr(Hotkey,2) . "}" 668 | } 669 | GetKeyState,Var,CapsLock,T 670 | If Var = D 671 | { 672 | If RegExMatch(Hotkey,"^\+\{[a-z]\}$") 673 | { 674 | Hotkey := SubStr(Hotkey,2) 675 | Break 676 | } 677 | If RegExMatch(Hotkey,"^[a-z]$") 678 | { 679 | Hotkey := "+{" . Hotkey . "}" 680 | Break 681 | } 682 | If RegExMatch(Hotkey,"^\{[a-z]\}$") 683 | { 684 | Hotkey := "+" . Hotkey 685 | Break 686 | } 687 | } 688 | Break 689 | } 690 | Return hotkey 691 | } 692 | 693 | ToMatch(Key) 694 | { 695 | Key := RegExReplace(Key,"\+|\?|\.|\*|\{|\}|\(|\)|\||\^|\$|\[|\]|\\","\$0") 696 | Return RegExReplace(Key,"\s","\s") 697 | } 698 | 699 | } 700 | } 701 | 702 | } 703 | 704 | SetTimeOutClass(win) { 705 | vim.TimeOutClass := win 706 | } 707 | GetTimeOutClass(win) { 708 | w := vim.Vaild(win) 709 | return w.TimeOut 710 | } 711 | GetCommentDest(action) { 712 | Return vim.CommentList[action] 713 | } 714 | GetCommentType(action) { 715 | Type := vim.CommentType[action] 716 | If Strlen(Type) 717 | return Type 718 | Else 719 | return true 720 | } 721 | EmptyMem(PID="AHK Rocks") 722 | { 723 | pid:=(pid="AHK Rocks") ? DllCall("GetCurrentProcessId") : pid 724 | h:=DllCall("OpenProcess", "UInt", 0x001F0FFF, "Int", 0, "Int", pid) 725 | DllCall("SetProcessWorkingSetSize", "UInt", h, "Int", -1, "Int", -1) 726 | DllCall("CloseHandle", "Int", h) 727 | } 728 | : 729 | vim.TimeOut() 730 | return 731 | 732 | : 733 | vim.Do() 734 | return 735 | 736 | : 737 | vim.Repeat() 738 | return 739 | -------------------------------------------------------------------------------- /src/VimDesktop/lib/watchdir.ahk: -------------------------------------------------------------------------------- 1 | WatchDirectory(WatchFolder="", WatchSubDirs=true) 2 | { 3 | static 4 | local hDir, hEvent, r, Action, FileNameLen, pFileName, Restart, CurrentFolder, PointerFNI, _SizeOf_FNI_=65536 5 | nReadLen := 0 6 | If !(WatchFolder){ 7 | Gosub, StopWatchingDirectories 8 | } else if IsFunc(WatchFolder) { 9 | r := DllCall("MsgWaitForMultipleObjectsEx", UInt, DirIdx, UInt, &DirEvents, UInt, -1, UInt, 0x4FF, UInt, 0x6) ;Timeout=-1 10 | if !(r >= 0 && r < DirIdx) 11 | Return 12 | r += 1 13 | CurrentFolder := Dir%r%Path 14 | PointerFNI := &Dir%r%FNI 15 | DllCall( "GetOverlappedResult", UInt, hDir, UInt, &Dir%r%Overlapped, UIntP, nReadLen, Int, true ) 16 | Loop { 17 | pNext := NumGet( PointerFNI + 0 ) 18 | Action := NumGet( PointerFNI + 4 ) 19 | FileNameLen := NumGet( PointerFNI + 8 ) 20 | pFileName := ( PointerFNI + 12 ) 21 | If (Action < 0x6){ 22 | VarSetCapacity( FileNameANSI, FileNameLen ) 23 | DllCall( "WideCharToMultiByte",UInt,0,UInt,0,UInt,pFileName,UInt,FileNameLen,Str,FileNameANSI,UInt,FileNameLen,UInt,0,UInt,0) 24 | %WatchFolder%(Action,CurrentFolder,SubStr( FileNameANSI, 1, FileNameLen/2 )) 25 | } 26 | If (!pNext or pNext = 4129024) 27 | Break 28 | Else 29 | PointerFNI := (PointerFNI + pNext) 30 | } 31 | DllCall( "ResetEvent", UInt,NumGet( Dir%r%Overlapped, 16 ) ) 32 | Gosub, ReadDirectoryChanges 33 | return r 34 | } else { 35 | Loop % (DirIdx) { 36 | If InStr(WatchFolder, Dir%A_Index%Path){ 37 | If (Dir%A_Index%Subdirs) 38 | Return 39 | } else if InStr(Dir%A_Index%Path, WatchFolder) { 40 | If (WatchSubDirs){ 41 | DllCall( "CloseHandle", UInt,Dir%A_Index% ) 42 | DllCall( "CloseHandle", UInt,NumGet(Dir%A_Index%Overlapped, 16) ) 43 | Restart := DirIdx, DirIdx := A_Index 44 | } 45 | } 46 | } 47 | If !Restart 48 | DirIdx += 1 49 | r:=DirIdx 50 | hDir := DllCall( "CreateFile" 51 | , Str , WatchFolder 52 | , UInt , ( FILE_LIST_DIRECTORY := 0x1 ) 53 | , UInt , ( FILE_SHARE_READ := 0x1 ) 54 | | ( FILE_SHARE_WRITE := 0x2 ) 55 | | ( FILE_SHARE_DELETE := 0x4 ) 56 | , UInt , 0 57 | , UInt , ( OPEN_EXISTING := 0x3 ) 58 | , UInt , ( FILE_FLAG_BACKUP_SEMANTICS := 0x2000000 ) 59 | | ( FILE_FLAG_OVERLAPPED := 0x40000000 ) 60 | , UInt , 0 ) 61 | Dir%r% := hDir 62 | Dir%r%Path := WatchFolder 63 | Dir%r%Subdirs := WatchSubDirs 64 | VarSetCapacity( Dir%r%FNI, _SizeOf_FNI_ ) 65 | VarSetCapacity( Dir%r%Overlapped, 20, 0 ) 66 | DllCall( "CloseHandle", UInt,hEvent ) 67 | hEvent := DllCall( "CreateEvent", UInt,0, Int,true, Int,false, UInt,0 ) 68 | NumPut( hEvent, Dir%r%Overlapped, 16 ) 69 | if ( VarSetCapacity(DirEvents) < DirIdx*4 and VarSetCapacity(DirEvents, DirIdx*4 + 60)) 70 | Loop %DirIdx% 71 | { 72 | If (SubStr(Dir%A_Index%Path,1,1)!="-"){ 73 | action++ 74 | NumPut( NumGet( Dir%action%Overlapped, 16 ), DirEvents, action*4-4 ) 75 | } 76 | } 77 | NumPut( hEvent, DirEvents, DirIdx*4-4) 78 | Gosub, ReadDirectoryChanges 79 | If Restart 80 | DirIdx = %Restart% 81 | } 82 | Return 83 | StopWatchingDirectories: 84 | Loop % (DirIdx) { 85 | DllCall( "CloseHandle", UInt,Dir%A_Index% ) 86 | DllCall( "CloseHandle", UInt,NumGet(Dir%A_Index%Overlapped, 16) ) 87 | Dir%A_Index%= 88 | Dir%A_Index%Path= 89 | Dir%A_Index%Subdirs= 90 | Dir%A_Index%FNI= 91 | DllCall( "CloseHandle", UInt, NumGet(Dir%A_Index%Overlapped,16) ) 92 | VarSetCapacity(Dir%A_Index%Overlapped,0) 93 | } 94 | DirIdx= 95 | VarSetCapacity(DirEvents,0) 96 | Return 97 | ReadDirectoryChanges: 98 | DllCall( "ReadDirectoryChangesW" 99 | , UInt , Dir%r% 100 | , UInt , &Dir%r%FNI 101 | , UInt , _SizeOf_FNI_ 102 | , UInt , Dir%r%SubDirs 103 | , UInt , ( FILE_NOTIFY_CHANGE_FILE_NAME := 0x1 ) 104 | | ( FILE_NOTIFY_CHANGE_DIR_NAME := 0x2 ) 105 | | ( FILE_NOTIFY_CHANGE_ATTRIBUTES := 0x4 ) 106 | | ( FILE_NOTIFY_CHANGE_SIZE := 0x8 ) 107 | | ( FILE_NOTIFY_CHANGE_LAST_WRITE := 0x10 ) 108 | | ( FILE_NOTIFY_CHANGE_CREATION := 0x40 ) 109 | | ( FILE_NOTIFY_CHANGE_SECURITY := 0x100 ) 110 | , UInt , 0 111 | , UInt , &Dir%r%Overlapped 112 | , UInt , 0 ) 113 | Return 114 | } 115 | -------------------------------------------------------------------------------- /src/VimDesktop/viatc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/victorwoo/vimdesktop/c88538ffe486bfbc6eb9e563826a5ac1ac7d58bf/src/VimDesktop/viatc.ico -------------------------------------------------------------------------------- /src/VimDesktop/vimd.ahk: -------------------------------------------------------------------------------- 1 | ;Version 1.0.3 2 | #Persistent,ON 3 | #SingleInstance,Force 4 | SetWorkingDir, %A_ScriptDir% 5 | SetControlDelay,-1 6 | Detecthiddenwindows,on 7 | Coordmode,Menu,Window 8 | OnMessage(0x4a, "Receive_WM_COPYDATA") 9 | Init() 10 | ; Tray Menu {{{1 11 | Menu,Tray,NoStandard 12 | Menu,Tray,Add,显示热键(&Q),GUI_ListHotkey 13 | Menu,Tray,Default,显示热键(&Q) 14 | Menu,Tray,Add 15 | Menu,Tray,Add,主页(&M),GUI_GotoWeb 16 | Menu,Tray,Add,提交问题(&I),GUI_GotoIssue 17 | Menu,Tray,Add 18 | Menu,Tray,Add,重启(&R),GUI_Reload 19 | Menu,Tray,Add,退出(&X),GUI_Exit 20 | Menu,Tray,Icon,viatc.ico 21 | ;==================================================================== 22 | ; Read Config {{{1 23 | If Not FileExist(A_ScriptDir "\vimd.ini") 24 | FileAppend,,%A_ScriptDir%\vimd.ini 25 | config := GetINIObj(A_ScriptDir "\vimd.ini") 26 | plog := GetINIObj(A_ScriptDir "\plugins\plugins.ahk") 27 | 28 | Global InvalidMode := config.GetValue("config","InvalidMode") 29 | sub := plog.GetKeys("ExtensionsTime") 30 | Loop,Parse,Sub,`n 31 | { 32 | If IsLabel(A_LoopField) And Strlen(A_LoopField){ 33 | Enabled := strlen(config.GetValue("plugins",A_LoopField)) ? config.GetValue("plugins",A_LoopField) : 1 34 | GoSub,%A_LoopField% 35 | } 36 | } 37 | keylist := config.GetKeys("Global") 38 | Loop,Parse,keylist,`n 39 | { 40 | If not strlen(A_LoopField) 41 | continue 42 | value := config.GetValue("Global",Trim(A_LoopField)) 43 | If RegExMatch(value,"\[=[^\[\]]*\]",mode) 44 | vim.mode(Substr(mode,3,strlen(mode)-3)) 45 | If RegExMatch(Trim(A_LoopField),"^\*") 46 | vim.smap(SubStr(Trim(A_LoopField),2),RegExReplace(value,"\[=[^\[\]]*\]")) 47 | Else 48 | vim.map(Trim(A_LoopField),RegExReplace(value,"\[=[^\[\]]*\]")) 49 | } 50 | 51 | keylist := config.GetKeys("Global_Exclude") 52 | Loop,Parse,keylist,`n 53 | { 54 | If Strlen(A_LoopField) 55 | vim.Exclude(A_LoopField) 56 | Else 57 | continue 58 | } 59 | 60 | for class ,k in vim.vimWindows 61 | { 62 | If strlen(config.GetKeyValue(class)) 63 | { 64 | keylist := config.GetKeys(class) 65 | Loop,Parse,keylist,`n 66 | { 67 | If not strlen(A_LoopField) 68 | continue 69 | value := config.GetValue(class,Trim(A_LoopField)) 70 | If RegExMatch(value,"\[=[^\[\]]*\]",mode) 71 | vim.mode(Substr(mode,3,strlen(mode)-3)) 72 | If RegExMatch(Trim(A_LoopField),"^\*") 73 | vim.smap(SubStr(Trim(A_LoopField),2),RegExReplace(value,"\[=[^\[\]]*\]"),class) 74 | Else 75 | vim.map(Trim(A_LoopField),RegExReplace(value,"\[=[^\[\]]*\]"),class) 76 | } 77 | } 78 | } 79 | 80 | WatchDirectory(A_ScriptDir "\plugins",1) 81 | autoload := strlen(config.GetValue("config","autoload")) ? config.GetValue("config","autoload") : 1 82 | If autoload 83 | SetTimer,WatchPlugins,1000 84 | EmptyMem() 85 | return 86 | 87 | ;==================================================================== 88 | WatchPlugins: 89 | WatchDirectory("PluginsChange") 90 | return 91 | PluginsChange(a,f,i){ 92 | Run %A_ScriptDir%\check.ahk 93 | ;SetTimer,WatchPlugins,off 94 | ExitApp 95 | } 96 | ; GUI {{{1 97 | ; GUI_Config() {{{2 98 | : 99 | GUI_Config() 100 | return 101 | GUI_Config() { 102 | GUI,Config:Destroy 103 | GUI,Config:Font,s9 ,Microsoft YaHei 104 | Gui,Config:+Delimiter`n +hwndconfig +LastFound +Resize 105 | GUI,Config:Add,ListBox,w200 h200 106 | GUI,Config:Show 107 | WinMove,ahk_id %config%,,,,626,500 108 | } 109 | 110 | ; GUI_ListHotkey() {{{2 111 | GUI_ListHotkey() { 112 | win := "全局" "`n" 113 | For i , k in vim.vimWindows 114 | win .= i "`n" 115 | ;GUI,ListHotkey:Add,Edit 116 | GUI,ListHotkey:Destroy 117 | GUI,ListHotkey:Font,s9 ,Microsoft YaHei 118 | Gui,ListHotkey:+Delimiter`n +hwndlhk +LastFound +Resize 119 | GUI,ListHotkey:Add,Text,x7 y8,窗口: 120 | GUI,ListHotkey:Add,DropDownList,x45 y5 w560 choose1 gGUI_ListHotKey_Win,%win% 121 | GUI,ListHotkey:Add,Text,x7 y38 ,模式: 122 | GUI,ListHotKey:Add,DropDownList,x45 y35 w560 choose1 gGUI_ListHotKey_Mode 123 | GUI,ListHotKey:Add,ListView, x5 w600 h400 ,热键`n动作`n说明 124 | GUI,ListHotkey:Default 125 | LV_ModifyCol(1,"100 ") 126 | LV_ModifyCol(2,"200 ") 127 | LV_ModifyCol(3,"300 ") 128 | GUI,ListHOtkey:Show 129 | WinMove,ahk_id %lhk%,,,,626 130 | GoSub,GUI_ListHotkey_Win 131 | } 132 | 133 | GUI_ListHotkey_Win: 134 | GUI_ListHotkey_Win() 135 | return 136 | ; GUI_ListHotkey_Win() {{{2 137 | GUI_ListHotkey_Win() { 138 | GUI,ListHotkey:Default 139 | GUIControlGet,win,,ComboBox1 140 | win := win = 全局 ? "" : win 141 | m := vim.ListKey(win) 142 | mode := "`n" 143 | Loop,Parse,m,`n 144 | { 145 | If IsMode 146 | mode .= A_LoopField "`n" 147 | If A_LoopField = ==== 148 | IsMode := True 149 | ELse 150 | IsMode := False 151 | } 152 | GUIControl,,ComboBox2,%mode% 153 | GUIControl,Choose,ComboBox2,1 154 | GoSub,GUI_ListHotkey_Mode 155 | } 156 | GUI_ListHotkey_Mode: 157 | GUI_ListHotkey_Mode() 158 | return 159 | ; GUI_ListHotkey_Mode() {{{2 160 | GUI_ListHotkey_Mode() { 161 | GUI,ListHOtkey:Default 162 | GUIControlGet,win,,ComboBox1 163 | GUIControlGet,Mode,,ComboBox2 164 | m := vim.ListKey(win,Mode) 165 | m0 := 1 166 | LV_Delete() 167 | Loop,Parse,m,`n 168 | { 169 | If Strlen(A_LoopField) = 0 170 | Continue 171 | m1 := "" 172 | m2 := "" 173 | Loop,Parse,A_LoopField,%A_Space% 174 | { 175 | If Strlen(m1) 176 | m2 := A_LoopField 177 | Else 178 | m1 := A_LoopField 179 | } 180 | m3 := vim.CommentList[m2] 181 | If LV_Add("",m1,m2,m3) 182 | m0 := m0 + 1 183 | } 184 | } 185 | ; GUISize(w,p){{{2 186 | GUISize(w,p){ 187 | GUI,ListHotkey:+hwndlhk 188 | IfWinActive ahk_id %lhk% 189 | { 190 | Anchor("combobox1","w") 191 | Anchor("combobox2","w") 192 | Anchor("SysListView321","wh") 193 | GUI,ListHotkey:Default 194 | GUI,ListView,SysListView321 195 | ControlGetPos , , , w, ,SysListView321,ahk_id %lhk% 196 | LV_ModifyCol(3,w-221) 197 | } 198 | } 199 | 200 | GUI_ListHotkey: 201 | GUI_ListHotkey() 202 | return 203 | 204 | GUI_Listline: 205 | Listlines 206 | return 207 | GUI_Reload: 208 | Reload 209 | return 210 | 211 | GUI_Exit: 212 | ExitApp 213 | return 214 | 215 | GUI_GotoWeb: 216 | run "https://github.com/victorwoo/vimdesktop" 217 | return 218 | 219 | GUI_GotoIssue: 220 | run "https://github.com/victorwoo/vimdesktop/issues" 221 | return 222 | 223 | GUI_VIMINFO: 224 | GUI_VIMINFO() 225 | return 226 | GUI_VIMINFO() 227 | { 228 | GUI,Query:Default 229 | GUIControlGet,Key,,Edit1 230 | GUIControlGet,Win,,Static1 231 | w := vim.Vaild(win) 232 | mode := w.GetMode() 233 | If Strlen(Key) 234 | { 235 | Msgbox % win Key 236 | } 237 | Else 238 | GUI,Query:Destroy 239 | } 240 | ; Receive_WM_COPYDATA(wParam, lParam) {{{2 241 | Receive_WM_COPYDATA(wParam, lParam){ 242 | StringAddress := NumGet(lParam + 2*A_PtrSize) ; 获取 CopyDataStruct 的 lpData 成员. 243 | AHKReturn := StrGet(StringAddress) ; 从结构中复制字符串. 244 | If RegExMatch(AHKReturn,"i)exitapp") 245 | ExitApp 246 | return true 247 | } 248 | 249 | #Include %A_ScriptDir%\lib\vimcore.ahk 250 | #Include %A_ScriptDir%\lib\anchor.ahk 251 | #Include %A_ScriptDir%\lib\ini.ahk 252 | #Include %A_ScriptDir%\lib\watchdir.ahk 253 | #Include *i %A_ScriptDir%\plugins\plugins.ahk 254 | -------------------------------------------------------------------------------- /src/VimDesktop/vimd.ini: -------------------------------------------------------------------------------- 1 | [config] 2 | InvalidMode=0 3 | autoload=1 4 | 5 | [Plugins] 6 | General=1 7 | TotalCommander=1 8 | wps=0 9 | [Global] 10 | *=[=normal] 11 | *e=[=normal] 12 | *z=[=normal] 13 | *g=[=normal] 14 | [Global_Exclude] 15 | Notepad 16 | [TTOTAL_CMD] 17 | ;热键定义语法 18 | ;f 热键 19 | ; 对应的动作 20 | ;[=normal] 在normal模式下生效 21 | f=[=normal] 22 | --------------------------------------------------------------------------------