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.

Slides:



Advertisements
Similar presentations
In the last Session… ls -l command seven fields nine permissions of a file ls -ld file ownership file permissions (three-tiered file protection system)
Advertisements

CS 497C – Introduction to UNIX Lecture 8: The vi/vim Editor Chin-Chih Chang
EDIT MODE The HAAS Control Series PRESS THREE TIMES TO GET TO THIS PAGE (Continued on next slide) Note: SLIDE LEGEND ACTIONS INSTRUCTIONS KEYS INFORMATION.
A Guide to Unix Using Linux Fourth Edition
Introduction to the gedit editor. gedit: the Gnome editor Gnome: Gnome is a freely available (i.e., no cost) desktop environment for the UNIX system The.
Editing with vi Or more fun than you thought you’d have without a mouse Prof. Chris GauthierDickey.
Program Development Tools IDE vs point tools Two tool flavors exist for developing embedded software: -IDEs: (Integrated Development Environments) i.e.,
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
VIM: The basics Tang Wai-Chung, Matthew (MaFai) 29/12/2006.
Working Environment - - Linux - -.
Vi Editor TA for ITIS3100: Xu Fei
Chapter 5 Editing Text Files
CS 202 Computer Science II Lab Fall 2009 September 3.
1 Using Editors Editors let you create and edit ASCII files UNIX normally includes two editors: vi and Emacs Vi and Emacs are screen editors: they display.
Starting Vi Opening an existing file vi filename Creating a new file vi filename In your workshop directory, create a new file called mysong vi mysong.
CSCI 330 T HE UNIX S YSTEM Editing files. E DITOR C ONCEPTS Editing a file is to modify the content of a file Text editor: Enter and modify text in a.
Using Linux Text Editors. Use Non-Graphical Linux Text Editors Graphical Text Editor.
1 Unix Editors (ee, ed, ex, vi, vim) and Compilers (g77, gcc) Speaker: Li-Wen Chen Date:
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Chapter 3 Mastering Editors
Grades Please hand in your homework Quizzes coming back today Current grade on back with missing assignments Anything missing can be turned in late There.
Vi editor Pronounced: `vee eye‘’. Agenda Describe the background of vi Editor Use vi editor to: create text files edit text files Our Goal is to create.
Vim Editor and Unix Command gcc compiler Computer Networks.
Carnegie Mellon Linux Boot Camp Jenna MacCarley, Peter Pearson, Shashank Goyal 9/19/2015.
Introduction to Vim Robbie CSCI2100 Data Structures Tutorial 3.
Shell Programming Any command or a sequence of UNIX commands stored in a text file is called a shell program. It is common to call this file a command.
1 Lab 2 “Hello world” in Unix/Linux #include "std_lib_facilities_4.h" int main(){ cout
How to Create a Document in Google Drive By Tressa Beckler.
Text editors Why should I use an editor ? It is very important to able to use at least one text mode editor a text mode editor is so useful on remote machines.
Tony Kombol.  Why text edit?  Many programs and features require configuration ▪ Configuration is kept in files ▪ Usually in the /etc directory  Changes.
Unix Session IV.
Introduction to Unix – CS 21 Lecture 7. Lecture Overview Regular expressions revisited emacs versus vi Basic emacs and vi usage.
Text Editing February 2 nd, 2004 Class Meeting 3.
Chapter Three Text Editing1 System Programming Text Editing.
Chapter 2. Getting Started 컴퓨터 실험 1 Archi & Net 연구실 이광포.
VI EDITOR University of Mississippi. Vi Editor What is Vi ? ▫Vi is a screen based editor. ▫The screen of your terminal will act as a window into the file.
Chapter 9 Using Text Editors. vi Editor visual Editor, ASCII text editor, no formatting capabilities almost as powerful as MS Word, has 26 clipboards.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
Introduction to Unix (CA263) File Editing By Tariq Ibn Aziz.
Lesson 4-Mastering the Visual Editor. Overview Introducing the visual editor. Working in an existing file with vi. Understanding the visual editor. Navigating.
Chapter Three The UNIX Editors.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
Executable scripts. So far We have made scripts echo hello #for example And called it hello.sh Run it as sh hello.sh This only works from current directory?
Text editing and more basic commands CS 2204 Class meeting 3 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Vi editor Pronounced: `vee eye‘’. Agenda Describe the background of vi Editor Use vi editor to: create text files edit text files Our Goal is to create.
THE C PROGRAMMING ENVIRONMENT. Four parts of C environment  Main menu  Editor status line and edit window  Compiler message window  “Hot Keys” quick.
Shell Script Reference: Linux Shell Scripting Tutorial v1.05r3 A Beginner's handbook
CS:414 introduction to Unix and Linux
Development Environment Basics
Department of Computer Engineering
Vim basics Vi IMproved.
Vi Editor.
Vim.
Vi Introduction Tony Kombol.
Linux 104 Training Module File Editing.
IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Technical University of Kosice
Text Editors Vim (Chapter 6) Emacs (Chapter 7)
The Linux Command Line Chapter 12
Basic gvim commands.
Emacs CSC 135.
The Linux Command Line Chapter 24
Chapter 2 Basic vi Editor.
Linux Operations and Administration
Lab 7 Shell Script Reference:
CSCI The UNIX System Editing files
Day 5 Emacs Editor David A. Gaitros Department of Computer Science
The Linux Command Line Chapter 12
The Linux Command Line Chapter 24
Presentation transcript:

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.

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.

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.

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.

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

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

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.

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 ”

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