VIP Quick Reference Card

Similar documents
entity tomove over backward forward character C-b C-f word M-b M-f line C-p C-n go to line beginning (or end) C-a C-e sentence M-a M-e paragraph M- M-

Emacs manual:

Statistics 202A - vi Tutorial

Introduction to EMACS. Harriet Borton Academic and Research Computing

Mastering Linux by Paul S. Wang Appendix: The emacs Editor

Introduction to GNU Emacs

Phil Sung. Special thanks to Piaw Na and Arthur Gleckler

Introduction to the Emacs Editor

Computer Programming Lecture 3 이윤진서울대학교

Emacs Tutorial. Creating or Opening a File. Geog 405/605 Computer Programming for Environmental Research Fall 2018

Program Development Tools. Lexical Analyzers. Lexical Analysis Terms. Attributes for Tokens

BEG 6. 50p. Getting Started with the Emacs Screen Editor. An introduction to the Emacs screen editor, which is available on Unix systems.

Getting Started With XEmacs

Basic vi Commands. What is vi? To Get Into and Out Of vi

vi filename edit filename starting at line 1

7.1 INTRODUCTION 7.2 STARTING Emacs 7.3 Emacs SCREEN Menu Bar Text Mode Menu Mode Line Echo Line

Editors in Unix come in two general flavours:

Using the Vi Text Editor

Author: Maarten Litmaath Version: 8. ///////////////// / contributions / /////////////////

vi Primer Adapted from:

VI Commands Cheat Sheets

GNU Info. for version 4.2, 23 March Brian J. Fox

Princeton University COS 217: Introduction to Programming Systems Emacs Reference and Tutorial

Answers to Even- Numbered Exercises

OFFICE OF INFORMATION TECHNOLOGY

A beginner s guide to (GNU) Emacs 24

! Emacs Howto Tutorial!

Learning the vi text editor

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

Bok, Jong Soon

Computer Networks Vim and Emacs. Seongjin Lee

Basic File Attributes

Software I: Utilities and Internals. What is vi?

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

EVE WORKSHOP A practical introduction to the Extensible VAX Editor (2nd Edition)

VIM Tips and Tricks. Search and replace a string in a document : :.,$s/search_string/replacement_string/g

Text Editors for Programmers. Dr. Prasad Kulkarni Michael Jantz Jamie Robinson

Introduction to Linux Environment. Yun-Wen Chen

Using nu/tpu on UNIX Last revised: 1/28/00

FILE MAINTENANCE COMMANDS

The Xemacs Editor. Overview

Essential Unix (and Linux) for the Oracle DBA. Revision no.: PPT/2K403/02

Part I. UNIX Workshop Series: Quick-Start

Vim Habits. Detect inefficiency Find a quicker way Make it a habit

VI (and Clone) Introductory Guide

UNIX: Using PICO on Central UNIX

VIM Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : May, More documents are freely available at PythonDSP

VIM David Orman July 14, 2009

Text Editing in UNIX. A short introduction to vi, pico, and gedit

Stand-alone GNU Info. for version 6.5, 21 May Brian J. Fox and Texinfo maintainers

Emacs: The Software Engineer's \Swiss Army Knife"

Introduction to Linux (Part II) BUPT/QMUL 2018/03/21

Using the Unix system. UNIX Introduction

Mills HPC Tutorial Series. Linux Basics I

Lab 1: Using Oz/Mozart IDE

The first time you open Word

Using the Zoo Workstations

Lab 3a Using the vi editor

Practical Vim, Second Edition

Text Editors for Programmers. EECS-678 Staff

LispWorks for Macintosh. Editor User Guide. Version 6.1

Menu Symbols. Menu Symbol. Key on Keyboard

Lab 3, Part 1: Using Oz/Mozart IDE

Practical Vim, Second Edition

Linux 下代码查看 编辑 编译与调试 (I) 袁华

Modern Vim. Extracted from: Craft Your Development Environment with Vim 8 and Neovim. The Pragmatic Bookshelf

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

TABLE OF CONTENTS TABLE OF CONTENTS... 1 INTRODUCTION... 2 USING WORD S MENUS... 3 USING WORD S TOOLBARS... 5 TASK PANE... 9

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

INTRODUCTION TO VIM. John Kerl University of Arizona Department of Mathematics Software Interest Group September 7, 2005

UNIX Commands. Ex: $ pwd $/tmp $cd/home/sales, this will change the directory from /tmp to /home/sales.

Textadept Quick Reference

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

A Quick Introduction to Emacs. Jim Diamond CAR 409 Jodrey School of Computer Science Acadia University

Review of Fundamentals

3. What is the smallest and largest font size available in Font Size tool on formatting toolbar? A. 8 and 72 B. 8 and 68 C. 6 and 72 D.

Copyright 1984 VisiCorp All Rights Reserved. Printed in U.S.A.

Getting Started with Linux Editors. Network Startup Resource Center

