 ﻿TotalCommander:
-;=======================================================
-	Global tcconfig := GetINIObj(ConfigPath)
-	Global TCPath := tcconfig.GetValue("TotalCommander_Config","TCPath")
-	Global TCINI  := tcconfig.GetValue("TotalCommander_Config","TCINI")
-	Global TCINIObj
-
-
-	;MsgBox,"%TCPath%"
-	If !FileExist(TCPath)
-	{	Process,Exist,totalcmd.exe
-		If ErrorLevel
-		{	WinGet,TCPath,ProcessPath,ahk_pid %ErrorLevel%
-			;MsgBox,% TCPath
-		}
-		Else
-		{	Process,Exist,totalcmd64.exe
-			If ErrorLevel
-				WinGet,TCPath,ProcessPath,ahk_pid %ErrorLevel%
-		}
-		If TCPath
-			IniWrite,%TCPath%,%ConfigPath%,TotalCommander_Config,TCPath
-	}
-
-	If TCPath and Not FileExist(TCPath)
-	{
-		RegRead,TCDir,HKEY_CURRENT_USER,Software\Ghisler\Total Commander,InstallDir
-		If FileExist(TCDir "\totalcmd.exe")
-			l .= TCDir "\totalcmd.exe`n"
-		If FileExist(TCDir "\totalcmd64.exe")
-			l .= TCDir "\totalcmd64.exe`n"
-		GUI,FindTC:Add,Edit,w300 ReadOnly R3,%TCDir%
-		GUI,FindTC:Add,Button,w300 gTotalcomander_select_tc,TOTALCMD.EXE   (&A)
-		GUI,FindTC:Add,Button,w300 gTotalcomander_select_tc64,TOTALCMD64.EXE (&S)
-		GUI,FindTC:Add,Button,w300 gTotalcomander_select_tcdir,TC目录路径不对? (&D)
-		GUI,FindTC:Show,,Total Commander 设置路径
-	}
-
-	If TCPath and not FileExist(TCINI)
-	{
-		SplitPath,TCPath,,dir
-		TCINI := dir "\wincmd.ini"
-		IniWrite,%TCINI%,%ConfigPath%,TotalCommander_Config,TCINI
-	}
-	tciniobj    := GetINIObj(TCINI)
-
-	
-	;添加将TC作为打开文件对话框的快捷键
-	IniWriteIfNullValue(ConfigPath,"Global","*<ctrl>;","<FocusTCCmd>")
-
-	If RegExMatch(TcPath,"i)totalcmd64\.exe$")
-	{
-		Global TCListBox := "LCLListBox"
-		Global TCEdit := "Edit2"
-		Global TInEdit := "TInEdit1"
-		GLobal TCPanel1 := "Window1"
-		Global TCPanel2 := "Window11"
-	}
-	Else
-	{
-		Global TCListBox := "TMyListBox"
-		Global TCEdit := "Edit1"
-		Global TInEdit := "TInEdit1"
-		Global TCPanel1 := "TPanel1"
-		Global TCPanel2 := "TMyPanel8"
-	}
-	Global Mark := []
-	Global NewFiles := []
-	vim.Comment("<Normal_Mode_TC>","返回正常模式")
-	vim.Comment("<Insert_Mode_TC>","进入插入模式")
-	vim.Comment("<ToggleTC>","打开/激活TC")
-
-	vim.comment("<FocusTCCmd>","激活TC，并定位到命令行")
-
-	vim.Comment("<azHistory>","a-z历史导航")
-	vim.Comment("<DownSelect>","向下选择")
-	vim.Comment("<UpSelect>","向上选择")
-	vim.Comment("<Mark>","标记功能")
-	vim.Comment("<ForceDelete>","强制删除")
-	vim.Comment("<ListMark>","显示标记")
-	vim.Comment("<Toggle_50_100Percent>","切换当前窗口显示状态50%~100%")
-	vim.Comment("<WinMaxLeft>","最大化左侧窗口")
-	vim.Comment("<WinMaxRight>","最大化右侧窗口")
-	vim.Comment("<GoLastTab>","切换到最后一个标签")
-	vim.Comment("<CopyNameOnly>","只复制文件名，不含扩展名")
-	vim.Comment("<GotoLine>","移动到[count]行，默认第一行")
-	vim.Comment("<LastLine>","移动到[count]行，默认最后一行")
-	vim.Comment("<Half>","移动到窗口中间行")
-	vim.Comment("<CreateNewFile>","文件模板")
-	vim.Comment("<GoToParentEx>","返回到上层文件夹，可返回到我的电脑")
-	vim.Comment("<AlwayOnTop>","设置TC顶置")
-	vim.comment("<OpenDriveThis>","打开驱动器列表:本侧")
-	vim.comment("<OpenDriveThat>","打开驱动器列表:另侧")
-	vim.comment("<MoveDirectoryHotlist>","移动到常用文件夹")
-	vim.comment("<CopyDirectoryHotlist>","复制到常用文件夹")
-	vim.comment("<GotoPreviousDirOther>","后退另一侧")
-	vim.comment("<GotoNextDirOther>","前进另一侧")
-	vim.comment("<Search>","连续搜索")
-
+    Global tcconfig := GetINIObj(ConfigPath)
+    Global TCPath   := tcconfig.GetValue("TotalCommander_Config","TCPath")
+    Global TCINI    := tcconfig.GetValue("TotalCommander_Config","TCINI")
+
+    If !FileExist(TCPath)
+    {
+        Process,Exist,totalcmd.exe
+        If ErrorLevel
+        {
+            WinGet,TCPath,ProcessPath,ahk_pid %ErrorLevel%
+        }
+        Else
+        {
+            Process,Exist,totalcmd64.exe
+            If ErrorLevel
+                WinGet,TCPath,ProcessPath,ahk_pid %ErrorLevel%
+        }
+        If TCPath
+            IniWrite,%TCPath%,%ConfigPath%,TotalCommander_Config,TCPath
+    }
+
+    If TCPath and Not FileExist(TCPath)
+    {
+        RegRead,TCDir,HKEY_CURRENT_USER,Software\Ghisler\Total Commander,InstallDir
+        If FileExist(TCDir "\totalcmd.exe")
+            l .= TCDir "\totalcmd.exe`n"
+        If FileExist(TCDir "\totalcmd64.exe")
+            l .= TCDir "\totalcmd64.exe`n"
+        GUI,FindTC:Add,Edit,w300 ReadOnly R3,%TCDir%
+        GUI,FindTC:Add,Button,w300 gTotalcomander_select_tc,TOTALCMD.EXE   (&A)
+        GUI,FindTC:Add,Button,w300 gTotalcomander_select_tc64,TOTALCMD64.EXE (&S)
+        GUI,FindTC:Add,Button,w300 gTotalcomander_select_tcdir,TC目录路径不对? (&D)
+        GUI,FindTC:Show,,Total Commander 设置路径
+    }
+
+    If TCPath and not FileExist(TCINI)
+    {
+        SplitPath,TCPath,,dir
+        TCINI := dir "\wincmd.ini"
+        IniWrite,%TCINI%,%ConfigPath%,TotalCommander_Config,TCINI
+    }
+
+    
+    ;添加将TC作为打开文件对话框的快捷键
+    IniWriteIfNullValue(ConfigPath,"Global","*<ctrl>;","<FocusTCCmd>")
+
+    If RegExMatch(TcPath,"i)totalcmd64\.exe$")
+    {
+        Global TCListBox := "LCLListBox"
+        Global TCEdit := "Edit2"
+        Global TInEdit := "TInEdit1"
+        GLobal TCPanel1 := "Window1"
+        Global TCPanel2 := "Window11"
+    }
+    Else
+    {
+        Global TCListBox := "TMyListBox"
+        Global TCEdit := "Edit1"
+        Global TInEdit := "TInEdit1"
+        Global TCPanel1 := "TPanel1"
+        Global TCPanel2 := "TMyPanel8"
+    }
+    Global Mark := []
+    Global NewFiles := []
+    vim.Comment("<Normal_Mode_TC>","返回正常模式")
+    vim.Comment("<Insert_Mode_TC>","进入插入模式")
+    vim.Comment("<ToggleTC>","打开/激活TC")
+    vim.comment("<FocusTCCmd>","激活TC，并定位到命令行")
+
+    vim.Comment("<azHistory>","a-z历史导航")
+    vim.Comment("<DownSelect>","向下选择")
+    vim.Comment("<UpSelect>","向上选择")
+    vim.Comment("<Mark>","标记功能")
+    vim.Comment("<ForceDelete>","强制删除")
+    vim.Comment("<ListMark>","显示标记")
+    vim.Comment("<Toggle_50_100Percent>","切换当前窗口显示状态50%~100%")
+    vim.Comment("<WinMaxLeft>","最大化左侧窗口")
+    vim.Comment("<WinMaxRight>","最大化右侧窗口")
+    vim.Comment("<GoLastTab>","切换到最后一个标签")
+    vim.Comment("<CopyNameOnly>","只复制文件名，不含扩展名")
+    vim.Comment("<GotoLine>","移动到[count]行，默认第一行")
+    vim.Comment("<LastLine>","移动到[count]行，默认最后一行")
+    vim.Comment("<Half>","移动到窗口中间行")
+    vim.Comment("<CreateNewFile>","文件模板")
+    vim.Comment("<GoToParentEx>","返回到上层文件夹，可返回到我的电脑")
+    vim.Comment("<AlwayOnTop>","设置TC顶置")
+    vim.comment("<OpenDriveThis>","打开驱动器列表:本侧")
+    vim.comment("<OpenDriveThat>","打开驱动器列表:另侧")
+    vim.comment("<MoveDirectoryHotlist>","移动到常用文件夹")
+    vim.comment("<CopyDirectoryHotlist>","复制到常用文件夹")
+    vim.comment("<GotoPreviousDirOther>","后退另一侧")
+    vim.comment("<GotoNextDirOther>","前进另一侧")
+    vim.comment("<Search>","连续搜索")
 
     vim.mode("normal","TQUICKSEARCH")
