Monday, August 23, 2010

Working with 'vi' editor

People who use Linux/Unix as their OS should have used the vi editor. This editor is more powerful editor I've seen ever. I'm here with listing some basic & important 'vi' commands which needed to do file manipulation/editing.

Save & Exit:

:x --> quit vi, writing out modified file to file named in original invocation
:x --> quit vi, writing out modified file to file named in original invocation
:wq --> quit vi, writing out modified file to file named in original invocation
:q --> quit (or exit) vi
:q! --> quit vi even though latest changes have not been saved for this vi call

Screen manipulation:

^f -->move forward one screen
^b -->move backward one screen
^d -->move down (forward) one half screen
^u -->move up (back) one half screen

Working with Multiple files:

To open multiple files:

$vi main.pl maintenance.pl

To hop between them:

:n --> Next file
:prev --> Previous file
:args --> To see which are the files open.

Tuesday, August 17, 2010

Ctrl+V for Pasting in the Windows Command Prompt

1. Install AutoHotkey

2. Save the following code as PasteCommandPrompt.ahk

#IfWinActive ahk_class ConsoleWindowClass
^V::
SendInput {Raw}%clipboard%
return
#IfWinActive



3. Double click PasteCommandPrompt.ahk file. Now you all set. You can apply Ctrl + V in command window.