Skip to content

Instantly share code, notes, and snippets.

@cryks
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cryks/a3148c36624576138b25 to your computer and use it in GitHub Desktop.
Save cryks/a3148c36624576138b25 to your computer and use it in GitHub Desktop.
LeftDiamond := False
AltTab := False
RightDiamond := False
Vim := False
VimRepeat := 0
;; 不慮の事態に備えて起動時/リロード時に Windows キーを解放
Send, {LWin up}
Return
#UseHook
#InstallKeybdHook
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Majestouch Minila 風設定
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
vkc0sc029::BS ; ` => BS
Delete::vkdcsc02b ; Delete => \
vkdcsc02b::vkc0sc029 ; \ => `
RAlt::Delete ; Delete が行き場を失ったので Right Alt に割当
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Global Application Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; A5:SQL Mk-2
#If WinActive("ahk_class TfrmSqlEx")
^l::Send, {F4}
#If
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Left <> combination
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
*vkebsc07b::
LeftDiamond := True
Return
*vkebsc07b up::
LeftDiamond := False
If (AltTab) {
AltTab := False
Send, {Alt up}
}
Return
#If LeftDiamond
+Esc::
LeftDiamond := False
Run rundll32.exe user32.dll`,LockWorkStation
Return
vkc0sc029::winset, alwaysontop, toggle, A
z::Send, {LWin}
2::Send, {F2}
4::Send, !{F4}
^r::Send, {F5}
; うまく動いてくれない Alt+Tab もどき
Tab::
/*
if (!AltTab) {
Send, {Alt down}
}
Send, {Blind}{Tab}
AltTab := True
*/
Return
0::Home
vkbdsc00c::End
h::Left
j::Down
k::Up
l::Right
n::Down
p::Up
#If (LeftDiamond or Vim) and WinActive("ahk_class Chrome_WidgetWin_1")
,::Send, ^+{Tab}
.::Send, ^{Tab}
#If LeftDiamond and WinActive("ahk_class ckWindowClass")
; ck terminal 用設定
o::Ins
,::Send, +{PgUp}
.::Send, +{PgDn}
#If ;; EndIf LeftDiamond
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Right <> combination
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
*vkffsc079::
RightDiamond := True
Return
*vkffsc079 up::
RightDiamond := False
Return
#If RightDiamond
#If RightDiamond and WinActive("ahk_class Chrome_WidgetWin_1")
1::Send, {Up}{Up}{Down}{Down}{Left}{Right}{Left}{Right}ba
#If ;; EndIf RightDiamond
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Vim mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
VimEnter()
{
global
ToolTip, Vim Mode, 0, 0
Vim := True
VimRepeat := 0
}
VimLeave()
{
global
ToolTip
Vim := False
}
SwitchVim()
{
global
if (Vim) {
VimLeave()
} else {
VimEnter()
}
}
VimEscape()
{
global
VimRepeat := 0
}
VimMoveCursor(key)
{
global
if (VimRepeat = 0) {
VimRepeat := 1
}
if (VimRepeat > 1000) {
VimRepeat := 1000
}
Loop, %VimRepeat% {
Send, {%key%}
}
VimRepeat := 0
}
#If LeftDiamond
q::SwitchVim()
#If RightDiamond
p::SwitchVim()
#If Vim
1::
2::
3::
4::
5::
6::
7::
8::
9::
VimRepeat := VimRepeat * 10 + A_ThisHotkey
Return
#If Vim and (VimRepeat > 0)
0::
VimRepeat := VimRepeat * 10 + A_ThisHotkey
Return
#If Vim and (VimRepeat == 0)
0::Send, {Home}
#If Vim
Esc::VimEscape()
+4::Send, {End}
a::Return
b::Send, {PgUp}
c::Return
d::Return
e::Return
f::Send, {PgDn}
g::Return
h::VimMoveCursor("Left")
i::Return
j::VimMoveCursor("Down")
k::VimMoveCursor("Up")
l::VimMoveCursor("Right")
m::Return
n::Return
o::Return
p::Return
q::Return
r::Return
s::Return
t::Return
u::Return
v::Return
w::Return
x::Return
y::Return
z::Return
[::Up
vkbasc027::Left
'::Right
/::Down
#If ;; EndIf Vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment