Basic gvim commands.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Editing with vi Or more fun than you thought you’d have without a mouse Prof. Chris GauthierDickey.
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
VIM: The basics Tang Wai-Chung, Matthew (MaFai) 29/12/2006.
Vi Editor TA for ITIS3100: Xu Fei
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.
CS465 - UNIX The vi Editor. Creating Files Most human-readable files on Unix are created with a text editor Unix has many, many different editors ed 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 Three The UNIX Editors. 2 Lesson A The vi Editor.
The UNIX development environment CS 400/600 – Data Structures.
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.
Introduction to Vim Robbie CSCI2100 Data Structures Tutorial 3.
Shortcuts for the AccountShortcuts for the Account  Shift + Command + Q: Log off  Control + Eject: Restart/Sleep/Shut Down  Command + Alt (Option)
1 Lab 2 “Hello world” in Unix/Linux #include "std_lib_facilities_4.h" int main(){ cout
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.
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.
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.
Unix Editors. u Editors in Unix come in two general flavours: –modal editors have "modes" v generally input mode and command mode –input mode allows entry.
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.
Text Editing February 2 nd, 2004 Class Meeting 3.
1 of 47 Chapter 4: The vi Editor – First Look Copyright ©2008 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.
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.
Introduction to Unix (CA263) File Editing By Tariq Ibn Aziz.
Chapter Three The UNIX Editors.
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
1. Chapter 1 Creating, Printing, and Editing Documents.
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.
VIM Advanced Why VIM? Easy to study Much easy to use Very easy to find from host You can defined it for yourself You can save.
ICE UNIX TUTORIAL. File System Commands cd – change directory cd – change directory ls – list contents ls – list contents rm – remove/delete rm – remove/delete.
 Simple UNIX commands  I/O techniques in C++  Solutions to Lab#0 problems  Solutions to Lab#1 problems 1.
Purdue Linux Users Group Presents Linux 201: Session 1 Everything you ever wanted to do in VIM Thor Smith.
CS:414 introduction to Unix and Linux
Getting started with CentOS Linux
Vim basics Vi IMproved.
Guide To UNIX Using Linux Third Edition
Vi Editor.
Unix Fundamentals - Part iii 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.
Linux System Administration Editors
Technical University of Kosice
Document Processing Part 2
Text Editors Vim (Chapter 6) Emacs (Chapter 7)
The Linux Command Line Chapter 12
Computer Training.
Emacs CSC 135.
Run Java file with Window cmd
Getting started with CentOS Linux
Chapter 2 Basic vi Editor.
European Computer Driving Licence
Windows Shortcuts.
Lesson 1 - Automating Tasks
Getting around in Windows and VB
Click My Documents to find the document you want to share.
Linux Operations and Administration
The Emacs Editor Read: Forouzan, Appendix C
Grauer and Barber Series Microsoft Word Chapter One
Mu Editor – New User Cheat Sheet – CircuitPython Mode
In the last class… The vi basics command, input and ex mode
Mu Editor – New User Cheat Sheet – CircuitPython Mode
The Linux Command Line Chapter 12
Presentation transcript:

Basic gvim commands

How to open gvim? On command prompt type: gvim file_name.file_extension Insert mode – i Command mode - Esc To save file first press Esc and then press ‘:w’ or ‘:w!’ to over write To exit file first press Esc and then press ‘:q’ or ‘:q!’ to quit forcefully We can combine w and q, e.g. ‘:wq’ to save and exit Exercise: Create a new file with name ‘hello_world.sv’ Press ‘i’ to go into insert mode Declare any module Save and exit the file

Other important gvim commands Use Esc, * Press n to select next highlighted char Press shift + n to select prev highlighted char To highlight particular word Esc, Ctrl + v, up or down arrow to make selection, shift + I, then give required number of space, Esc Indentation Esc, :%s/char/new_char/g Replace all similar char with new char Esc, :%s/char/new_char/gc y – yes, n - no Replace all similar char with new char one by one Esc, :sp(horizontal) or :vsp(vertical) Esc, :Ex To open one more file in same window To open the current directory

Other important gvim commands Use u undo Esc, <no of lines> yy (copy), p (paste), 5yy, 10p Copy and paste selected no of lines Esc, <no of lines> dd Delete the selected no of lines :tabnew New tab gg Move to start of the file Shft+g (G) Move to bottom of the file Shft+d (D) Delete line from where the pointer is /search_pattern Search any pattern in gvim

Recording >> qa //start recording Pressed keys will be remembered by gvim Example of deleting ‘;’ at the end of all lines >> press key ‘End’ >> press key ‘delete’ >> press key ‘down arrow’ >> q //stop recording >> @a //repeat the recorded sequence >> 7@a // repeat the same 7 times While qa, key a was stored, @a gave result, likewise many key a,b,c… recording can be done at the same time. >> qd >> @d

Next in Gvim – make your own ~/.gvimrc Gvim tutor On terminal >> which gvim >> /path/gvimtutor Next in Gvim – make your own ~/.gvimrc