How Emacs Evolves to Suit Your Needs p. 1 How Emacs Differs from Other Software p. 3 Software and the User p. 4 Emacs Vocabulary and Conventions p.

Vi Command & Function Reference

Microsoft Word 2011 Tutorial

MS WORD. You can use it for writing letters, reports and so on.

COMPUTER SHORTCUTS Universal Help in almost every Windows program. Highlights from current position to end of line.

GNU Readline Library. Chet Ramey, Case Western Reserve University Brian Fox, Free Software Foundation

GNU Emacs REDUCE IDE. Francis J. Wright (

COPYRIGHT The GNU History Library is Copyright by the Free Software Foundation, Inc.

CHE3935. Lecture 1. Introduction to Linux

Introduction to UNIX Part II

Windows 10 Essentials

Introduction to Microsoft Office 2016: Word

DOCQSCRIBE 7.1 KEYBOARD SHORTCUTS

Using the Command-Line Interface

ADVANCED LINUX SYSTEM ADMINISTRATION

Getting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers

<<<<<<<<<<BASIC VI COMMANDS>>>>>>>>>>>>>>>>>>

Computer Shortcuts. Files menu options in current program. Edits options in current program Universal Help in almost every Windows program.

KEYBOARD SHORTCUTS AND HOT KEYS

UNIX Quick Reference

There are six main steps in creating web pages in FrontPage98:

Transcription:

VIP Quick Reference Card Loading VIP (Based on VIP 3.5 in GNU Emacs 18) Just type M-x vip-mode followed by RET VIP Modes VIP has three modes: emacs mode, vi mode and insert mode. Mode line tells you which mode you are in. In emacs mode you can do all the normal GNU Emacs editing. This card explains only vi mode and insert mode. GNU Emacs Reference Card explains emacs mode. You can switch modes as follows. from emacs mode to vi mode from vi mode to emacs mode from vi mode to insert mode from insert mode to vi mode C-z C-z i, I, a, A, o, O or C-o ESC If you wish to be in vi mode just after you startup Emacs, include the line: (add-hook emacs-startup-hook vip-mode) in your.emacs file. Or, you can put the following alias in your.cshrc file. alias vip emacs \!* -f vip-mode Insert Mode Insert mode is like emacs mode except for the following. go back to vi mode delete previous character delete previous word emulate ESC key in emacs mode ESC C-h C-w C-z The rest of this card explains commands in vi mode. Getting Information on VIP Execute info command by typing M-x info and select menu item vip. Also: describe function attached to the key x Leaving Emacs C-h k x suspend Emacs X Z or :st exit Emacs permanently Z Z or X C or :q Error Recovery abort partially typed or executing command C-g redraw messed up screen C-l recover a file lost by a system crash M-x recover-file restore a buffer to its original contents M-x revert-buffer c 2017 Free Software Foundation, Inc. Permissions on back. 1

Counts Most commands in vi mode accept a count which can be supplied as a prefix to the commands. In most cases, if a count is given, the command is executed that many times. E.g., 5 d d deletes 5 lines. Registers There are 26 registers (a to z) that can store texts and marks. You can append a text at the end of a register (say x) by specifying the register name in capital letter (say X). There are also 9 read only registers (1 to 9) that store up to 9 previous changes. We will use x to denote a register. Entering Insert Mode insert at point append after cursor insert before first non-white append at end of line open line below open line above open line at point i a I A o O C-o Buffers and Windows move cursor to next window C-n delete current window X 0 delete other windows X 1 split current window into two windows X 2 show current buffer in two windows X 3 switch to a buffer in the current window s buffer switch to a buffer in another window S buffer kill a buffer K list existing buffers X B Files visit file in the current window v file or :e file visit file in another window V file save buffer to the associated file X S write buffer to a specified file X W insert a specified file at point X I get information on the current file g or :f run the directory editor X d Viewing the Buffer scroll to next screen scroll to previous screen scroll down half screen scroll up half screen scroll down one line scroll up one line SPC or C-f RET or C-b C-d C-u C-e C-y put current line on the home line z H or z RET put current line on the middle line z M or z. put current line on the last line z L or z - 2

Marking and Returning mark point in register x m x set mark at buffer beginning m < set mark at buffer end m > set mark at point m. jump to mark m, exchange point and mark... and skip to first non-white on line go to mark x x... and skip to first non-white on line x Macros start remembering keyboard macro X ( finish remembering keyboard macro X ) call last keyboard macro * execute macro stored in register x @ x Motion Commands go backward one character h go forward one character l next line keeping the column j previous line keeping the column k next line at first non-white + previous line at first non-white - beginning of line 0 first non-white on line ^ end of line $ go to n-th column on line n go to n-th line n G go to last line G find matching parenthesis for (), {} and [] % go to home window line go to middle window line go to last window line Words, Sentences, Paragraphs forward word backward word end of word H M L w or W b or B e or E In the case of capital letter commands, a word is delimited by a non-white character. forward sentence ) backward sentence ( forward paragraph } backward paragraph { Find Characters on the Line find c forward on line f c find c backward on line F c up to c forward on line t c up to c backward on line T c repeat previous f, F, t or T ;... in the opposite direction, 3

VIP Quick Reference Card Searching and Replacing search forward for pat / pat search backward for pat? pat repeat previous search n... in the opposite direction N incremental search reverse incremental search replace query replace replace a character by another character c Modifying Commands C-s C-r R Q r c The delete (yank, change) commands explained below accept a motion command as their argument and delete (yank, change) the region determined by the motion command. Motion commands are classified into point commands and line commands. In the case of line commands, whole lines will be affected by the command. Motion commands will be represented by m below. The point commands are as follows: h l 0 ^ $ w W b B e E ( ) /? f F t T % ;, The line commands are as follows: j k + - H M L { } G Delete/Yank/Change Commands delete yank change region determined by m d m y m c m... into register x " x d m " x y m " x c m a line d d Y or y y c c current region d r y r c r expanded region d R y R c R to end of line D y $ c $ a character after point x y l c l a character before point DEL y h c h Put Back Commands Deleted/yanked/changed text can be put back by the following commands. Put back at point/above line P... from register x " x P put back after point/below line p... from register x " x p Repeating and Undoing Modifications undo last change repeat last change u or :und. (dot) Undo is undoable by u and repeatable by.. For example, u... will undo 4 previous changes. A. after 5dd is equivalent to 5dd, while 3. after 5dd is equivalent to 3dd. 4

Miscellaneous Commands shift left shift right filter shell command indent region < m > m! m shell-com = m line < < > >!! shell-com = = emulate ESC/C-h in emacs mode emulate C-c/C-x in emacs mode join lines lowercase region uppercase region execute last keyboard macro on each line in the region insert specified string for each line in the region check spelling of the words in the region Differences from Vi ESC/C-h C/X J # c m # C m # g m # q m # s m In VIP some keys behave rather differently from Vi. The table below lists such keys, and you can get the effect of typing these keys by typing the corresponding keys in the VIP column. Vi VIP forward character SPC l backward character C-h h next line at first non-white RET + delete previous character X DEL get information on file C-g g substitute characters s x i substitute line S c c change to end of line C or R c $ (Strictly speaking, C and R behave slightly differently in Vi.) Customization By default, search is case sensitive. You can change this by including the following line in your.vip file. (setq vip-case-fold-search t) variable default value vip-search-wrap-around t vip-case-fold-search vip-re-search vip-re-replace vip-re-query-replace vip-open-with-indent vip-help-in-insert-mode vip-shift-width 8 vip-tags-file-name "TAGS" Include (some of) following lines in your.vip file to restore Vi key bindings. (define-key vip-mode-map "\C-g" vip-info-on-file) (define-key vip-mode-map "\C-h" vip-backward-char) (define-key vip-mode-map "\C-m" vip-next-line-at-bol) (define-key vip-mode-map " " vip-forward-char) (define-key vip-mode-map "g" vip-keyboard-quit) (define-key vip-mode-map "s" vip-substitute) (define-key vip-mode-map "C" vip-change-to-eol) (define-key vip-mode-map "R" vip-change-to-eol) (define-key vip-mode-map "S" vip-substitute-line) (define-key vip-mode-map "X" vip-delete-backward-char) 5

Ex Commands in VIP In vi mode, an Ex command is entered by typing: : ex-command RET Ex Addresses current line. next line with pat / pat / line n n previous line with pat? pat? last line $ n line before a a - n next line + a through b a, b previous line - line marked with x x entire buffer % previous context Addresses can be specified in front of a command. For example, :.,.+10m$ moves 11 lines below current line to the end of buffer. Ex Commands mark lines matching pat and execute cmds on these lines mark lines not matching pat and execute cmds on these lines move specified lines after addr copy specified lines after addr delete specified lines [into register x] yank specified lines [into register x] put back text [from register x] substitute repl for first string on line matching pat repeat last substitution repeat previous substitute with previous search pattern as pat read in a file read in the output of a shell command write out specified lines into file write out specified lines at the end of file write out and then quit define a macro x that expands to cmd remove macro expansion associated with x :g /pat/ cmds :v /pat/ cmds :m addr :co (or :t) addr :d [x] :y [x] :pu [x] :s /pat/repl/ :& :~ print line number := print version number of VIP :ve shift specified lines to the right :> shift specified lines to the left :< :r file :r! command :w file :w>> file :wq file :map x cmd :unma x join lines :j mark specified line to register x :k x set a variable s value :se run a subshell in a window :sh execute shell command command :! command find first definition of tag tag :ta tag Copyright c 2017 Free Software Foundation, Inc. For VIP 3.5 with GNU Emacs version 18 Written by Masahiko Sato, using refcard layout designed by Stephen Gildea. Released under the terms of the GNU General Public License version 3 or later. For more Emacs documentation, and the TEX source for this card, see the Emacs distribution, or http://www.gnu.org/software/emacs 6