Text Editing by Command

Total Page:16

File Type:pdf, Size:1020Kb

Text Editing by Command Text Editing by Command Felix Faltings};∗ Michel Galley♠ Gerold Hintz♠ Chris Brockett♠ Chris Quirk♠ Jianfeng Gao♠ Bill Dolan♠ }Department of Computer Science, ETH Zurich¨ ♠Microsoft Research [email protected] fmgalley,gehint,chrisbkt,chrisq,jfgao,[email protected] Abstract Barack Obama was the 44th President of the United States. A prevailing paradigm in neural text genera- tion is one-shot generation, where text is pro- expand duced in a single step. The one-shot setting th is inadequate, however, when the constraints Barack Obama was the 44 President of the United States the user wishes to impose on the generated and the first African-American text are dynamic, especially when authoring to hold the office. longer documents. We address this limitation with an interactive text generation setting in add years in office which the user interacts with the system by is- th suing commands to edit existing text. To this Barack Obama was the 44 President of the United States end, we propose a novel text editing task, and from 2009 to 2017 and the introduce WikiDocEdits, a dataset of single- first African-American to hold sentence edits extracted from Wikipedia revi- the office. sion histories. We show that our Interactive Editor, a transformer-based model trained on Figure 1: An illustration of our interactive text gen- this dataset, outperforms baselines and obtains eration setting. This is an example generated by our positive results in both automatic and human model. The blue panels represent the text being edited, evaluations. We present empirical and qualita- taken from the document shown on the right. The tive analyses of this model’s performance.1 orange panels represent user edit commands. The model grounds edits in query results from a commer- 1 Introduction cial search engine. A long-standing goal of natural language process- ing research has been to generate long-form text Most such work only considers a one-shot gen- (Lebowitz, 1985; Fan et al., 2018; Rashkin et al., eration setting. Given a set of inputs, which may 2020). Recent large generative language models be a prompt, a control code (Keskar et al., 2019), such as GPT-2 (Radford et al., 2019), and GPT- or a table of data (Liu et al., 2018b) for example, 3 (Brown et al., 2020), demonstrate an impres- the system generates text in a single step. Humans, sive ability to generate fluent text, but their outputs though, often produce text through an evolutionary are difficult to control beyond a prompt, and they process involving multiple draft-edit cycles. This manifest a tendency to hallucinate facts (Wiseman is not simply because they make mistakes when et al., 2017). Much recent work has thus focused writing, but because they may require multiple it- on making such models more controllable (Keskar erations to help them shape and even make sense et al., 2019; Hu et al., 2017; Zhang et al., 2020; of what they want to express (Pirolli and Card, Dathathri et al., 2019), and factually grounded 2005). For example, consider a user writing an ar- (Guu et al., 2020; Liu et al., 2018b). ticle about Barack Obama. They might start with * Work done at Microsoft Research. a simple sentence such as “Barack Obama was the 1All our code (including code to recreate our data) 44th President of the United States”. Next, they and pre-trained models will be made available at: http://microsoft.com/research/project/ may wish to expand on that sentence, adding infor- interactive-document-generation mation, or rephrasing it to integrate it better with 5259 Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5259–5274 June 6–11, 2021. ©2021 Association for Computational Linguistics the text. Replicating this process in software will 2 Text Editing Task mean allowing users to adjust their requirements in response to model outputs. Even an error-free We now formalize our text editing task. Let 2 system that meets all of a user’s initial require- D be a document, q a user command , and G ments does not obviate the need for iteration, since some appropriate form of grounding. More- 0 those constraints are themselves dynamic. While over, let D be an edited version of D. Then this work focuses on text, we also note that these our task is, given a dataset of edits D = 0 0 arguments extend to other settings where a system f(D0; q0; G0;D0); :::; (DN ; qN ; GN ;DN )g, learn 0 must generate a complex, structured object for a to produce document D , given D, q, and G. user, such as image or code generation. Note that while previous work on text editing usually only considers D as input, we include both The purpose of this paper is to bring into view a form of control q and grounding G. The com- the task of controllable text editing, as a step be- mand is needed because otherwise the type of edit yond one-shot generation towards interactive doc- to be made is undefined, while the grounding pro- ument generation. A full interactive document vides external knowledge needed to make an edit. generation system will likely comprise multiple In our specific instance of this task, we will only components, possibly including one-shot genera- consider sentence-level edits. More formally, we tion to create a first draft. Editing is crucial to in- consider edits D −! D0, where D and D0 differ teractivity because it allows users to change pre- only on a single sentence s 2 D, respectively s0 2 viously generated text to fit their dynamic con- D0. While, in general, edits can vary in complexity straints. This is a stateful operation, where the from document-level to character-level changes, state is the current version of the document, as op- sentences are a natural way to break down text posed to stateless recasting of text from scratch us- into relatively independent units of meaning, so it ing a one-shot model. While services like Gram- makes sense to edit text one sentence at a time. marly or MS Word already offer rewriting sugges- More complex, document-level edits can be seen tions, they mainly focus on syntactic or stylistic as a composition of multiple sentence-level edits. edits such as paraphrases (Gupta et al., 2018). In Additionally, we will consider user commands q this work, we are interested in a broader range of written in natural language, e.g., “add years in of- edits, particularly those that add or remove con- fice”. The command could also take other forms, tent, or change the meaning of text. Figure1 il- such as a categorical variable, but natural lan- lustrates this editing setting with an example from guage allows for the greatest flexibility in spec- our trained model, where a user produces a sen- ifying what the edit should accomplish. More- tence about Barack Obama over multiple edits. over, natural language commands are a good fit for our model, which we will initialize with pre- In sum, we make the following contributions: trained language model weights. For similar rea- We introduce a challenging new text editing task, sons, we will also consider corpora of text snippets wherein a model must learn to edit text in response as our grounding G. Alternatively, the grounding to a user command, while drawing on ground- could also consist of structured data such as tables ing to avoid problems of hallucination (Wise- or graphs. In a real user scenario, this grounding man et al., 2017). To accompany this task, we might be supplied by the user, or retrieved on the release an open-source dataset of sentence-level fly. For our dataset, we pre-retrieve groundings by edits extracted from Wikipedia, including editor querying a commercial search engine. comments, which we leverage as natural language commands, together with pre-retrieved grounding 3 Data documents. We show that a transformer-based editing model trained on our data outperforms To accompany our text editing task we present a “parrot” and GPT-2 baselines, and obtains com- novel dataset of nearly 12 million sentence-level petitive results compared to gold-standard edits in edits, WikiDocEdits. These edits were extracted human evaluations. We then perform an empirical from the revision histories in the February 1, 2020 analysis of our model’s performance, showing the 2This notation reflects that the edit command is analogous importance of the command and grounding, and to a query in a retrieval or QA setting in that it expresses a the varying difficulty of edits in our dataset. form of user intent. 5260 3 dump of English Wikipedia. Statistic Percentiles Mean For a given Wikipedia page, a revision consists 25% 50% 75% of a source and target text, corresponding to the old and new versions of the page. Each revision Sentence length 16 23 31 25:25 is also accompanied by an editor comment, which Diff length 2 3 9 7:27 we will use as a proxy for the user command. For a Comment length 2 3 7 5:20 given revision, we split the source and target texts into sentences and then attempt to match the sen- Table 1: Summary statistics of WikiDocEdits. All tences between source and target. For efficiency, statistics were computed on a 1% subsample of the we only look at a k-sentence neighborhood. Un- data. Lengths reported in number of words. The diff length corresponds to the number of words, inserted or matched sentences are candidates for edits. A deleted, affected by a given edit. source sentence s and target sentence t form an edit pair s −! t if f(s; t) > , where f is sentence- level BLEU4 without smoothing and = 0:1 in 3.2 Data Analysis our case.
Recommended publications
  • Windows Command Prompt Cheatsheet
    Windows Command Prompt Cheatsheet - Command line interface (as opposed to a GUI - graphical user interface) - Used to execute programs - Commands are small programs that do something useful - There are many commands already included with Windows, but we will use a few. - A filepath is where you are in the filesystem • C: is the C drive • C:\user\Documents is the Documents folder • C:\user\Documents\hello.c is a file in the Documents folder Command What it Does Usage dir Displays a list of a folder’s files dir (shows current folder) and subfolders dir myfolder cd Displays the name of the current cd filepath chdir directory or changes the current chdir filepath folder. cd .. (goes one directory up) md Creates a folder (directory) md folder-name mkdir mkdir folder-name rm Deletes a folder (directory) rm folder-name rmdir rmdir folder-name rm /s folder-name rmdir /s folder-name Note: if the folder isn’t empty, you must add the /s. copy Copies a file from one location to copy filepath-from filepath-to another move Moves file from one folder to move folder1\file.txt folder2\ another ren Changes the name of a file ren file1 file2 rename del Deletes one or more files del filename exit Exits batch script or current exit command control echo Used to display a message or to echo message turn off/on messages in batch scripts type Displays contents of a text file type myfile.txt fc Compares two files and displays fc file1 file2 the difference between them cls Clears the screen cls help Provides more details about help (lists all commands) DOS/Command Prompt help command commands Source: https://technet.microsoft.com/en-us/library/cc754340.aspx.
    [Show full text]
  • Your Performance Task Summary Explanation
    Lab Report: 11.2.5 Manage Files Your Performance Your Score: 0 of 3 (0%) Pass Status: Not Passed Elapsed Time: 6 seconds Required Score: 100% Task Summary Actions you were required to perform: In Compress the D:\Graphics folderHide Details Set the Compressed attribute Apply the changes to all folders and files In Hide the D:\Finances folder In Set Read-only on filesHide Details Set read-only on 2017report.xlsx Set read-only on 2018report.xlsx Do not set read-only for the 2019report.xlsx file Explanation In this lab, your task is to complete the following: Compress the D:\Graphics folder and all of its contents. Hide the D:\Finances folder. Make the following files Read-only: D:\Finances\2017report.xlsx D:\Finances\2018report.xlsx Complete this lab as follows: 1. Compress a folder as follows: a. From the taskbar, open File Explorer. b. Maximize the window for easier viewing. c. In the left pane, expand This PC. d. Select Data (D:). e. Right-click Graphics and select Properties. f. On the General tab, select Advanced. g. Select Compress contents to save disk space. h. Click OK. i. Click OK. j. Make sure Apply changes to this folder, subfolders and files is selected. k. Click OK. 2. Hide a folder as follows: a. Right-click Finances and select Properties. b. Select Hidden. c. Click OK. 3. Set files to Read-only as follows: a. Double-click Finances to view its contents. b. Right-click 2017report.xlsx and select Properties. c. Select Read-only. d. Click OK. e.
    [Show full text]
  • Text Editing in UNIX: an Introduction to Vi and Editing
    Text Editing in UNIX A short introduction to vi, pico, and gedit Copyright 20062009 Stewart Weiss About UNIX editors There are two types of text editors in UNIX: those that run in terminal windows, called text mode editors, and those that are graphical, with menus and mouse pointers. The latter require a windowing system, usually X Windows, to run. If you are remotely logged into UNIX, say through SSH, then you should use a text mode editor. It is possible to use a graphical editor, but it will be much slower to use. I will explain more about that later. 2 CSci 132 Practical UNIX with Perl Text mode editors The three text mode editors of choice in UNIX are vi, emacs, and pico (really nano, to be explained later.) vi is the original editor; it is very fast, easy to use, and available on virtually every UNIX system. The vi commands are the same as those of the sed filter as well as several other common UNIX tools. emacs is a very powerful editor, but it takes more effort to learn how to use it. pico is the easiest editor to learn, and the least powerful. pico was part of the Pine email client; nano is a clone of pico. 3 CSci 132 Practical UNIX with Perl What these slides contain These slides concentrate on vi because it is very fast and always available. Although the set of commands is very cryptic, by learning a small subset of the commands, you can edit text very quickly. What follows is an outline of the basic concepts that define vi.
    [Show full text]
  • Shells and Shell Scripting
    Shells and Shell scripting What is a Shell? • A shell is a command line interpreter that is the interface between the user and the OS. • A “program launcher” of sorts. • The shell: o analyzes each command o determines what actions are to be performed o performs the actions • Example: wc –l file1 > file2 Which shell? • sh – Bourne shell o Most common, other shells are a superset o Good for programming • csh or tcsh – default for command line on CDF o C-like syntax o Best for interactive use. Not good for programming. • bash – default on Linux (Bourne again shell) o Based on sh, with some csh features. • korn – written by David Korn o Based on sh – Some claim best for programming. o Commercial product. Common shell facilities Shell startup When a shell is invoked, it does the following: 1. Read a special startup file (usually in home directory) 2. display prompt and wait for command 3. Ctrl-D on its own line terminates shell, otherwise, goto step 2. Shell startup files used to set shell options, set up environment variables, alias sh – executes .profile if it’s there. ksh – executes .profile if in interactive mode. Executes $ENV (usually $HOME/.kshrc) csh – executes .cshrc if it exists. If a login shell, executes .login bash – executes .bashrc, if a login shell, executes .bash_profile instead Executables vs. built-in commands Most commands you run are other compiled programs. Found in /bin Example: ls – shell locates ls binary in /bin directory and launches it Some are not compiled programs, but built into the shell: cd, echo Input-output redirection prog < infile > outfile ls > outfile 2>&1 # sh stdout and stderr Pipelining commands send the output from one command to the input of the next: ls -l | wc ps –aux | grep reid | sort Before a program is executed, the shell recognizes the special characters such as <, >, |, and rewires the standard input, output, or error file descriptors of the program about to be executed to point to the right files (or the standard input of another program).
    [Show full text]
  • UNIX X Command Tips and Tricks David B
    SESUG Paper 122-2019 UNIX X Command Tips and Tricks David B. Horvath, MS, CCP ABSTRACT SAS® provides the ability to execute operating system level commands from within your SAS code – generically known as the “X Command”. This session explores the various commands, the advantages and disadvantages of each, and their alternatives. The focus is on UNIX/Linux but much of the same applies to Windows as well. Under SAS EG, any issued commands execute on the SAS engine, not necessarily on the PC. X %sysexec Call system Systask command Filename pipe &SYSRC Waitfor Alternatives will also be addressed – how to handle when NOXCMD is the default for your installation, saving results, and error checking. INTRODUCTION In this paper I will be covering some of the basics of the functionality within SAS that allows you to execute operating system commands from within your program. There are multiple ways you can do so – external to data steps, within data steps, and within macros. All of these, along with error checking, will be covered. RELEVANT OPTIONS Execution of any of the SAS System command execution commands depends on one option's setting: XCMD Enables the X command in SAS. Which can only be set at startup: options xcmd; ____ 30 WARNING 30-12: SAS option XCMD is valid only at startup of the SAS System. The SAS option is ignored. Unfortunately, ff NOXCMD is set at startup time, you're out of luck. Sorry! You might want to have a conversation with your system administrators to determine why and if you can get it changed.
    [Show full text]
  • 5 Command Line Functions by Barbara C
    ADAPS: Chapter 5. Command Line Functions 5 Command Line Functions by Barbara C. Hoopes and James F. Cornwall This chapter describes ADAPS command line functions. These are functions that are executed from the UNIX command line instead of from ADAPS menus, and that may be run manually or by automated means such as “cron” jobs. Most of these functions are NOT accessible from the ADAPS menus. These command line functions are described in detail below. 5.1 Hydra Although Hydra is available from ADAPS at the PR sub-menu, Edit Time Series Data using Hydra (TS_EDIT), it can also be started from the command line. However, to start Hydra outside of ADAPS, a DV or UV RDB file needs to be available to edit. The command is “hydra rdb_file_name.” For a complete description of using Hydra, refer to Section 4.5.2 Edit Time-Series Data using Hydra (TS_EDIT). 5.2 nwrt2rdb This command is used to output rating information in RDB format. It writes RDB files with a table containing the rating equation parameters or the rating point pairs, with all other information contained in the RDB comments. The following arguments can be used with this command: nwrt2rdb -ooutfile -zdbnum -aagency -nstation -dddid -trating_type -irating_id -e (indicates to output ratings in expanded form; it is ignored for equation ratings.) -l loctzcd (time zone code or local time code "LOC") -m (indicates multiple output files.) -r (rounding suppression) Rules • If -o is omitted, nwrt2rdb writes to stdout; AND arguments -n, -d, -t, and -i must be present. • If -o is present, no other arguments are required, and the program will use ADAPS routines to prompt for them.
    [Show full text]
  • Cyber502x Computer Forensics
    CYBER502x Computer Forensics Unit 2: Linux/Unix Forensics Acquisition CYBER 502x Computer Forensics | Yin Pan Investigating Linux/Unix systems • Four basic forensics steps • Collect • Preserve • Analyze • Present (report) CYBER 502x Computer Forensics | Yin Pan Preparation • A tool box (CD or USB) containing trusted forensic tools • A powerful machine with forensic tools installed and clean-wiped hard drive to store acquired evidence. CYBER 502x Computer Forensics | Yin Pan Remember! • Always have your OWN tool sets ready !! • You are dealing with a compromised system • Run tools from your own USB or device • Save the output outside of the compromised system CYBER 502x Computer Forensics | Yin Pan Forensics tools in common • Ensure forensically-sound operations • Process data structure from the image bypassing kernel’s support • Work on both images and live systems CYBER 502x Computer Forensics | Yin Pan Basic imaging steps • Obtain volatile data (including RAM) –According to policy and the case nature • Acquire non-volatile data (image drives and removable media) CYBER 502x Computer Forensics | Yin Pan Acquire volatile information • System information • Memory usage • Running processes • Logged in users • Network connections • Network interface configuration (promiscuous mode?) • …. CYBER 502x Computer Forensics | Yin Pan Volatile Evidence • Most volatile Least volatile Nonvolatile • Memory • Swap space or gagefile • Network status and connections • Processes running • File opening • Hard drive media • Removable media (CD, Zip, USB,
    [Show full text]
  • Unix Commands (09/04/2014)
    Unix Commands (09/04/2014) • Access control – login <login_name> – exit – passwd <login_name> – yppassswd <loginname> – su – • Login as Super user – su <login> • Login as user <login> • Root Prompt – [root@localhost ~] # • User Prompt – [bms@raxama ~] $ On Line Documentation – man <command/topic> – info <command/topic> • Working with directories – mkdir –p <subdir> ... {-p create all directories in path if not present} mkdir –p /2015/Jan/21/14 will create /2015, Jan, 21 & 14 in case any of these is absent – cd <dir> – rm -r <subdir> ... Man Pages • 1 Executable programs or shell commands • 2 System calls (functions provided by the kernel) • 3 Library calls (functions within program libraries) • 4 Special files (usually found in /dev) • 5 File formats and conventions eg /etc/passwd • 6 Games • 7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7) • 8 System administration commands (usually only for root) • 9 Kernel routines [Non standard] – man grep, {awk,sed,find,cut,sort} – man –k mysql, man –k dhcp – man crontab ,man 5 crontab – man printf, man 3 printf – man read, man 2 read – man info Runlevels used by Fedora/RHS Refer /etc/inittab • 0 - halt (Do NOT set initdefault to this) • 1 - Single user mode • 2 - Multiuser, – without NFS (The same as 3, if you do not have networking) • 3 - Full multi user mode w/o X • 4 - unused • 5 - X11 • 6 - reboot (Do NOT set init default to this) – init 6 {Reboot System} – init 0 {Halt the System} – reboot {Requires Super User} – <ctrl> <alt> <del> • in tty[2-7] mode – tty switching • <ctrl> <alt> <F1-7> • In Fedora 10 tty1 is X.
    [Show full text]
  • The Xargs Package
    The xargs package Manuel Pégourié-Gonnard [email protected] v1.1 (2008/03/22) Contents 1 Introduction 1 2 Usage 1 3 Implementation 4 Important note for French users: a French version of the user documentation is included in the xargs-fr.pdf file. 1 Introduction A Defining commands with an optional argument is easy in LTEX2ε. There is, how- ever, two limitations: you can make only one argument optional and it must be the first one. The xargs package provide extended variants of \newcommand & friends, for which these limitations no longer hold: It is now easy to define commands with many (and freely placed) optional arguments, using a nice hkeyi=hvaluei syntax. For example, the following defines a command with two optional arguments. \newcommandx*\coord[3][1=1, 3=n]{(#2_{#1},\ldots,#2_{#3})} $\coord{x}$ (x1,...,xn) $\coord[0]{y}$ (y0,...,yn) $\coord{z}[m]$ (z1,...,zm) $\coord[0]{t}[m]$ (t0,...,tm) 2 Usage 2.1 Basics The xargs package defines an extended variant for every LATEX macro related to macro definition. xargs’s macro are named after their LATEX counterparts, just adding an x at end (see the list in the margin). Here is the complete list: \newcommandx \renewcommandx \newenvironmentx \renewenvironmentx \providecommandx \DeclareRobustCommandx \CheckCommandx 1 If you are not familiar with all of them, you can either just keep using the A commands you already know, or check Lamport’s book or the LTEX Companion (or any LATEX2ε manual) to learn the others. Since these commands all share the same syntax, I’ll always use \newcommandx in the following, but remember it works the same for all seven commands.
    [Show full text]
  • Introduction to UNIX Command Line
    Introduction to UNIX Command Line ● Files and directories ● Some useful commands (echo, cat, grep, find, diff, tar) ● Redirection ● Pipes ● Variables ● Background processes ● Remote connections (e.g. ssh, wget) ● Scripts The Command Line ● What is it? ● An interface to UNIX ● You type commands, things happen ● Also referred to as a “shell” ● We'll use the bash shell – check you're using it by typing (you'll see what this means later): ● echo $SHELL ● If it doesn't say “bash”, then type bash to get into the bash shell Files and Directories / home var usr mcuser abenson drmentor science catvideos stuff data code report M51.fits simulate.c analyze.py report.tex Files and Directories ● Get a pre-made set of directories and files to work with ● We'll talk about what these commands do later ● The “$” is the command prompt (yours might differ). Type what's listed after hit, then press enter. $$ wgetwget http://bit.ly/1TXIZSJhttp://bit.ly/1TXIZSJ -O-O playground.tarplayground.tar $$ tartar xvfxvf playground.tarplayground.tar Files and directories $$ pwdpwd /home/abenson/home/abenson $$ cdcd playgroundplayground $$ pwdpwd /home/abenson/playground/home/abenson/playground $$ lsls animalsanimals documentsdocuments sciencescience $$ mkdirmkdir mystuffmystuff $$ lsls animalsanimals documentsdocuments mystuffmystuff sciencescience $$ cdcd animals/mammalsanimals/mammals $$ lsls badger.txtbadger.txt porcupine.txtporcupine.txt $$ lsls -l-l totaltotal 88 -rw-r--r--.-rw-r--r--. 11 abensonabenson abensonabenson 19441944 MayMay 3131 18:0318:03 badger.txtbadger.txt -rw-r--r--.-rw-r--r--. 11 abensonabenson abensonabenson 13471347 MayMay 3131 18:0518:05 porcupine.txtporcupine.txt Files and directories “Present Working Directory” $$ pwdpwd Shows the full path of your current /home/abenson/home/abenson location in the filesystem.
    [Show full text]
  • Create Directory on Windows Without the Fleeting DOS Window Hsiwei Yu (Michael), People Technology Solution Inc, Edison, NJ Gary Huang, Infostat Inc., Belle Mead, NJ
    Create Directory on Windows Without the Fleeting DOS Window Hsiwei Yu (Michael), People Technology Solution Inc, Edison, NJ Gary Huang, InfoStat Inc., Belle Mead, NJ copy “source directory” “target directory” ABSTRACT for copying files from source directory to target directory. On newer Windows environments, the pipe feature on a filename statement can be used to create directory without the fleeting Most DOS commands return nothing when successful. Some DOS window. This is better than the X command approach. Any commands, like DIR and COPY, return useful information that DOS commands can be used in the filename pipe feature. Finally can be further analyzed. we will show example of managing directories on remote machine Filename fileref PIPE ‘dir “c:\a dir”’; from local SAS session. Data important_message; Infile fileref length= LNG; Input @; INTRODUCTION /* Put _infile_; */ Sometimes we need to create or delete a directory from within a /* Additional logic to parse the directory SAS session. Previously we can use the X command construct to contents for further analysis. */ issue such create directory (MKDIR) command. However this if LNG >= 8 then do; technique results in an annoying DOS window, flashing and input last_modified_date mmddyy8. @; vanishing on screen. On newer Windows environment and with … the filename pipe feature, we can accomplish the same without end; the extra DOS window. Run; THE FILENAME PIPE FEATURE APPLICATON: MANAGE DIRECTORY ON The filename pipe feature is available is in the Windows environment in both SAS 6.12
    [Show full text]
  • How Do You Use the Vi Text Editor?
    How do you use the vi text editor? 1.What is the Visual Text Editor (vi)?...................................................................2 2.Configuring your vi session..............................................................................2 2.1.Some of the options available in vi are:................................................3 2.2.Sample of the .exrc file........................................................................3 3.vi Quick Reference Guide.................................................................................4 3.1.Cursor Movement Commands.............................................................4 3.2.Inserting and Deleting Text.................................................................5 3.3.Change Commands.............................................................................6 3.4.File Manipulation...............................................................................7 Institute of Microelectronics, Singapore FAQ for vi text editor E1 1. What is the Visual Text Editor (vi)? The Visual Test Editor, more commonly known as the vi text editor, is a standard “visual” (full screen) editor available for test editing in UNIX. It is a combination of the capabilities of the UNIX ed and ex text editors. It has specific modes for text insertion and deletion as well as command entering. Type view on the command line of the UNIX shell terminal to enter the read- only mode of vi. To switch between the line editor, ex, mode and the full screen wrapmargin vi mode: • To enter the ex mode from the vi mode, type Q • To enter the vi mode from the ex mode, type vi When vi is entered on the command line, you enter vi’s command (entering) mode. Positioning and editing commands can be entered to perform functions in this mode whilst advanced editing commands can be entered following a colon (:) that places you at the bottom of the file. To enter text insertion mode, a vi text insertion command i, o, or a is typed so that text will no longer be interpreted as positioning or editing commands in this mode.
    [Show full text]