Vim Editor and Unix Command gcc compiler Computer

  • Slides: 9
Download presentation
Vim Editor and Unix Command gcc compiler Computer Networks

Vim Editor and Unix Command gcc compiler Computer Networks

Vim �Vim is a Editor installed in almost every version of the unix-like OS.

Vim �Vim is a Editor installed in almost every version of the unix-like OS. �There are three mode in Vim: Normal, Edit, Command. �This overview will cover the simple use of Vim like open file, editing, saving, abort the editing. �If you want to know more , you can reference:

Vim – environment setting �Vim can mark the syntax in different colors, which can

Vim – environment setting �Vim can mark the syntax in different colors, which can enhance the efficiency of developing programs dramatically. �You can set the custom color scheme or cursor line in. vimrc file. �cd ~ �vim . vimrc

Vim – environment setting �After typing vimrc , you’ll be able to edit the.

Vim – environment setting �After typing vimrc , you’ll be able to edit the. vimrc file (if you don’t have one before, the system will create one for you). �If you want the default color scheme , just type “syntax on” in the file and then save the file. �If you want more custom setting, you can reference here : �http: //linux. vbird. org/linux_basic/0310 vi. php #vim_set

Vim – file open and save �If you want to save or abort the

Vim – file open and save �If you want to save or abort the editing , you have to enter the command mode of the Vim. �If you’re in edit mode , press ESC and then “shift+: ” �If you want to save the file , enter wq you don’t want to save the file , enter q!

gcc compiler �gcc is a c compiler to compile the code you develop. �There

gcc compiler �gcc is a c compiler to compile the code you develop. �There a few flags need to take care when you compile code. �If you use the pthread in your server, remermber to add –lpthread after your gcc command. �Ex: gcc –lpthread server. c

gcc compiler �You can also assign the name of executable file by –o flags

gcc compiler �You can also assign the name of executable file by –o flags �Ex. gcc –o server. c

UNIX Command �pwd : show the location you're �ls: list all the file in

UNIX Command �pwd : show the location you're �ls: list all the file in the current directory �mv [filename] [path] : move the file to the given path �cp [filename] [path] : copy the file to the given path. �mkdir [path] : create a sub directory at the current directory.

UNIX Command �cd path : change the current location to given path �Ex: cd

UNIX Command �cd path : change the current location to given path �Ex: cd test. Dir , �Note: � 1. cd . . means go back to the parent directory � 2. cd ~ means go to home directory