William Jiang

JavaScript,PHP,Node,Perl,LAMP Web Developer – http://williamjxj.com; https://github.com/williamjxj?tab=repositories

Linux: ksh

ksh: set -o vi

The Korn shell has the ability to utilize vi editor commands to edit commands in your history. If you are a Linux guy, you will never miss this attractive feature.

There are 2 ways to enable vi editing. In $HOME/.bashrc file, append either of the following:

set -o vi

# or:
export EDITOR=vi

This will active the ksh attributes in command line.

Then you can use vi commands. Press escape to enter vi command mode then you have access to many vi commands. For example, k will move up through previous commands in the history, /tail will search for the most recent command containing the word tail and pressing n will find the next occurence of that search term.

Once you have found a command that you want to repeat, just press ENTER and it will be run again. You can edit the command with R to replace characters from your current position, x to delete the current character, i to insert characters before the current character, a append characters after the current character, and $ to move to the end of the command.

I am a Linux guy, to be fairly speaking, using vi, ksh command-line in Linux, is much better/high performance than frenquently ftp (switch between windows and linux server) for the web developing.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: