     ;vifm - just run
     +#e::
     {
-        Run, %CygPath%\bin\mintty.exe --window max --class "Vifm" --exec /bin/zsh -l -i -c vifm, %CygPath%/bin
-        return
-    }
+        Run(CygPath . "\\bin\\mintty.exe --window max --class Vifm --exec /bin/zsh -l -i -c vifm", CygPath . "/bin")
+        return
+    }
+#If
 
 ;browser
 #If FileExist(BrowserPath)
     ;web browser - activate/run
     ^!;::
-        if WinExist("Mozilla Firefox")
-        {
-            WinShow
-            WinActivate
-            Send, !d
-        }
-        else if WinExist("Vimperator")
-        {
-            WinShow
-            WinActivate
-            Send, !d
-        }
-        else if WinExist("ahk_class Chrome_WidgetWin_1")
-        {
-            WinActivate
-            ControlFocus, Chrome_OmniboxView1
-            SendInput, {Home}+{End}
-        }
-        else
-        {
-            IfExist %BrowserPath%
-                Run, %BrowserPath%
-        }
-        return
+        if WinExist("Mozilla Firefox") {
+            WinShow
+            WinActivate
+            ;Send("!d")
+        } else if WinExist("Vimperator") {
+            WinShow
+            WinActivate
+            ;Send("!d")
+        } else if WinExist("ahk_class Chrome_WidgetWin_1") {
+            WinActivate
+            ControlFocus("Chrome_OmniboxView1")
+            ;SendInput("{Home}+{End}")
+        } else {
+            if FileExist(BrowserPath) {
+                Run(BrowserPath)
+            }
+        }
+        return
+#If
 
 ;adobe products
 #IfWinActive ahk_group adobe
     ~LAlt::return
-    LAlt UP::Send {Escape}
+    LAlt UP::Send("{Escape}")
 #IfWinActive
 #IfWinActive ahk_class illustrator
 +wheelup::
-    send {Ctrl Down}{=}{Ctrl Up}
+    Send("{Ctrl Down}{=}{Ctrl Up}")
     return
 +wheeldown::
-    send {Ctrl Down}-{Ctrl Up}
+    Send("{Ctrl Down}-{Ctrl Up}")
     return
 #IfWinActive
 
 ;close active window
 #q::
-    ActiveHwnd := WinExist("A")
+{
+    active_hwnd := WinExist("A")
     WinClose
     return
+}
 
 ;fullscreen
 #f::
-    WinGet MX, MinMax, A
-    if MX
-        WinRestore A
-    else
-        WinMaximize A
-    return
+{
+    if WinGetMinMax("A") {
+        WinRestore("A")
+    } else {
+        WinMaximize("A")
+    }
+    return
+}
 
 ;restore active window
 #s::
-    ActiveHwnd := WinExist("A")
-    PostMessage 0x112, 0xf120 ;WM_SYSCOMMAND, SC_RESTORE
-    return
+{
+    active_hwnd := WinExist("A")
+    PostMessage(0x112, 0xf120) ;WM_SYSCOMMAND, SC_RESTORE
+    return
+}
 
 ;minimize active window
 #w::
-    if WinActive("WTW$")
-    {
+{
+    if WinActive("WTW$") {
         WinHide
-    }
-    else if WinActive("Buddy List")
-    {
+    } else if WinActive("Buddy List") {
         WinHide
-    }
-    else
-    {
-        ActiveHwnd := WinExist("A")
-        PostMessage 0x112, 0xF020 ;WM_SYSCOMMAND, SC_MINIMIZE
-    }
-    return
+    } else {
+        active_hwnd := WinExist("A")
+        PostMessage(0x112, 0xF020) ;WM_SYSCOMMAND, SC_MINIMIZE
+    }
+    return
+}
 
 ;set active window as always on top
-#a::WinSet, AlwaysOnTop, Toggle, A
+#a::WinSetAlwaysOnTop("Toggle", "A")
 
 ;transparency
 AddTransparency(delta)
 {
-    WinGet, Transparency, Transparent, A
-    if ! Transparency
-        Transparency = 255
-    Transparency := Transparency + delta
-    if Transparency <= 10
-    {
-        WinSet, Transparent, 10, A
-    }
-    else if Transparency >= 255
-    {
-        WinSet, Transparent, 255, A
-        WinSet, Transparent, OFF, A
-    }
-    else
-    {
-        WinSet, Transparent, %Transparency%, A
-    }
-    return
+    transparency := WinGetTransparent("A")
+    if !transparency {
+        transparency := 255
+    }
+    transparency := transparency + delta
+    if transparency <= 10 {
+        WinSetTransparent(10, "A")
+    } else if Transparency >= 255 {
+        WinSetTransparent(255, "A")
+        WinSetTransparent("OFF", "A")
+    } else {
+        WinSetTransparent(transparency, "A")
+    }
 }
 #WheelUp::AddTransparency(12)
 #WheelDown::AddTransparency(-12)

+#z::AddTransparency(12)

;music
#x::Send {Volume_Up}
+#x::Volume_Down
#c::Send {Media_Next}
+#c::Media_Prev
#v::Send {Media_Play_Pause}

;screenshots
+#i::Run, %CygPath%\bin\zsh.exe -i -l -c 'shot -w -i --output=Z:/', , Hide
#i::Run, %CygPath%\bin\zsh.exe -i -l -c 'shot -i --output=Z:/', , Hide

;reload autohotkey
!F12::Reload

RAlt & -::
    if GetKeyState("Shift") {
        Send {U+2014}
    } else {
        Send {U+2013}
    }
    return
RAlt & k::Send {U+2026}
RAlt & =::Send {U+0304}

#n::
{
    SetFormat, Integer, H
    Locale1=0x4150415
    Locale2=0x4110411
    WinGet, WinID,, A
    ThreadID:=DllCall("GetWindowThreadProcessId", "Int", WinID, "Int", "0")
    InputLocaleID:=DllCall("GetKeyboardLayout", "Int", ThreadID)
    if(InputLocaleID=Locale1)
        SendMessage, 0x50,, % Locale2,, A
    else if(InputLocaleID=Locale2)
        SendMessage, 0x50,, % Locale1,, A
    return
}

    ;vifm - activate/run
    #e::
    {
        If WinExist("ahk_class Vifm") {
            WinShow
            WinActivate
        } else {
            Run(CygPath . "\\bin\\mintty.exe --window max --class Vifm --exec /bin/zsh -l -i -c vifm", CygPath . "/bin")
            WinWait("ahk_class Vifm")
        }
        return
    }
