vim Basics Understanding And Using the vim Text Editor

Slides:



Advertisements
Similar presentations
CS 497C – Introduction to UNIX Lecture 8: The vi/vim Editor Chin-Chih Chang
Advertisements

A Guide to Unix Using Linux Fourth Edition
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.
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.
Using the “CLI” Unix / Linux Preparation Course May 25 Djibouti.
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.
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.
Agenda Using vi Editor Starting vi Session Command / Input Modes Entering Text Editing Text Saving vi Session Aborting Editing Session.
Vim Editor and Unix Command gcc compiler Computer Networks.
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.
Editing, vi and Configuration Files Introduction to Linux June 16, 2009 Papeete, French Polynesia Hervey Allen.
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.
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.
CSCI-1411 F UNDAMENTALS O F C OMPUTING L AB Shane Transue Spring
Introduction to Unix – CS 21 Lecture 7. Lecture Overview Regular expressions revisited emacs versus vi Basic emacs and vi usage.
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.
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.
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.
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
1 Day 4 Introduction to VI. 2 Vi – Visual Editor Used to edit text files on a UNIX system –Now also available for Windows/Mac etc. Very powerful for editing.
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.
CS:414 introduction to Unix and Linux
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
Introduction to the Command Line for Data Analysts Gus Cavanaugh
CS1010: Intro Workshop.
Vim basics Vi IMproved.
Using Vi(m) This presentation on using the Vi(m) editor will cover:
Guide To UNIX Using Linux Third Edition
Editing, vi and Configuration Files
Vi Introduction Tony Kombol.
Linux 104 Training Module File Editing.
Lecture 3 More on editors: emacs and vi COP 3344 Introduction to UNIX.
Editing, vi and Configuration Files
Linux System Administration Editors
Technical University of Kosice
MANIPULATING TEXT WITHIN AND BETWEEN DOCUMENTS
A few tricks to take you beyond the basics of Microsoft Office 2010
VIM - Vi IMproved Bryce Handerson
Text Editors Vim (Chapter 6) Emacs (Chapter 7)
The Linux Command Line Chapter 12
You do want to create and edit programs?
Emacs CSC 135.
C151 Multi-User Operating Systems
Run Java file with Window cmd
Git started with git: 2018 edition
Linux Operations and Administration
The Emacs Editor Read: Forouzan, Appendix C
Assignment 6 Navigation VI Editor comparison
CSCI The UNIX System Editing files
Day 5 Emacs Editor David A. Gaitros Department of Computer Science
Microsoft Office Word 2003 Lesson 1
The Linux Command Line Chapter 12
Presentation transcript:

vim Basics Understanding And Using the vim Text Editor Greg Gómez Tech Days 2018 June 7, 2018

$ Agenda_ This is a basic over view of some of the most basic vim commands. Basically, how to get out if you find yourself using vim. We won’t cover fun things like customization... ... or colors. :/ But I will talk a little about vim’s personality.

$ History_ Please keep in mind that vi and vim are different, although the terms are frequently interchanged. This presentation is about vim.

$ History_ vim is a port of vi, written by Bill Joy in 1976. Ported to the Amiga in 1991. And moved beyond in the years that followed. Vi IMproved = vim. An early text editor Which is why it is the way it is. (Because no mouses). (Or is it mice?) (Mices?)

$ History_ It also comes from a time before terms like ‘copy’ and ‘paste’ were widely used. So it uses terms like ’yank’ and ‘put.’ Or perhaps ‘yank’ was backfilled for the ‘Y’ key? Open files are called buffers.

$ History_ Things like that contribute to the sense of quirkiness with vim. Which can be charming... ... and frustrating.

$ History_ The de facto standard UNIX editor Installed on most (all?) flavors and versions of Linux.

$ History_ So, if you’re doing any kind of U*X DevOps, it’s likely you’ll find yourself using vim at some point.

$ History_ Also, if you’re using git (and who isn’t?), you may find yourself stuck in vim when you commit. Even on Windows(!)

$ The Basics_ You may find yourself using vim whether you want to or not. E.g.: you’ve committed to git and you didn’t set an alternative editor.

$ Yikes! I’m using vim!_

$ The Basics_ Don’t panic. Don’t start typing blindly. This can quickly get you stuck. Old standbys like CTRL-C may not work.

Do use your arrow keys to see if you can get around. $ The Basics_ Do use your arrow keys to see if you can get around.

$ vim’s Modes_ Because vim was born in the times before mouses, it evolved a way of manipulating text without the ability to select it. That’s the modal interface. Also, efficiency: the idea is keep typing as simple as possible. That’s why there’s an emphasis on ‘home row’ keys.

Normal mode: Navigation Deletion, copy, paste, etc. $ vim’s Modes_ Normal mode: Navigation Deletion, copy, paste, etc.

$ vim’s Modes_ Insert Mode: Inserting new text And most other things like backspace, delete, etc. (And some other functions such as deleting text, movement, etc.)

$ vim’s Modes_ Visual Mode: Used mainly to select blocks of text to yank, or to manipulate in other ways.

$ The Basics_ Basic workflow: Navigate to where you want to edit. Enter Insert Mode by pressing the letter i. Make your changes Backspace, delete and arrow keys should work as expected. When you’re ready to save: Press the escape key to exit Insert Mode. You’re now in normal mode. Press the colon key to enter Command-Line Mode Press w and the Enter key to save. Press q and Enter to exit.

$ How to exit_ If you just want to get out, do this: Press the Escape Key. I usually do this a few times, just to be sure. Type a colon ( : ). Type the letter q (lowercase, please). Press the Enter Key. That should do it.

$ Urg I get an error when I do that!_ If you get this error when you try to quit: E37: No write since last change (add ! to override) This happens because the buffer has been changed (edited) and not saved. Press the Escape Key. Type a colon ( : ). Type the letter q (lowercase, please) followed by !. Press the Enter Key. That should do it.

$ In fact, q! is probably your best bet to get out of vim._ Press the Escape Key. Type a colon ( : ). Type the letter q (lowercase, please) followed by !. Press the Enter Key. That should do it. :q!

$ Other features of vim._ Lots! Extremely customizable. Powerful and useful editing features. Plugin ecosystem that makes it even more more.

Questions?

Greg Gómez Tech Days 2018 June 7, 2018 Thanks! Greg Gómez Tech Days 2018 June 7, 2018