1 / 9

Vim Editor and Unix Command gcc compiler

Vim Editor and Unix Command gcc compiler. Computer Networks. 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.

Télécharger la présentation

Vim Editor and Unix Command gcc compiler

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Vim Editor and Unix Command gcc compiler Computer Networks

  2. 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: http://linux.vbird.org/linux_basic/0310vi.php

  3. 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

  4. Vim – environment setting • After typing vim .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/0310vi.php#vim_set

  5. 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 • If you don’t want to save the file , enter q!

  6. gcc compiler • gcc is a c compiler to compile the code you develop. • There are 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

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

  8. 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.

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

More Related