         winObj  := this.GetWin(this.LastFoundWin)
         modeObj := this.GetMode(this.LastFoundWin)
         act := this.GetAction(modeObj.GetKeyMap(winObj.KeyTemp))
-        If act
+        if act
         {
             winObj.HideMore()
             __vimLastAction := {"LastKey":k, "winName":winName, "ActionName":ActionName, "KeyTemp":winObj.KeyTemp, "Count":winObj.Count}
             act.Do(winObj.Count)
             winObj.Count := 0
             winObj.KeyTemp := ""
-            ; 执行在判断热键后的函数, 如果函数返回True，按普通键输出
-            If IsFunc(f:=winObj.AfterActionDoFunc)
-            {
-                If %f%()
-                Send, % this.Convert2AHK(k, ToSend:=True)
+            ; 执行在判断热键后的函数, 如果函数返回true，按普通键输出
+            if IsFunc(f := winObj.AfterActionDoFunc)
+            {
+                if %f%()
+                Send, % this.Convert2AHK(k, ToSend := true)
             }
             Settimer, Vim_TimeOut, Off
         }
     }
 
     ; Debug(Bold) {{{2
-    Debug(Bold, history=false)
-    {
-        If Bold
+    Debug(Bold, history = false)
+    {
+        if Bold
         {
             this.Debug := new __vimDebug(history)
             this.Debug.var(this)
         }
-        Else
+        else
         {
             GUI, vimDebug:Destroy
             this.Debug := ""
         }
     }
-; TODO Code style
-        ; Convert2VIM(key) {{{2
-        ; 将AHK热键名转换为类VIM的热键名
-        ; 例 Convert2VIM("f1")
-        Convert2VIM(key)
-        {
-            If RegExMatch(key, "^[A-Z]$")
-                return "<S-" this.Upper(key) ">"
-            If RegExMatch(key, "i)^((F1)|(F2)|(F3)|(F4)|(F5)|(F6)|(F7)|(F8)|(F9)|(F10)|(F11)|(F12))$")
-                return "<" key ">"
-            If RegExMatch(key, "i)^((AppsKey)|(Tab)|(Enter)|(Space)|(Home)|(End)|(CapsLock)|(ScroollLock)|(Up)|(Down)|(Left)|(Right)|(PgUp)|(PgDn))$")
-                return "<" key ">"
-            If RegExMatch(key, "i)^((BS)|(BackSpace))$")
-                return "<BS>"
-            If RegExMatch(key, "i)^((Esc)|(Escape))$")
-                return "<Esc>"
-            If RegExMatch(key, "i)^((Ins)|(Insert))$")
-                return "<Insert>"
-            If RegExMatch(key, "i)^((Del)|(Delete))$")
-                return "<Delete>"
-            If RegExMatch(key, "i)^PrintScreen$")
-                return "<PrtSc>"
-            If RegExMatch(key, "i)^shift\s&\s(.*)", m) or RegExMatch(key, "^\+(.*)", m)
-                return "<S-" this.Upper(m1) ">"
-            If RegExMatch(key, "i)^lshift\s&\s(.*)", m) or RegExMatch(key, "^<\+(.*)", m)
-                return "<LS-" this.Upper(m1) ">"
-            If RegExMatch(key, "i)^rshift\s&\s(.*)", m) or RegExMatch(key, "^>\+(.*)", m)
-                return "<RS-" this.Upper(m1) ">"
-            If RegExMatch(key, "i)^Ctrl\s&\s(.*)", m) or RegExMatch(key, "^\^(.*)", m)
-                return "<C-" this.Upper(m1) ">"
-            If RegExMatch(key, "i)^lctrl\s&\s(.*)", m) or RegExMatch(key, "^<\^(.*)", m)
-                return "<LC-" this.Upper(m1) ">"
-            If RegExMatch(key, "i)^rctrl\s&\s(.*)", m) or RegExMatch(key, "^>\^(.*)", m)
-                return "<RC-" this.Upper(m1) ">"
-            If RegExMatch(key, "i)^alt\s&\s(.*)", m) or RegExMatch(key, "^\!(.*)", m)
-                return "<A-" this.Upper(m1) ">"
-            If RegExMatch(key, "i)^lalt\s&\s(.*)", m) or RegExMatch(key, "^<\!(.*)", m)
-                return "<LA-" this.Upper(m1) ">"
-            If RegExMatch(key, "i)^ralt\s&\s(.*)", m) or RegExMatch(key, "^>\!(.*)", m)
-                return "<RA-" this.Upper(m1) ">"
-            If RegExMatch(key, "i)^lwin\s&\s(.*)", m) or RegExMatch(key, "^#(.*)", m)
-                return "<W-" this.Upper(m1) ">"
-            If RegExMatch(key, "i)^alt$")
-                return "<Alt>"
-            If RegExMatch(key, "i)^ctrl$")
-                return "<Ctrl>"
-            If RegExMatch(key, "i)^shift$")
-                return "<Shift>"
-            If RegExMatch(key, "i)^lwin$")
-                return "<Win>"
-            ;If RegExMatch(key, "i)^esc\s&\s(.*)", m)
-            ;    return "<E-" this.Upper(m1) ">"
+
+    ; Convert2VIM(key) {{{2
+    ; 将AHK热键名转换为类VIM的热键名
+    ; 例 Convert2VIM("f1")
+    Convert2VIM(key)
+    {
+        if RegExMatch(key, "^[A-Z]$")
+            return "<S-" this.Upper(key) ">"
+        if RegExMatch(key, "i)^((F1)|(F2)|(F3)|(F4)|(F5)|(F6)|(F7)|(F8)|(F9)|(F10)|(F11)|(F12))$")
+            return "<" key ">"
+        if RegExMatch(key, "i)^((AppsKey)|(Tab)|(Enter)|(Space)|(Home)|(End)|(CapsLock)|(ScroollLock)|(Up)|(Down)|(Left)|(Right)|(PgUp)|(PgDn))$")
+            return "<" key ">"
+        if RegExMatch(key, "i)^((BS)|(BackSpace))$")
+            return "<BS>"
+        if RegExMatch(key, "i)^((Esc)|(Escape))$")
+            return "<Esc>"
+        if RegExMatch(key, "i)^((Ins)|(Insert))$")
+            return "<Insert>"
+        if RegExMatch(key, "i)^((Del)|(Delete))$")
+            return "<Delete>"
+        if RegExMatch(key, "i)^PrintScreen$")
+            return "<PrtSc>"
+        if RegExMatch(key, "i)^shift\s&\s(.*)", m) or RegExMatch(key, "^\+(.*)", m)
+            return "<S-" this.Upper(m1) ">"
+        if RegExMatch(key, "i)^lshift\s&\s(.*)", m) or RegExMatch(key, "^<\+(.*)", m)
+            return "<LS-" this.Upper(m1) ">"
+        if RegExMatch(key, "i)^rshift\s&\s(.*)", m) or RegExMatch(key, "^>\+(.*)", m)
+            return "<RS-" this.Upper(m1) ">"
+        if RegExMatch(key, "i)^Ctrl\s&\s(.*)", m) or RegExMatch(key, "^\^(.*)", m)
+            return "<C-" this.Upper(m1) ">"
+        if RegExMatch(key, "i)^lctrl\s&\s(.*)", m) or RegExMatch(key, "^<\^(.*)", m)
+            return "<LC-" this.Upper(m1) ">"
+        if RegExMatch(key, "i)^rctrl\s&\s(.*)", m) or RegExMatch(key, "^>\^(.*)", m)
+            return "<RC-" this.Upper(m1) ">"
+        if RegExMatch(key, "i)^alt\s&\s(.*)", m) or RegExMatch(key, "^\!(.*)", m)
+            return "<A-" this.Upper(m1) ">"
+        if RegExMatch(key, "i)^lalt\s&\s(.*)", m) or RegExMatch(key, "^<\!(.*)", m)
+            return "<LA-" this.Upper(m1) ">"
+        if RegExMatch(key, "i)^ralt\s&\s(.*)", m) or RegExMatch(key, "^>\!(.*)", m)
+            return "<RA-" this.Upper(m1) ">"
+        if RegExMatch(key, "i)^lwin\s&\s(.*)", m) or RegExMatch(key, "^#(.*)", m)
+            return "<W-" this.Upper(m1) ">"
+        if RegExMatch(key, "i)^alt$")
+            return "<Alt>"
+        if RegExMatch(key, "i)^ctrl$")
+            return "<Ctrl>"
+        if RegExMatch(key, "i)^shift$")
+            return "<Shift>"
+        if RegExMatch(key, "i)^lwin$")
+            return "<Win>"
+        return key
+    }
+
+    Upper(k)
+    {
+        StringUpper, k, k
+        return k
+    }
+
+    ; Convert2AHK(key, ToSend=false) {{{2
+    ; 将类VIM的热键名转换为AHK热键名
+    ; 例 Convert2AHK("<F1>")
+    Convert2AHK(key, ToSend=false)
+    {
+        this.CheckCapsLock(key)
+        if RegExMatch(key, "^<.*>$")
+        {
+            key := SubStr(key, 2, strlen(key)-2)
+            if RegExMatch(key, "i)^((F1)|(F2)|(F3)|(F4)|(F5)|(F6)|(F7)|(F8)|(F9)|(F10)|(F11)|(F12))$")
+                return ToSend ? "{" key "}" : key
+            if RegExMatch(key, "i)^((AppsKey)|(Tab)|(Enter)|(Space)|(Home)|(End)|(CapsLock)|(ScroollLock)|(Up)|(Down)|(Left)|(Right)|(PgUp)|(PgDn)|(BS)|(ESC)|(Insert)|(Delete))$")
+                return ToSend ? "{" key "}" : key
+            if RegExMatch(key, "i)^PrtSc$")
+                return ToSend ? "{PrintScreen}" : "PrintScreen"
+            if RegExMatch(key, "i)^alt$")
+                return ToSend ? "{!}" : "alt"
+            if RegExMatch(key, "i)^ctrl$")
+                return ToSend ? "{^}" : "ctrl"
+            if RegExMatch(key, "i)^shift$")
+                return ToSend ? "{+}" : "shift"
+            if RegExMatch(key, "i)^win$")
+                return ToSend ? "{#}" : "lwin"
+            if RegExMatch(key, "<LT>")
+                return "<"
+            if RegExMatch(key, "<RT>")
+                return ">"
+            if RegExMatch(key, "i)^S\-(.*)", m)
+                return ToSend ? "+" this.CheckToSend(m1) : "+" m1 
+            if RegExMatch(key, "i)^LS\-(.*)", m)
+                return ToSend ? "<+" this.CheckToSend(m1) : "<+" m1
+            if RegExMatch(key, "i)^RS-(.*)", m)
+                return ToSend ? ">+" this.CheckToSend(m1) : ">+" m1
+            if RegExMatch(key, "i)^C\-(.*)", m)
+                return ToSend ? "^" this.CheckToSend(m1) : "^" m1
+            if RegExMatch(key, "i)^LC\-(.*)", m)
+                return ToSend ? "<^" this.CheckToSend(m1) : "<^" m1
+            if RegExMatch(key, "i)^RC\-(.*)", m)
+                return ToSend ? ">^" this.CheckToSend(m1) : ">^" m1
+            if RegExMatch(key, "i)^A\-(.*)", m)
+                return ToSend ? "!" this.CheckToSend(m1) : "!" m1
+            if RegExMatch(key, "i)^LA\-(.*)", m)
+                return ToSend ? "<!" this.CheckToSend(m1) : "<!" m1
+            if RegExMatch(key, "i)^RA\-(.*)", m)
+                return ToSend ? ">!" this.CheckToSend(m1) : ">!" m1
+            if RegExMatch(key, "i)^w\-(.*)", m)
+                return ToSend ? "#" this.CheckToSend(m1) : "#" m1
+        }
+        else
             return key
-        }
-        Upper(k)
-        {
-            StringUpper, k, k
-            return k
-        }
-        ; Convert2AHK(key, ToSend=False) {{{2
-        ; 将类VIM的热键名转换为AHK热键名
-        ; 例 Convert2AHK("<F1>")
-        Convert2AHK(key, ToSend=False)
-        {
-          this.CheckCapsLock(key)
-            If RegExMatch(key, "^<.*>$")    
-            {
-                key := SubStr(key, 2, strlen(key)-2)
-                If RegExMatch(key, "i)^((F1)|(F2)|(F3)|(F4)|(F5)|(F6)|(F7)|(F8)|(F9)|(F10)|(F11)|(F12))$")
-                    return ToSend ? "{" key "}" : key
-                If RegExMatch(key, "i)^((AppsKey)|(Tab)|(Enter)|(Space)|(Home)|(End)|(CapsLock)|(ScroollLock)|(Up)|(Down)|(Left)|(Right)|(PgUp)|(PgDn)|(BS)|(ESC)|(Insert)|(Delete))$")
-                    return ToSend ? "{" key "}" : key
-                If RegExMatch(key, "i)^PrtSc$")
-                    return ToSend ? "{PrintScreen}" : "PrintScreen"
-                If RegExMatch(key, "i)^alt$")
-                    return ToSend ? "{!}" : "alt"
-                If RegExMatch(key, "i)^ctrl$")
-                    return ToSend ? "{^}" : "ctrl"
-                If RegExMatch(key, "i)^shift$")
-                    return ToSend ? "{+}" : "shift"
-                If RegExMatch(key, "i)^win$")
-                    return ToSend ? "{#}" : "lwin"
-                If RegExMatch(key, "<LT>")
-                    return "<"
-                If RegExMatch(key, "<RT>")
-                    return ">"
-                If RegExMatch(key, "i)^S\-(.*)", m)
-                    return ToSend ? "+" this.CheckToSend(m1) : "+" m1 
-                If RegExMatch(key, "i)^LS\-(.*)", m)
-                    return ToSend ? "<+" this.CheckToSend(m1) : "<+" m1
-                If RegExMatch(key, "i)^RS-(.*)", m)
-                    return ToSend ? ">+" this.CheckToSend(m1) : ">+" m1
-                If RegExMatch(key, "i)^C\-(.*)", m)
-                    return ToSend ? "^" this.CheckToSend(m1) : "^" m1
-                If RegExMatch(key, "i)^LC\-(.*)", m)
-                    return ToSend ? "<^" this.CheckToSend(m1) : "<^" m1
-                If RegExMatch(key, "i)^RC\-(.*)", m)
-                    return ToSend ? ">^" this.CheckToSend(m1) : ">^" m1
-                If RegExMatch(key, "i)^A\-(.*)", m)
-                    return ToSend ? "!" this.CheckToSend(m1) : "!" m1
-                If RegExMatch(key, "i)^LA\-(.*)", m)
-                    return ToSend ? "<!" this.CheckToSend(m1) : "<!" m1
-                If RegExMatch(key, "i)^RA\-(.*)", m)
-                    return ToSend ? ">!" this.CheckToSend(m1) : ">!" m1
-                If RegExMatch(key, "i)^w\-(.*)", m)
-                    return ToSend ? "#" this.CheckToSend(m1) : "#" m1
-                ;If RegExMatch(key, "i)^e\-(.*)", m)
-                ;    return ToSend ? "{esc}" this.CheckToSend(m1) : "esc & " m1
-            }
-            Else
-                    return key
-        }
-        CheckToSend(key)
-        {
-            If RegExMatch(key, "i)^((F1)|(F2)|(F3)|(F4)|(F5)|(F6)|(F7)|(F8)|(F9)|(F10)|(F11)|(F12))$")
-                return "{" key "}" 
-            If RegExMatch(key, "i)^((AppsKey)|(Tab)|(Enter)|(Space)|(Home)|(End)|(CapsLock)|(ScroollLock)|(Up)|(Down)|(Left)|(Right)|(PgUp)|(PgDn)|(BS)|(ESC)|(Insert)|(Delete))$")
-                return "{" key "}"
-            If RegExMatch(key, "i)^PrtSc$")
-                return "{PrintScreen}"
-            If RegExMatch(key, "i)^alt$")
-                return "{!}"
-            If RegExMatch(key, "i)^ctrl$")
-                return "{^}"
-            If RegExMatch(key, "i)^shift$")
-                return "{+}"
-            If RegExMatch(key, "i)^win$")
-                return "{#}"
-            If RegExMatch(key, "<LT>")
-                return "<"
-            If RegExMatch(key, "<RT>")
-                return ">"
-      Return Key
-        }
-        ; CheckCapsLock(key) {{{2
-        ; 检测CapsLock是否按下，返回对应的值
-        ; key 的值为类VIM键，如 CheckCapsLock("<S-A>")
-        CheckCapsLock(key)
-        {
-            If GetKeyState("CapsLock", "T")
-            {
-                If RegExMatch(key, "^[a-z]$")
-                    return "<S-" key ">"
-                If RegExMatch(key, "i)^<S\-([a-zA-Z])>", m)
-        {
-          StringLower, key, m1
-                    return key 
-        }
-            }
-            return key
-        }
-        ToMatch(v)
-        {
-            v := RegExReplace(v , "\+|\?|\.|\*|\{|\}|\(|\)|\||\^|\$|\[|\]|\\", "\$0")
-           Return RegExReplace(v , "\s", "\s")
-        }
+    }
+
+    CheckToSend(key)
+    {
+        if RegExMatch(key, "i)^((F1)|(F2)|(F3)|(F4)|(F5)|(F6)|(F7)|(F8)|(F9)|(F10)|(F11)|(F12))$")
+            return "{" key "}" 
+        if RegExMatch(key, "i)^((AppsKey)|(Tab)|(Enter)|(Space)|(Home)|(End)|(CapsLock)|(ScroollLock)|(Up)|(Down)|(Left)|(Right)|(PgUp)|(PgDn)|(BS)|(ESC)|(Insert)|(Delete))$")
+            return "{" key "}"
+        if RegExMatch(key, "i)^PrtSc$")
+            return "{PrintScreen}"
+        if RegExMatch(key, "i)^alt$")
+            return "{!}"
+        if RegExMatch(key, "i)^ctrl$")
+            return "{^}"
+        if RegExMatch(key, "i)^shift$")
+            return "{+}"
+        if RegExMatch(key, "i)^win$")
+            return "{#}"
+        if RegExMatch(key, "<LT>")
+            return "<"
+        if RegExMatch(key, "<RT>")
+            return ">"
+        return Key
+    }
+
+    ; CheckCapsLock(key) {{{2
+    ; 检测CapsLock是否按下，返回对应的值
+    ; key 的值为类VIM键，如 CheckCapsLock("<S-A>")
+    CheckCapsLock(key)
+    {
+        if GetKeyState("CapsLock", "T")
+        {
+            if RegExMatch(key, "^[a-z]$")
+                return "<S-" key ">"
+            if RegExMatch(key, "i)^<S\-([a-zA-Z])>", m)
+            {
+                StringLower, key, m1
+                return key 
+            }
+        }
+        return key
+    }
+
+    ToMatch(v)
+    {
+        v := RegExReplace(v , "\+|\?|\.|\*|\{|\}|\(|\)|\||\^|\$|\[|\]|\\", "\$0")
+        return RegExReplace(v , "\s", "\s")
+    }
 }
+
 ; Class __win {{{1
 Class __win 
 {
-    __new(class="", filepath="", title=""){
+    __new(class = "", filepath = "", title = "")
+    {
         this.class     := class
         this.filepath  := filepath
         this.title     := title
         this.KeyList   := []
         this.SuperKeyList   := []
         this.modeList  := []
-        this.Status    := True
+        this.Status    := true
         this.mode      := ""
         this.LastKey   := ""
         this.KeyTemp   := ""

        this.WinInfo    := []
        this.ActionList := []
        this.ActionFromPlugin := []
        this.ExcludeWinList :=[]
        this.winGlobal  := new __win
        this.ErrorCode  := 0
        tihs.ActionFromPluginName := ""


        winObj := This.GetWin(winName)
        modeObj := this.GetMode(winName)
        Class := winObj.class
        filepath := winObj.filepath
        if winName
        {
            if strlen(filepath)
                Hotkey, IfWinActive, ahk_exe %filepath%
            else
                Hotkey, IfWinActive, ahk_class %class%
        }
        else
            Hotkey, IfWinActive
        keyName := RegExReplace(keyName, "i)<nowait>", "", nowait)
        keyName := RegExReplace(keyName, "i)<super>", "", super)
