sandman
Joined: 10 Aug 2008 Posts: 1
|
Posted: Sun Aug 10, 2008 6:47 pm Post subject: HP-UX vi editor hotkeys |
|
|
| Code: |
; AutoHotkey Version: 1.0.47.06
; Language: English
; Platform: WinXP
; Script Purpose:
; Make old HP-UX vi editor more Windows like
; Script Function:
; Activate keyboard navigation and editing keys. Use Notepad commands to exit editor
; Use keys Home, ctrl-Home, End, ctrl-End, Insert, Delete (PgUp PgDn already work, even in Insert mode)
; ctrl-c and ctrl-v will copy and paste a line
; Use alt-s to Save and Exit, alt-x to Exit without saving
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode 2 ; Match true if word exists in window title.
setkeydelay 200 ; Ensures operation over slower connections.
#IfWinActive PuTTY ; Below hotkeys only function when Putty window is active. Change to title of emulator in use.
; Navigation - Leading escape exits input mode to avoid key disrupting input.
Home::Send {esc}0 ; Zero sends cursor to start of line in vi editor.
^Home::Send {esc}H ; Control-Home to top of file.
End::Send {esc}$ ; Go to end of line.
^End::Send {esc}G ; Control-End sends capital G to vi editor to go to end of file
; Editing
Insert::Send a ; Enter insert mode, insert after cursor position.
Delete::send x ; Delete character cursor is on.
^c::Send yy ; Copy current line to buffer (clipboard).
^v::Send p ; Paste from buffer to line after current line.
; Exit Editor commands
!s::Send {ESC}:wq{enter} ; Escape to ensure in vi editor command mode, then save changes and exit (write and quit).
!x::Send {ESC}:q!{enter} ; Exit vi editor without making changes. |
|
|