VIM: The basics Tang Wai-Chung, Matthew (MaFai) 29/12/2006.

Slides:



Advertisements
Similar presentations
A Guide to Unix Using Linux Fourth Edition
Advertisements

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.
Vi Editor TA for ITIS3100: Xu Fei
Chapter 5 Editing Text Files
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.
Editing Java programs with the BlueJ IDE. Working environments to develop (= write) programs There are 2 ways to develop (write) computer programs: 1.Using.
Word processing June 2013.
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
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
More on Linux - vi Opening Discussion zWhat did we talk about last class? zYou will use the command line a lot in this course. So lets review.
T HE VI EDITOR. vi has 2 modes: command mode (initial or "default" mode) insert mode [Esc] is used to switch to command mode. In general, vi commands:
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 7 Editing.
Microsoft Word 2000 Presentation 2 Microsoft Word Topics  Tools –Spelling/Grammar Check –Thesaurus –AutoCorrect –Word Count –Change Case –Background.
Introduction to Vim Robbie CSCI2100 Data Structures Tutorial 3.
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.
Introduction to Unix – CS 21 Lecture 8. Lecture Overview More detail on emacs and vi Regular expression matching in emacs and vi.
How to Create a Document in Google Drive By Tressa Beckler.
UNIX Intro vi  vi is the standard UNIX text editor v Contents 1.Why use vi ? 2. vi Basics 3.Moving Around 4.Inserting Text.
4 Editing files and Emacs Editing files The Emacs editor.
Chapter 5 Editing Text Files. Basic Concept A text editor works on a file buffer that is a memory copy of a disk file The disk file is not updated until.
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.
Chapter Three Text Editing1 System Programming Text Editing.
Unix Environment Input Output 2  List Content (ls) ◦ ls (list current directory) ◦ ls –all (include hidden files/folders)  Make directory (mkdir) ◦
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.
Review: File Management Part 2: Formatting Text Part 3: Tools
Chapter 9 Using Text Editors. vi Editor visual Editor, ASCII text editor, no formatting capabilities almost as powerful as MS Word, has 26 clipboards.
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.
Linux Class #03. File Access Permissions Types of users in Linux: Local User (u) Group User (g) Other User (o) Each User can have 3 types of permissions:
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
Agenda Using vi Editor Starting vi Session Command / Input Modes Entering Text Editing Text Saving Edited File Aborting Editing Session.
Agenda Using vi Editor Starting vi Session Command / Input Modes
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.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop III - Part A Shell Commands Professional Training.
Linux Working with files Saleh Khazaei
BIF703 FTP (File Transfer Protocol) Utility vi editor Utility.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 14 – UNIX vi text editor.
Microsoft Word 2000 Presentation 3 Microsoft Word Topics Wizards –Letters –Envelopes and Labels Quick Navigation of Documents –Keyboard short-cuts Editing.
Purdue Linux Users Group Presents Linux 201: Session 1 Everything you ever wanted to do in VIM Thor Smith.
Vim basics Vi IMproved.
Using Vi(m) This presentation on using the Vi(m) editor will cover:
Guide To UNIX Using Linux Third Edition
Vi Editor.
Vim.
Vi Introduction Tony Kombol.
Linux 104 Training Module File Editing.
Lecture 3 More on editors: emacs and vi COP 3344 Introduction to UNIX.
IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Technical University of Kosice
GETTING TO KNOW YOUR KEYBOARD
Text Editors Vim (Chapter 6) Emacs (Chapter 7)
The Linux Command Line Chapter 12
Emacs CSC 135.
Chapter 2 Basic vi Editor.
Linux Operations and Administration
The Emacs Editor Read: Forouzan, Appendix C
CSCI The UNIX System Editing files
In the last class… The vi basics command, input and ex mode
Day 5 Emacs Editor David A. Gaitros Department of Computer Science
The Linux Command Line Chapter 12
Presentation transcript:

VIM: The basics Tang Wai-Chung, Matthew (MaFai) 29/12/2006

Contents Why VIM? Basic Editing Searching Copy & Paste Programmers’ Tools Configuration

Why VIM? VIM is one of the most powerful text editor in which you can enter the most letters with less number of keystrokes. Reader’s Choice of “Linux Journel” in Highly configuarable Strong support community, including me.

Modes in VIM In normal mode of VIM, you issue commands instead of inserting letters. You can enter to insert mode by pressing,,, etc.. Insert mode, you can type as you do in notepad. Return to normal mode by pressing Visual mode will be explained later.

Move around You can use cursor keys or = left; = right; = down; = up = up half page = down half page = back 1 page = forward 1 page

Move around (cont...) : end of line; : beginning of line; : first position. : go to line {no} : beginning of file : end of file

To Insert Mode... : insert at current position. : insert ONE letter after current position. : insert at beginning of line. : insert at end of line. : insert in a new line down. : insert in a new line up.

Save & Quit : write file and exit (time to sleep!) : save with same name : quit : save and quit When you add ‘!’ at the end of w or q, you force to execute the command. : save as.

Deleting... Undo / Redo : delete 1 object of {type} : delete a line : delete one word : delete one letter = : change 1 object : substitute 1 object : undo : redo

Counting in Commands Actually you can put numbers in most commands in VIM, e.g.,, : delete 3 words : delete 1 word 3 times : delete 10 letters Also, you can repeat the last commands by will delete 3 letters.

DEMO TIME!

Searching : search the word {key} in the file : next match : last match : Change direction : any single char (wildcard) e.g. : search *a : search the word under the cursor (forward) : search the word under the cursor (backward)

Copy & Paste Copy is called yank in VIM : yank {n} object : yank 2006 lines : yank 2020 letters : paste down / after : paste up / in front of How about CUT? use

Editing More Files You can edit several files in one instance of VIM : split the window and get one more editing space : edit the file in new space + : Open a new horizontal space + : split vertically + (or cursors): move around space File browser:  you can get a file listing O: open in last space

Programmers’ Tools Syntax Highlighting: automatically loaded (if you have a good.vimrc) or Auto-indentation: or indentation style for C, C++, Java Finding out variable declaration:, Checking pairing brackets:

DEMO TIME!

Configuration VIM reads.vimrc from home directory (or installation directory in M$) whenever it starts..vimrc contains all basic mapping, declaration and setting. Initialize the editing environment. You can use my.vimrc freely and edit to suit your own needs. See the contents!

Finding Help Download, install, documentation, plugin, tips …much more Tutorial html in which this presentation based on html Vi Lovers: : show the help content built in.

Q & A You may ask anything you want to know about vim. I will try to answer as far as I know the solution. Finally thank you once again your attendance.