VIMでAutoHotKeyスクリプトファイルの辞書補完を行う

VIMでAutoHotKeyスクリプトファイルの辞書補完を行う方法。

# 辞書ファイルを作成
AutoHotKey(Basic) をインストールしている場合、以下の場所にSyntaxファイルがあるはずです。
`C:\Program Files\AutoHotkey\Extras\Editors\Syntax`

![シンタックスファイルのある場所](https://lh6.googleusercontent.com/-o_nGQdHV1lM/T9ibpTf47vI/AAAAAAAAEOM/qaIg4gLCrF8/s800/2012-06-13_22h36_51.png)

それらをつなぎあわせて、ソートして重複行を削除して、辞書ファイルを作成します。AutoHotKey.dic という名前で保存します。(後述)


# .vimrc の設定

.vimrc に、以下の行を追加します。(パスはご自分の環境に置き換えてください)

```vim:.vimrc
autocmd FileType autohotkey set dictionary+=~/.vim/dict/autohotkey.dic
```

# 使い方

あとは、VIMで.ahk ファイルを読み込み、INSERTモードで <C-x><C-k> を押せば、辞書補完されます。

# 参考

* [辞書ファイルで入力を補完する — 名無しのvim使い](http://nanasi.jp/articles/howto/config/dictionary.html)

# 辞書ファイル

```ahk:autohotkey.dic
#AllowSameLineComments
#ClipboardTimeout
#CommentFlag
#ErrorStdOut
#EscapeChar
#HotkeyInterval
#HotkeyModifierTimeout
#Hotstring
#IfWinActive
#IfWinExist
#IfWinNotActive
#IfWinNotExist
#Include
#IncludeAgain
#InstallKeybdHook
#InstallMouseHook
#KeyHistory
#LTrim
#MaxHotkeysPerInterval
#MaxMem
#MaxThreads
#MaxThreadsBuffer
#MaxThreadsPerHotkey
#NoEnv
#NoTrayIcon
#Persistent
#SingleInstance
#UseHook
#WinActivateForce
Abort
AboveNormal
Abs
ACos
Add
ahk_class
ahk_group
ahk_id
ahk_pid
All
Alnum
Alpha
Alt
AltDown
AltSubmit
AltTab
AltTabAndMenu
AltTabMenu
AltTabMenuDismiss
AltUp
AlwaysOnTop
And
AppsKey
Asc
ASin
ATan
AutoSize
AutoTrim
A_AhkPath
A_AhkVersion
A_AppData
A_AppDataCommon
A_AutoTrim
A_BatchLines
A_CaretX
A_CaretY
A_ComputerName
A_ControlDelay
A_Cursor
A_DD
A_DDD
A_DDDD
A_DefaultMouseSpeed
A_Desktop
A_DesktopCommon
A_DetectHiddenText
A_DetectHiddenWindows
A_EndChar
A_EventInfo
A_ExitReason
A_FormatFloat
A_FormatInteger
A_Gui
A_GuiControl
A_GuiControlEvent
A_GuiEvent
A_GuiHeight
A_GuiWidth
A_GuiX
A_GuiY
A_Hour
A_IconFile
A_IconHidden
A_IconNumber
A_IconTip
A_Index
A_IPAddress1
A_IPAddress2
A_IPAddress3
A_IPAddress4
A_ISAdmin
A_IsCompiled
A_IsCritical
A_IsPaused
A_IsSuspended
A_KeyDelay
A_Language
A_LastError
A_LineFile
A_LineNumber
A_LoopField
A_LoopFileAttrib
A_LoopFileDir
A_LoopFileExt
A_LoopFileFullPath
A_LoopFileLongPath
A_LoopFileName
A_LoopFileShortName
A_LoopFileShortPath
A_LoopFileSize
A_LoopFileSizeKB
A_LoopFileSizeMB
A_LoopFileTimeAccessed
A_LoopFileTimeCreated
A_LoopFileTimeModified
A_LoopReadLine
A_LoopRegKey
A_LoopRegName
A_LoopRegSubkey
A_LoopRegTimeModified
A_LoopRegType
A_MDAY
A_Min
A_MM
A_MMM
A_MMMM
A_Mon
A_MouseDelay
A_MSec
A_MyDocuments
A_Now
A_NowUTC
A_NumBatchLines
A_OSType
A_OSVersion
A_PriorHotkey
A_ProgramFiles
A_Programs
A_ProgramsCommon
A_ScreenHeight
A_ScreenWidth
A_ScriptDir
A_ScriptFullPath
A_ScriptName
A_Sec
A_Space
A_StartMenu
A_StartMenuCommon
A_Startup
A_StartupCommon
A_StringCaseSense
A_Tab
A_Temp
A_ThisFunc
A_ThisHotkey
A_ThisLabel
A_ThisMenu
A_ThisMenuItem
A_ThisMenuItemPos
A_TickCount
A_TimeIdle
A_TimeIdlePhysical
A_TimeSincePriorHotkey
A_TimeSinceThisHotkey
A_TitleMatchMode
A_TitleMatchModeSpeed
A_UserName
A_WDay
A_WinDelay
A_WinDir
A_WorkingDir
A_YDay
A_YEAR
A_YWeek
A_YYYY
Background
BackgroundTrans
BackSpace
BelowNormal
Between
BitAnd
BitNot
BitOr
BitShiftLeft
BitShiftRight
BitXOr
BlockInput
bold
Border
Bottom
Break
Browser_Back
Browser_Favorites
Browser_Forward
Browser_Home
Browser_Refresh
Browser_Search
Browser_Stop
BS
Button
Buttons
ByRef
Cancel
Capacity
CapsLock
Caption
Ceil
Center
Check
Check3
Checkbox
Checked
CheckedGray
Choose
ChooseString
Chr
Click
Clipboard
ClipboardAll
ClipWait
Close
Color
ComboBox
ComSpec
Contains
Continue
Control
ControlClick
ControlFocus
ControlGet
ControlGetFocus
ControlGetPos
ControlGetText
ControlList
ControlMove
ControlSend
ControlSendRaw
ControlSetText
CoordMode
Cos
Count
Critical
Ctrl
CtrlBreak
CtrlDown
CtrlUp
Date
DateTime
Days
DDL
Default
Del
Delete
DeleteAll
Delimiter
Deref
Destroy
DetectHiddenText
DetectHiddenWindows
Digit
Disable
Disabled
DllCall
Down
Drive
DriveGet
DriveSpaceFree
DropDownList
Edit
Eject
Else
Enable
Enabled
End
Enter
EnvAdd
EnvDiv
EnvGet
EnvMult
EnvSet
EnvSub
EnvUpdate
Error
ErrorLevel
Esc
Escape
Exist
Exit
ExitApp
Exp
Expand
ExStyle
F1
F10
F11
F12
F13
F14
F15
F16
F17
F18
F19
F2
F20
F21
F22
F23
F24
F3
F4
F5
F6
F7
F8
F9
False
FileAppend
FileCopy
FileCopyDir
FileCreateDir
FileCreateShortcut
FileDelete
FileExist
FileGetAttrib
FileGetShortcut
FileGetSize
FileGetTime
FileGetVersion
FileInstall
FileMove
FileMoveDir
FileRead
FileReadLine
FileRecycle
FileRecycleEmpty
FileRemoveDir
FileSelectFile
FileSelectFolder
FileSetAttrib
FileSetTime
FileSystem
First
Flash
Float
FloatFast
Floor
Focus
Font
FormatTime
GetKeyState
global
Gosub
Goto
Grid
Group
GroupActivate
GroupAdd
GroupBox
GroupClose
GroupDeactivate
Gui
GuiClose
GuiContextMenu
GuiControl
GuiControlGet
GuiDropFiles
GuiEscape
GuiSize
Hdr
Hidden
Hide
High
HKCC
HKCR
HKCU
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
HKLM
HKU
Home
Hotkey
Hours
HScroll
Icon
IconSmall
ID
IDLast
If
IfEqual
IfExist
IfGreater
IfGreaterOrEqual
IfInString
IfLess
IfLessOrEqual
IfMsgBox
IfNotEqual
IfNotExist
IfNotInString
IfWinActive
IfWinExist
IfWinNotActive
IfWinNotExist
Ignore
IL_Add
IL_Create
IL_Destroy
ImageList
ImageSearch
In
IniDelete
IniRead
IniWrite
Input
InputBox
Ins
Insert
InStr
Integer
IntegerFast
Interrupt
Is
IsFunc
IsLabel
italic
Join
Joy1
Joy10
Joy11
Joy12
Joy13
Joy14
Joy15
Joy16
Joy17
Joy18
Joy19
Joy2
Joy20
Joy21
Joy22
Joy23
Joy24
Joy25
Joy26
Joy27
Joy28
Joy29
Joy3
Joy30
Joy31
Joy32
Joy4
Joy5
Joy6
Joy7
Joy8
Joy9
JoyAxes
JoyButtons
JoyInfo
JoyName
JoyPOV
JoyR
JoyU
JoyV
JoyX
JoyY
JoyZ
KeyHistory
KeyWait
Label
LAlt
LastFound
LastFoundExist
Launch_App1
Launch_App2
Launch_Mail
Launch_Media
LButton
LControl
LCtrl
Left
Limit
Lines
List
ListBox
ListHotkeys
ListLines
ListVars
ListView
Ln
local
Lock
Log
Logoff
Loop
Low
Lower
Lowercase
LShift
LTrim
LV_Add
LV_Delete
LV_DeleteCol
LV_GetCount
LV_GetNext
LV_GetText
LV_Insert
LV_InsertCol
LV_Modify
LV_ModifyCol
LV_SetImageList
LWin
LWinDown
LWinUp
MainWindow
Margin
Maximize
MaximizeBox
MaxSize
MButton
Media_Next
Media_Play_Pause
Media_Prev
Media_Stop
Menu
Minimize
MinimizeBox
MinMax
MinSize
Minutes
Mod
MonthCal
Mouse
MouseClick
MouseClickDrag
MouseGetPos
MouseMove
Move
MsgBox
Multi
NA
No
NoActivate
NoDefault
NoHide
NoIcon
NoMainWindow
norm
Normal
NoSort
NoSortHdr
NoStandard
Not
NoTab
NoTimers
Number
NumGet
NumLock
Numpad0
Numpad1
Numpad2
Numpad3
Numpad4
Numpad5
Numpad6
Numpad7
Numpad8
Numpad9
NumpadAdd
NumpadClear
NumpadDel
NumpadDiv
NumpadDot
NumpadDown
NumpadEnd
NumpadEnter
NumpadHome
NumpadIns
NumpadLeft
NumpadMult
NumpadPgdn
NumpadPgup
NumpadRight
NumpadSub
NumpadUp
NumPut
Off
Ok
On
OnExit
OnMessage
Or
OutputDebug
OwnDialogs
Owner
Parse
Password
Pause
PGDN
PGUP
Pic
Picture
Pixel
PixelGetColor
PixelSearch
Pos
PostMessage
Pow
PrintScreen
Priority
Process
ProcessName
ProgramFiles
Progress
Radio
RAlt
Random
Range
RButton
RControl
RCtrl
Read
ReadOnly
Realtime
Redraw
RegDelete
RegExMatch
RegExReplace
Region
RegisterCallback
RegRead
RegWrite
REG_BINARY
REG_DWORD
REG_EXPAND_SZ
REG_MULTI_SZ
REG_SZ
Relative
Reload
Rename
Repeat
Report
Resize
Restore
Retry
Return
RGB
Right
Round
RShift
RTrim
Run
RunAs
RunWait
RWin
RWinDown
RWinUp
SB_SetIcon
SB_SetParts
SB_SetText
Screen
ScrollLock
Seconds
Section
Send
SendEvent
SendInput
SendMessage
SendMode
SendPlay
SendRaw
Serial
SetBatchLines
SetCapslockState
SetControlDelay
SetDefaultMouseSpeed
SetEnv
SetFormat
SetKeyDelay
SetLabel
SetMouseDelay
SetNumlockState
SetScrollLockState
SetStoreCapslockMode
SetTimer
SetTitleMatchMode
SetWinDelay
SetWorkingDir
Shift
ShiftAltTab
ShiftDown
ShiftUp
Show
Shutdown
Sin
Single
Sleep
Slider
Sort
SortDesc
SoundBeep
SoundGet
SoundGetWaveVolume
SoundPlay
SoundSet
SoundSetWaveVolume
Space
SplashImage
SplashTextOff
SplashTextOn
SplitPath
Sqrt
Standard
static
Status
StatusBar
StatusBarGetText
StatusBarWait
StatusCD
strike
StringCaseSense
StringGetPos
StringLeft
StringLen
StringLower
StringMid
StringReplace
StringRight
StringSplit
StringTrimLeft
StringTrimRight
StringUpper
StrLen
Style
Submit
SubStr
Suspend
SysGet
SysMenu
Tab
Tab2
TabStop
Tan
Text
Theme
Thread
Tile
Time
Tip
ToggleCheck
ToggleEnable
ToolTip
ToolWindow
Top
Topmost
TransColor
Transform
Transparent
Tray
TrayTip
TreeView
True
TryAgain
TV_Add
TV_Delete
TV_Get
TV_GetChild
TV_GetCount
TV_GetNext
TV_GetParent
TV_GetPrev
TV_GetSelection
TV_GetText
TV_Modify
Type
UnCheck
underline
Unicode
Unlock
Up
UpDown
Upper
Uppercase
URLDownloadToFile
UseErrorLevel
VarSetCapacity
Vis
VisFirst
Visible
Volume_Down
Volume_Mute
Volume_Up
VScroll
Wait
WaitClose
WantCtrlA
WantF2
WantReturn
WheelDown
WheelLeft
WheelRight
WheelUp
While
WinActivate
WinActivateBottom
WinActive
WinClose
WinExist
WinGet
WinGetActiveStats
WinGetActiveTitle
WinGetClass
WinGetPos
WinGetText
WinGetTitle
WinHide
WinKill
WinMaximize
WinMenuSelectItem
WinMinimize
WinMinimizeAll
WinMinimizeAllUndo
WinMove
WinRestore
WinSet
WinSetTitle
WinShow
WinWait
WinWaitActive
WinWaitClose
WinWaitNotActive
Wrap
XButton1
XButton2
Xdigit
```