AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

HP-UX vi editor hotkeys

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
sandman



Joined: 10 Aug 2008
Posts: 1

PostPosted: Sun Aug 10, 2008 6:47 pm    Post subject: HP-UX vi editor hotkeys Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group