Presentation is loading. Please wait.

Presentation is loading. Please wait.

VIM  This is the text editor you will use on the workstation.  You can also edit the text files under windows environment and upload it to the workstation.

Similar presentations


Presentation on theme: "VIM  This is the text editor you will use on the workstation.  You can also edit the text files under windows environment and upload it to the workstation."— Presentation transcript:

1

2 VIM  This is the text editor you will use on the workstation.  You can also edit the text files under windows environment and upload it to the workstation using FTP.  It will be a very efficient tool is you are familiar with it.

3 VIM  Basic usage : vim  It will create a new file for you if no such file exists.  You can just type vim a.c to start editing a c source file.

4 VIM  The first thing you have to know about Vim is how to exit it.  :q – leave vim  :q! – leave without saving  :wq – save and leave  You can use :w to save without leave and :w to save in a new name.

5 VIM  Now you can understand that Vim is a monster filled with hotkeys and commands.  Don ’ t be frightened by that, you only needs “ i ”, “ :q! ”, “ :wq ” and “ ESC ” in order to use Vim.  You can press any of the following keys to enter the editing mode: a, i, o, r, A, I, O, R, each has a different function.

6 VIM  Basic operations in Normal mode :  0 / $ – go to the beginning/end of the line.  G / gg – go to the beginning/end of the file.  x / dd – delete a world / a line.  yy /p – copy / paste  u / +r – undo / redo  / / n – search / search next  +v – block choose

7 VIM  You can also use number + command to execute multiple commands.  For example, 2dd deletes 2 lines, 2yy copies 2 lines.  Learn Vim by experience, do not try to recite all of the commands.  You can also download a windows version of Vim

8 Shell Script  Shell script is just like a.bat file in windows, can be used to execute batch works.  Furthermore, you can use if-then, for-loop etc., in your shell script so you can set up some automatic works.  Use sh to execute it. Or You can just use chmod command to make the file executable.

9 Shell Script  All shell script starts with #!/bin bash to specify the shell name.  Other #s beside this line are considered as comment lines.  Spaces and new lines are ignored.  is considered as “ execute ”

10 Shell Script  I won ’ t talk too much about Shell Script here because it will become Unix course.  Let ’ s try a small example. #!/bin/bash #This is the demo bash script echo "We are going to use Vim to open a file." read -p "Please insert the file name: " filename echo "the file name is" $filename", are you sure?(y/n)" read yn if [ $yn == "y" ]; then vim temp/$filename else echo "command failed" fi


Download ppt "VIM  This is the text editor you will use on the workstation.  You can also edit the text files under windows environment and upload it to the workstation."

Similar presentations


Ads by Google