-	vim.map("J","<Down>","TQUICKSEARCH")
-	vim.map("K","<Up>","TQUICKSEARCH")
-	;vim.map("H","o","<OpenDriveThis>")
-	;vim.map("H","O","<OpenDriveThat>")
+    vim.map("J","<Down>","TQUICKSEARCH")
+    vim.map("K","<Up>","TQUICKSEARCH")
     ;vim.map("<esc>","<Normal_Mode_TC>","TQUICKSEARCH")
 
-	vim.mode("insert","TTOTAL_CMD")
-	vim.SetTimeOut(800,"TTOTAL_CMD")
-	vim.map("<esc>","<Normal_Mode_TC>","TTOTAL_CMD")
-	vim.mode("Search","TTOTAL_CMD")
-	vim.map("<esc>","<Normal_Mode_TC>","TTOTAL_CMD")
-
-	vim.mode("normal","TTOTAL_CMD")
-
-	;复制/移动到右侧 f取file的意思 filecopy
-	vim.map("fc","<cm_CopyOtherpanel>","TTOTAL_CMD")
-	vim.map("fx","<cm_MoveOnly>","TTOTAL_CMD")
-
-	;使用队列复制/移动到右侧 q-queue,fcq会影响对fc的使用，改用fqc/fqx的方式
-	vim.map("fqc","<CopyUseQueues>","TTOTAL_CMD")
-	vim.map("fqx","<MoveUseQueues>","TTOTAL_CMD")
-
-	;ff复制到剪切板 fz剪切到剪切板 fv粘贴
-	vim.map("ff","<cm_CopyToClipboard>","TTOTAL_CMD")
-	vim.map("fz","<cm_CutToClipboard>","TTOTAL_CMD")
-	vim.map("fv","<cm_PasteFromClipboard>","TTOTAL_CMD")
-
-	;fb复制到收藏夹某个目录，fd移动到收藏夹的某个目录
-	vim.map("fb","<CopyDirectoryHotlist>","TTOTAL_CMD")
-	vim.map("fd","<MoveDirectoryHotlist>","TTOTAL_CMD")
-	vim.map("ft","<cm_SyncChangeDir>","TTOTAL_CMD")
-	vim.map("<shift>f","<Search>","TTOTAL_CMD")
-	vim.map("gh","<GotoPreviousDirOther>","TTOTAL_CMD")
-	vim.map("gl","<GotoNextDirOther>","TTOTAL_CMD")
-	vim.map("<shift>vh","<cm_SwitchIgnoreList>","TTOTAL_CMD")
-	vim.map("0","<0>","TTOTAL_CMD")
-	vim.map("1","<1>","TTOTAL_CMD")
-	vim.map("2","<2>","TTOTAL_CMD")
-	vim.map("3","<3>","TTOTAL_CMD")
-	vim.map("4","<4>","TTOTAL_CMD")
-	vim.map("5","<5>","TTOTAL_CMD")
-	vim.map("6","<6>","TTOTAL_CMD")
-	vim.map("7","<7>","TTOTAL_CMD")
-	vim.map("8","<8>","TTOTAL_CMD")
-	vim.map("9","<9>","TTOTAL_CMD")
-	vim.map("k","<up>","TTOTAL_CMD")
-	vim.map("K","<upSelect>","TTOTAL_CMD")
-	vim.map("j","<down>","TTOTAL_CMD")
-	vim.map("J","<downSelect>","TTOTAL_CMD")
-	vim.map("h","<left>","TTOTAL_CMD")
-	vim.map("H","<cm_GotoPreviousDir>","TTOTAL_CMD")
-	vim.map("l","<right>","TTOTAL_CMD")
-	vim.map("L","<cm_GotoNextDir>","TTOTAL_CMD")
-	vim.map("I","<CreateNewFile>","TTOTAL_CMD")
-	vim.map("i","<Insert_Mode_TC>","TTOTAL_CMD")
-	vim.map("d","<cm_DirectoryHotlist>","TTOTAL_CMD")
-	vim.map("D","<cm_OpenDesktop>","TTOTAL_CMD")
-	vim.map("e","<cm_ContextMenu>","TTOTAL_CMD")
-	vim.map("E","<cm_ExeCuteDOS>","TTOTAL_CMD")
-	vim.map("n","<azHistory>","TTOTAL_CMD")
-	vim.map("m","<Mark>","TTOTAL_CMD")
-	vim.map("M","<Half>","TTOTAL_CMD")
-	vim.map("'","<ListMark>","TTOTAL_CMD")
-	vim.map("u","<GoToParentEx>","TTOTAL_CMD")
-	vim.map("U","<cm_GoToRoot>","TTOTAL_CMD")
-	vim.map("o","<cm_LeftOpenDrives>","TTOTAL_CMD")
-	vim.map("O","<cm_RightOpenDrives>","TTOTAL_CMD")
-	vim.map("q","<cm_SrcQuickView>","TTOTAL_CMD")
-	vim.map("r","<cm_RenameOnly>","TTOTAL_CMD")
-	vim.map("R","<cm_MultiRenameFiles>","TTOTAL_CMD")
-	vim.map("x","<cm_Delete>","TTOTAL_CMD")
-	vim.map("X","<ForceDelete>","TTOTAL_CMD")
-	vim.map("w","<cm_List>","TTOTAL_CMD")
-	vim.map("y","<cm_CopyNamesToClip>","TTOTAL_CMD")
-	vim.map("Y","<cm_CopyFullNamesToClip>","TTOTAL_CMD")
-	vim.map("P","<cm_PackFiles>","TTOTAL_CMD")
-	vim.map("p","<cm_UnpackFiles>","TTOTAL_CMD")
-	vim.map("t","<cm_OpenNewTab>","TTOTAL_CMD")
-	vim.map("T","<cm_OpenNewTabBg>","TTOTAL_CMD")
-	vim.map("/","<cm_ShowQuickSearch>","TTOTAL_CMD")
-	vim.map("?","<cm_SearchFor>","TTOTAL_CMD")
-	vim.map("[","<cm_SelectCurrentName>","TTOTAL_CMD")
-	vim.map("{","<cm_UnselectCurrentName>","TTOTAL_CMD")
-	vim.map("]","<cm_SelectCurrentExtension>","TTOTAL_CMD")
-	vim.map("}","<cm_UnSelectCurrentExtension>","TTOTAL_CMD")
-	vim.map("\","<cm_ExchangeSelection>","TTOTAL_CMD")
-	vim.map("|","<cm_ClearAll>","TTOTAL_CMD")
-	vim.map("-","<cm_SwitchSeparateTree>","TTOTAL_CMD")
-	vim.map("=","<cm_MatchSrc>","TTOTAL_CMD")
-	vim.map(";","<cm_FocusCmdLine>","TTOTAL_CMD")
-	vim.map(":","<cm_FocusCmdLine>","TTOTAL_CMD")
-	vim.map("G","<LastLine>","TTOTAL_CMD")
-	vim.map("ga","<cm_CloseAllTabs>","TTOTAL_CMD")
-	vim.map("gg","<GoToLine>","TTOTAL_CMD")
-	vim.map("g$","<LastLine>","TTOTAL_CMD")
-
-	;与vim保持一致
-	vim.map("gt","<cm_SwitchToNextTab>","TTOTAL_CMD")
-	vim.map("gT","<cm_SwitchToPreviousTab>","TTOTAL_CMD")
-
-	vim.map("gc","<cm_CloseCurrentTab>","TTOTAL_CMD")
-	vim.map("gb","<cm_OpenDirInNewTabOther>","TTOTAL_CMD")
-	vim.map("ge","<cm_Exchange>","TTOTAL_CMD")
-	vim.map("gw","<cm_ExchangeWithTabs>","TTOTAL_CMD")
-	vim.map("g1","<cm_SrcActivateTab1>","TTOTAL_CMD")
-	vim.map("g2","<cm_SrcActivateTab2>","TTOTAL_CMD")
-	vim.map("g3","<cm_SrcActivateTab3>","TTOTAL_CMD")
-	vim.map("g4","<cm_SrcActivateTab4>","TTOTAL_CMD")
-	vim.map("g5","<cm_SrcActivateTab5>","TTOTAL_CMD")
-	vim.map("g6","<cm_SrcActivateTab6>","TTOTAL_CMD")
-	vim.map("g7","<cm_SrcActivateTab7>","TTOTAL_CMD")
-	vim.map("g8","<cm_SrcActivateTab8>","TTOTAL_CMD")
-	vim.map("g9","<cm_SrcActivateTab9>","TTOTAL_CMD")
-	vim.map("g0","<GoLastTab>","TTOTAL_CMD")
-	vim.map("sn","<cm_SrcByName>","TTOTAL_CMD")
-	vim.map("se","<cm_SrcByExt>","TTOTAL_CMD")
-	vim.map("ss","<cm_SrcBySize>","TTOTAL_CMD")
-	vim.map("sd","<cm_SrcByDateTime>","TTOTAL_CMD")
-	vim.map("sr","<cm_SrcNegOrder>","TTOTAL_CMD")
-	vim.map("s1","<cm_SrcSortByCol1>","TTOTAL_CMD")
-	vim.map("s2","<cm_SrcSortByCol2>","TTOTAL_CMD")
-	vim.map("s3","<cm_SrcSortByCol3>","TTOTAL_CMD")
-	vim.map("s4","<cm_SrcSortByCol4>","TTOTAL_CMD")
-	vim.map("s5","<cm_SrcSortByCol5>","TTOTAL_CMD")
-	vim.map("s6","<cm_SrcSortByCol6>","TTOTAL_CMD")
-	vim.map("s7","<cm_SrcSortByCol7>","TTOTAL_CMD")
-	vim.map("s8","<cm_SrcSortByCol8>","TTOTAL_CMD")
-	vim.map("s9","<cm_SrcSortByCol9>","TTOTAL_CMD")
-	vim.map("s0","<cm_SrcUnsorted>","TTOTAL_CMD")
-	vim.map("v","<cm_SrcCustomViewMenu>","TTOTAL_CMD")
-	vim.map("Vb","<cm_VisButtonbar>","TTOTAL_CMD")
-	vim.map("Vd","<cm_VisDriveButtons>","TTOTAL_CMD")
-	vim.map("Vo","<cm_VisTwoDriveButtons>","TTOTAL_CMD")
-	vim.map("Vr","<cm_VisDriveCombo>","TTOTAL_CMD")
-	vim.map("Vc","<cm_VisDriveCombo>","TTOTAL_CMD")
-	vim.map("Vt","<cm_VisTabHeader>","TTOTAL_CMD")
-	vim.map("Vs","<cm_VisStatusbar>","TTOTAL_CMD")
-	vim.map("Vn","<cm_VisCmdLine>","TTOTAL_CMD")
-	vim.map("Vf","<cm_VisKeyButtons>","TTOTAL_CMD")
-	vim.map("Vw","<cm_VisDirTabs>","TTOTAL_CMD")
-	vim.map("Ve","<cm_CommandBrowser>","TTOTAL_CMD")
-	vim.map("zz","<Toggle_50_100Percent>","TTOTAL_CMD")
-	vim.map("zi","<WinMaxLeft>","TTOTAL_CMD")
-	vim.map("zo","<WinMaxRight>","TTOTAL_CMD")
-	vim.map("zt","<AlwayOnTop>","TTOTAL_CMD")
-	vim.map("zn","<cm_Minimize>","TTOTAL_CMD")
-	vim.map("zm","<cm_Maximize>","TTOTAL_CMD")
-	vim.map("zr","<cm_Restore>","TTOTAL_CMD")
-	vim.map("zv","<cm_VerticalPanels>","TTOTAL_CMD")
-	vim.map("zv","<cm_VerticalPanels>","TTOTAL_CMD")
-	vim.map(".","<Repeat>","TTOTAL_CMD")
-/*
-	;vim.map("zs","<TransParent>","TTOTAL_CMD")
-	KeyList := vim.listKey("TTOTAL_CMD")
-	GUI,Add,ListView,w300 h500,a
-	Loop,Parse,KeyList,`n
-	{
-		LV_Add("",A_LoopField)
-	}
-	GUI,Show ,w310 h510
-*/
-	;; 默认按键完
-	ReadNewFile()
-	GoSub,TCCOMMAND
-return
+    vim.mode("insert","TTOTAL_CMD")
+    vim.SetTimeOut(800,"TTOTAL_CMD")
+    vim.map("<esc>","<Normal_Mode_TC>","TTOTAL_CMD")
+    vim.mode("Search","TTOTAL_CMD")
+    vim.map("<esc>","<Normal_Mode_TC>","TTOTAL_CMD")
+
+    vim.mode("normal","TTOTAL_CMD")
+
+    ;复制/移动到右侧 f取file的意思 filecopy
+    vim.map("fc","<cm_CopyOtherpanel>","TTOTAL_CMD")
+    vim.map("fx","<cm_MoveOnly>","TTOTAL_CMD")
+
+    ;使用队列复制/移动到右侧 q-queue,fcq会影响对fc的使用，改用fqc/fqx的方式
+    vim.map("fqc","<CopyUseQueues>","TTOTAL_CMD")
+    vim.map("fqx","<MoveUseQueues>","TTOTAL_CMD")
+
+    ;ff复制到剪切板 fz剪切到剪切板 fv粘贴
+    vim.map("ff","<cm_CopyToClipboard>","TTOTAL_CMD")
+    vim.map("fz","<cm_CutToClipboard>","TTOTAL_CMD")
+    vim.map("fv","<cm_PasteFromClipboard>","TTOTAL_CMD")
+
+    ;fb复制到收藏夹某个目录，fd移动到收藏夹的某个目录
+    vim.map("fb","<CopyDirectoryHotlist>","TTOTAL_CMD")
+    vim.map("fd","<MoveDirectoryHotlist>","TTOTAL_CMD")
+    vim.map("ft","<cm_SyncChangeDir>","TTOTAL_CMD")
+    vim.map("<shift>f","<Search>","TTOTAL_CMD")
+    vim.map("gh","<GotoPreviousDirOther>","TTOTAL_CMD")
+    vim.map("gl","<GotoNextDirOther>","TTOTAL_CMD")
+    vim.map("<shift>vh","<cm_SwitchIgnoreList>","TTOTAL_CMD")
+    vim.map("0","<0>","TTOTAL_CMD")
+    vim.map("1","<1>","TTOTAL_CMD")
+    vim.map("2","<2>","TTOTAL_CMD")
+    vim.map("3","<3>","TTOTAL_CMD")
+    vim.map("4","<4>","TTOTAL_CMD")
+    vim.map("5","<5>","TTOTAL_CMD")
+    vim.map("6","<6>","TTOTAL_CMD")
+    vim.map("7","<7>","TTOTAL_CMD")
+    vim.map("8","<8>","TTOTAL_CMD")
+    vim.map("9","<9>","TTOTAL_CMD")
+    vim.map("k","<up>","TTOTAL_CMD")
+    vim.map("K","<upSelect>","TTOTAL_CMD")
+    vim.map("j","<down>","TTOTAL_CMD")
+    vim.map("J","<downSelect>","TTOTAL_CMD")
+    vim.map("h","<left>","TTOTAL_CMD")
+    vim.map("H","<cm_GotoPreviousDir>","TTOTAL_CMD")
+    vim.map("l","<right>","TTOTAL_CMD")
+    vim.map("L","<cm_GotoNextDir>","TTOTAL_CMD")
+    vim.map("I","<CreateNewFile>","TTOTAL_CMD")
+    vim.map("i","<Insert_Mode_TC>","TTOTAL_CMD")
+    vim.map("d","<cm_DirectoryHotlist>","TTOTAL_CMD")
+    vim.map("D","<cm_OpenDesktop>","TTOTAL_CMD")
+    vim.map("e","<cm_ContextMenu>","TTOTAL_CMD")
+    vim.map("E","<cm_ExeCuteDOS>","TTOTAL_CMD")
+    vim.map("n","<azHistory>","TTOTAL_CMD")
+    vim.map("m","<Mark>","TTOTAL_CMD")
+    vim.map("M","<Half>","TTOTAL_CMD")
+    vim.map("'","<ListMark>","TTOTAL_CMD")
+    vim.map("u","<GoToParentEx>","TTOTAL_CMD")
+    vim.map("U","<cm_GoToRoot>","TTOTAL_CMD")
+    vim.map("o","<cm_LeftOpenDrives>","TTOTAL_CMD")
+    vim.map("O","<cm_RightOpenDrives>","TTOTAL_CMD")
+    vim.map("q","<cm_SrcQuickView>","TTOTAL_CMD")
+    vim.map("r","<cm_RenameOnly>","TTOTAL_CMD")
+    vim.map("R","<cm_MultiRenameFiles>","TTOTAL_CMD")
+    vim.map("x","<cm_Delete>","TTOTAL_CMD")
+    vim.map("X","<ForceDelete>","TTOTAL_CMD")
+    vim.map("w","<cm_List>","TTOTAL_CMD")
+    vim.map("y","<cm_CopyNamesToClip>","TTOTAL_CMD")
+    vim.map("Y","<cm_CopyFullNamesToClip>","TTOTAL_CMD")
+    vim.map("P","<cm_PackFiles>","TTOTAL_CMD")
+    vim.map("p","<cm_UnpackFiles>","TTOTAL_CMD")
+    vim.map("t","<cm_OpenNewTab>","TTOTAL_CMD")
+    vim.map("T","<cm_OpenNewTabBg>","TTOTAL_CMD")
+    vim.map("/","<cm_ShowQuickSearch>","TTOTAL_CMD")
+    vim.map("?","<cm_SearchFor>","TTOTAL_CMD")
+    vim.map("[","<cm_SelectCurrentName>","TTOTAL_CMD")
+    vim.map("{","<cm_UnselectCurrentName>","TTOTAL_CMD")
+    vim.map("]","<cm_SelectCurrentExtension>","TTOTAL_CMD")
+    vim.map("}","<cm_UnSelectCurrentExtension>","TTOTAL_CMD")
+    vim.map("\","<cm_ExchangeSelection>","TTOTAL_CMD")
+    vim.map("|","<cm_ClearAll>","TTOTAL_CMD")
+    vim.map("-","<cm_SwitchSeparateTree>","TTOTAL_CMD")
+    vim.map("=","<cm_MatchSrc>","TTOTAL_CMD")
+    vim.map(";","<cm_FocusCmdLine>","TTOTAL_CMD")
+    vim.map(":","<cm_FocusCmdLine>","TTOTAL_CMD")
+    vim.map("G","<LastLine>","TTOTAL_CMD")
+    vim.map("ga","<cm_CloseAllTabs>","TTOTAL_CMD")
+    vim.map("gg","<GoToLine>","TTOTAL_CMD")
+    vim.map("g$","<LastLine>","TTOTAL_CMD")
+
+    ;与vim保持一致
+    vim.map("gt","<cm_SwitchToNextTab>","TTOTAL_CMD")
+    vim.map("gT","<cm_SwitchToPreviousTab>","TTOTAL_CMD")
+    vim.map("gc","<cm_CloseCurrentTab>","TTOTAL_CMD")
+    vim.map("gb","<cm_OpenDirInNewTabOther>","TTOTAL_CMD")
+    vim.map("ge","<cm_Exchange>","TTOTAL_CMD")
+    vim.map("gw","<cm_ExchangeWithTabs>","TTOTAL_CMD")
+    vim.map("g1","<cm_SrcActivateTab1>","TTOTAL_CMD")
+    vim.map("g2","<cm_SrcActivateTab2>","TTOTAL_CMD")
+    vim.map("g3","<cm_SrcActivateTab3>","TTOTAL_CMD")
+    vim.map("g4","<cm_SrcActivateTab4>","TTOTAL_CMD")
+    vim.map("g5","<cm_SrcActivateTab5>","TTOTAL_CMD")
+    vim.map("g6","<cm_SrcActivateTab6>","TTOTAL_CMD")
+    vim.map("g7","<cm_SrcActivateTab7>","TTOTAL_CMD")
+    vim.map("g8","<cm_SrcActivateTab8>","TTOTAL_CMD")
+    vim.map("g9","<cm_SrcActivateTab9>","TTOTAL_CMD")
+    vim.map("g0","<GoLastTab>","TTOTAL_CMD")
+    vim.map("sn","<cm_SrcByName>","TTOTAL_CMD")
+    vim.map("se","<cm_SrcByExt>","TTOTAL_CMD")
+    vim.map("ss","<cm_SrcBySize>","TTOTAL_CMD")
+    vim.map("sd","<cm_SrcByDateTime>","TTOTAL_CMD")
+    vim.map("sr","<cm_SrcNegOrder>","TTOTAL_CMD")
+    vim.map("s1","<cm_SrcSortByCol1>","TTOTAL_CMD")
+    vim.map("s2","<cm_SrcSortByCol2>","TTOTAL_CMD")
+    vim.map("s3","<cm_SrcSortByCol3>","TTOTAL_CMD")
+    vim.map("s4","<cm_SrcSortByCol4>","TTOTAL_CMD")
+    vim.map("s5","<cm_SrcSortByCol5>","TTOTAL_CMD")
+    vim.map("s6","<cm_SrcSortByCol6>","TTOTAL_CMD")
+    vim.map("s7","<cm_SrcSortByCol7>","TTOTAL_CMD")
+    vim.map("s8","<cm_SrcSortByCol8>","TTOTAL_CMD")
+    vim.map("s9","<cm_SrcSortByCol9>","TTOTAL_CMD")
+    vim.map("s0","<cm_SrcUnsorted>","TTOTAL_CMD")
+    vim.map("v","<cm_SrcCustomViewMenu>","TTOTAL_CMD")
+    vim.map("Vb","<cm_VisButtonbar>","TTOTAL_CMD")
+    vim.map("Vd","<cm_VisDriveButtons>","TTOTAL_CMD")
+    vim.map("Vo","<cm_VisTwoDriveButtons>","TTOTAL_CMD")
+    vim.map("Vr","<cm_VisDriveCombo>","TTOTAL_CMD")
+    vim.map("Vc","<cm_VisDriveCombo>","TTOTAL_CMD")
+    vim.map("Vt","<cm_VisTabHeader>","TTOTAL_CMD")
+    vim.map("Vs","<cm_VisStatusbar>","TTOTAL_CMD")
+    vim.map("Vn","<cm_VisCmdLine>","TTOTAL_CMD")
+    vim.map("Vf","<cm_VisKeyButtons>","TTOTAL_CMD")
+    vim.map("Vw","<cm_VisDirTabs>","TTOTAL_CMD")
+    vim.map("Ve","<cm_CommandBrowser>","TTOTAL_CMD")
+    vim.map("zz","<Toggle_50_100Percent>","TTOTAL_CMD")
+    vim.map("zi","<WinMaxLeft>","TTOTAL_CMD")
+    vim.map("zo","<WinMaxRight>","TTOTAL_CMD")
+    vim.map("zt","<AlwayOnTop>","TTOTAL_CMD")
+    vim.map("zn","<cm_Minimize>","TTOTAL_CMD")
+    vim.map("zm","<cm_Maximize>","TTOTAL_CMD")
+    vim.map("zr","<cm_Restore>","TTOTAL_CMD")
+    vim.map("zv","<cm_VerticalPanels>","TTOTAL_CMD")
+    vim.map("zv","<cm_VerticalPanels>","TTOTAL_CMD")
+    vim.map(".","<Repeat>","TTOTAL_CMD")
+    /*
+    ;vim.map("zs","<TransParent>","TTOTAL_CMD")
+    KeyList := vim.listKey("TTOTAL_CMD")
+    GUI,Add,ListView,w300 h500,a
+    Loop,Parse,KeyList,`n
+    {
+        LV_Add("",A_LoopField)
+    }
+    GUI,Show ,w310 h510
+    */
+    ;; 默认按键完
+    ReadNewFile()
+    GoSub,TCCOMMAND
+return
+
 <TC_0>:
 <TC_1>:
 <TC_2>:

return
; <ToggleTC> {{{1
<ToggleTC>:
	IfWinExist,AHK_CLASS TTOTAL_CMD
	{
		WinGet,AC,MinMax,AHK_CLASS TTOTAL_CMD
		If Ac = -1
			Winactivate,AHK_ClASS TTOTAL_CMD
		Else
		Ifwinnotactive,AHK_CLASS TTOTAL_CMD
			Winactivate,AHK_CLASS TTOTAL_CMD
		Else
			Winminimize,AHK_CLASS TTOTAL_CMD
	}
	Else
	{
		Run,%TCPath%
		Loop,4
		{
			IfWinNotActive,AHK_CLASS TTOTAL_CMD
				WinActivate,AHK_CLASS TTOTAL_CMD
			Else
				Break
			Sleep,500
		}
	}
    ;settimer,AUTHTC,on
	;emptymem()
return

;激活TC
<FocusTC>:
{
	IfWinExist,AHK_CLASS TTOTAL_CMD
		Winactivate,AHK_ClASS TTOTAL_CMD
	Else
	{
		Run,%TCPath%
		Loop,4
		{
			IfWinNotActive,AHK_CLASS TTOTAL_CMD
				WinActivate,AHK_CLASS TTOTAL_CMD
			Else
				Break
			Sleep,500
		}
	}
	return
}

;激活TC，并定位到命令行
<FocusTCCmd>:
{
	gosub,<FocusTC>
	SendPos(4003)
	return
}

AUTHTC:


;<CopyDirectoryHotlist>: >>复制到常用文件夹{{{2
<CopyDirectoryHotlist>:
    ControlGetFocus,CurrentFocus,AHK_CLASS TTOTAL_CMD
    if CurrentFocus not in TMyListBox2,TMyListBox1
        return
    if CurrentFocus in TMyListBox2
        otherlist = TMyListBox1
    else
        otherlist = TMyListBox2
    ControlFocus, %otherlist% ,ahk_class TTOTAL_CMD
    SendPos(526)
    SetTimer WaitMenuPop1
return
WaitMenuPop1:
winget,menupop,,ahk_class #32768
if menupop
    {
        SetTimer, WaitMenuPop1 ,Off
        SetTimer, WaitMenuOff1
    }
return
WaitMenuOff1:
    winget,menupop,,ahk_class #32768
    if not menupop
    {
        SetTimer,WaitMenuOff1, off
        goto, gooncopy
    }
return
gooncopy:
    ControlFocus, %CurrentFocus% ,ahk_class TTOTAL_CMD
    SendPos(3101)
return


;<CopyUseQueues>: >>无需确认，使用队列拷贝文件至另一窗口{{{2
<CopyUseQueues>:
    Send {F5}
    Send {F2}
Return

;<MoveUseQueues>: >>无需确认，使用队列移动文件{{{2
<MoveUseQueues>:
    Send {F6}
    Send {F2}
Return

;<MoveDirectoryHotlist>: >>移动到常用文件夹{{{2
<MoveDirectoryHotlist>:
    If SendPos(0)
        ControlGetFocus,CurrentFocus,AHK_CLASS TTOTAL_CMD
    if CurrentFocus not in TMyListBox2,TMyListBox1
        return
    if CurrentFocus in TMyListBox2
        otherlist = TMyListBox1
    else
        otherlist = TMyListBox2
    ControlFocus, %otherlist% ,ahk_class TTOTAL_CMD
    SendPos(526)
    SetTimer WaitMenuPop2
return
WaitMenuPop2:
    winget,menupop,,ahk_class #32768
    if menupop
    {
        SetTimer, WaitMenuPop2 ,Off
        SetTimer, WaitMenuOff2
    }
return
WaitMenuOff2:
    winget,menupop,,ahk_class #32768
    if not menupop
    {
    SetTimer,WaitMenuOff2, off
    goto, goonmove
    }
return
GoonMove:
    ControlFocus, %CurrentFocus% ,ahk_class TTOTAL_CMD
    SendPos(1005)
return

;<GotoPreviousDirOther>: >>后退另一侧{{{2
<GotoPreviousDirOther>:
    Send {Tab}
    SendPos(570)
    Send {Tab}
Return

;<GotoNextDirOther>: >>前进另一侧{{{2
<GotoNextDirOther>:
    Send {Tab}
    SendPos(571)
    Send {Tab}
Return

<Totalcomander_GUI>:
return

Totalcomander_select_tc:
    Totalcomander_select_tc()
return
Totalcomander_select_tc(){
    GUI,FindTC:Default
    GuiControlGet,dir,,Edit1
    TCPath := dir "\totalcmd.exe"
    TCINI  := dir "\wincmd.ini"
    GUi,FindTC:Destroy
    IniWrite,%TCPath%,%ConfigPath%,TotalCommander_Config,TCPath
    IniWrite,%TCINI%,%ConfigPath%,TotalCommander_Config,TCINI
}
Totalcomander_select_tc64:
    Totalcomander_select_tc64()
return
Totalcomander_select_tc64(){
    GUI,FindTC:Default
    GuiControlGet,dir,,Edit1
    TCPath := dir "\totalcmd64.exe"
    TCINI  := dir "\wincmd.ini"
    GUi,FindTC:Destroy
    IniWrite,%TCPath%,%ConfigPath%,TotalCommander_Config,TCPath
    IniWrite,%TCINI%,%ConfigPath%,TotalCommander_Config,TCINI
}
Totalcomander_select_tcdir:
    Totalcomander_select_tcdir()
return
Totalcomander_select_tcdir(){
    FileSelectFolder,tcdir,,0,打开TC安装目录
    GuiControl,,Edit1,%tcdir%
}

;切换显示比例50%-100%
<Toggle_50_100Percent>:
    ControlGetPos, , , wp,hp, TPanel1, ahk_class TTOTAL_CMD
    ControlGetPos, , , w1, h1, TMyListBox1, ahk_class TTOTAL_CMD
    ControlGetPos, , , w2, h2, TMyListBox2, ahk_class TTOTAL_CMD
    if ( wp  < hp)     ;纵向
        {
        if  ( abs(w1 - w2) > 2  )
            SendPos(909)
        else
            SendPos(910)
        }
    else    ;横向
        {
        if  ( abs(h1 - h2)  > 2  )
            SendPos(909)
        else
            SendPos(910)
        }
    Return
    
;使用外部查看器打开（alt+f3）
<OpenWithAlternateViewer>:
