1This is viper.info, produced by makeinfo version 6.7 from viper.texi. 2 3Copyright © 1995–1997, 2001–2021 Free Software Foundation, Inc. 4 5 Permission is granted to copy, distribute and/or modify this 6 document under the terms of the GNU Free Documentation License, 7 Version 1.3 or any later version published by the Free Software 8 Foundation; with no Invariant Sections, with the Front-Cover Texts 9 being “A GNU Manual”, and with the Back-Cover Texts as in (a) 10 below. A copy of the license is included in the section entitled 11 “GNU Free Documentation License”. 12 13 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and 14 modify this GNU manual.” 15INFO-DIR-SECTION Emacs misc features 16START-INFO-DIR-ENTRY 17* VIPER: (viper). A VI-emulation mode for Emacs. 18END-INFO-DIR-ENTRY 19 20 21File: viper.info, Node: Top, Next: Overview, Up: (dir) 22 23Viper 24***** 25 26We believe that one or more of the following statements are adequate 27descriptions of Viper: 28 29 Viper Is a Package for Emacs Rebels; 30 it is a VI Plan for Emacs Rescue 31 and/or a venomous VI PERil. 32 33 Technically speaking, Viper is a Vi emulation package for Emacs. It 34implements all Vi and Ex commands, occasionally improving on them and 35adding many new features. It gives the user the best of both worlds: Vi 36keystrokes for editing combined with the power of the Emacs environment. 37 38 Viper emulates Vi at several levels, from the one that closely 39follows Vi conventions to the one that departs from many of them. It 40has many customizable options, which can be used to tailor Viper to the 41work habits of various users. This manual describes Viper, 42concentrating on the differences from Vi and new features of Viper. 43 44 Viper, formerly known as VIP-19, was written by Michael Kifer. It is 45based on VIP version 3.5 by Masahiko Sato and VIP version 4.4 by Aamod 46Sane. About 15% of the code still comes from those older packages. 47 48 Viper is intended to be usable without reading this manual; the 49defaults are set to make Viper as close to Vi as possible. At startup, 50Viper will try to set the most appropriate default environment for you, 51based on your familiarity with Emacs. It will also tell you the basic 52GNU Emacs window management commands to help you start immediately. 53 54 Although this manual explains how to customize Viper, some basic 55familiarity with Emacs Lisp is a plus. 56 57 It is recommended that you read the Overview node. The other nodes 58may be visited as needed. 59 60 Comments and bug reports are welcome. ‘kifer@cs.stonybrook.edu’ is 61the current address for Viper bug reports. Please use the Ex command 62‘:submitReport’ for this purpose. 63 64 Copyright © 1995–1997, 2001–2021 Free Software Foundation, Inc. 65 66 Permission is granted to copy, distribute and/or modify this 67 document under the terms of the GNU Free Documentation License, 68 Version 1.3 or any later version published by the Free Software 69 Foundation; with no Invariant Sections, with the Front-Cover Texts 70 being “A GNU Manual”, and with the Back-Cover Texts as in (a) 71 below. A copy of the license is included in the section entitled 72 “GNU Free Documentation License”. 73 74 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and 75 modify this GNU manual.” 76 77* Menu: 78 79* Overview:: Read for a smoother start 80* Improvements over Vi:: New features, Improvements 81* Customization:: How to customize Viper 82* Commands:: Vi and Ex Commands 83* GNU Free Documentation License:: The license for this documentation. 84* Acknowledgments:: 85* Key Index:: Index of Vi and Ex Commands 86* Function Index:: Index of Viper Functions 87* Variable Index:: Index of Viper Variables 88* Package Index:: Index of Packages Mentioned in this Document 89* Concept Index:: Vi, Ex and Emacs concepts 90 91 92File: viper.info, Node: Overview, Next: Improvements over Vi, Prev: Top, Up: Top 93 941 Overview of Viper 95******************* 96 97Viper is a Vi emulation on top of Emacs. At the same time, Viper 98provides a virtually unrestricted access to Emacs facilities. Perfect 99compatibility with Vi is possible but not desirable. This chapter tells 100you about the Emacs ideas that you should know about, how to use Viper 101within Emacs and some incompatibilities. 102 103 This manual is written with the assumption that you are an 104experienced Vi user who wants to switch to Emacs while retaining the 105ability to edit files Vi style. Incredible as it might seem, there are 106experienced Emacs users who use Viper as a backdoor into the superior 107(as every Vi user already knows) world of Vi! These users are well 108familiar with Emacs bindings and prefer them in some cases, especially 109in the Vi Insert state. John Hawkins <jshawkin@eecs.umich.edu> has 110provided a set of customizations, which enables additional Emacs 111bindings under Viper. These customizations can be included in your 112‘~/.emacs.d/viper’ file and are found at the following URL: 113‘http://traeki.freeshell.org/files/viper-sample’. 114 115* Menu: 116 117* Emacs Preliminaries:: Basic concepts in Emacs. 118* Loading Viper:: Loading and Preliminary Configuration. 119* States in Viper:: Viper has four states orthogonal to Emacs 120 modes. 121* The Minibuffer:: Command line in Emacs. 122* Multiple Files in Viper:: True multiple file handling. 123* Unimplemented Features:: That are unlikely to be implemented. 124 125 126File: viper.info, Node: Emacs Preliminaries, Next: Loading Viper, Up: Overview 127 1281.1 Emacs Preliminaries 129======================= 130 131Emacs can edit several files at once. A file in Emacs is placed in a 132“buffer” that usually has the same name as the file. Buffers are also 133used for other purposes, such as shell interfaces, directory editing, 134etc. *Note Directory Editor: (emacs)Dired, for an example. 135 136 A buffer has a distinguished position called the “point”. A “point” 137is always between 2 characters, and is “looking at” the right hand 138character. The cursor is positioned on the right hand character. Thus, 139when the “point” is looking at the end-of-line, the cursor is on the 140end-of-line character, i.e., beyond the last character on the line. 141This is the default Emacs behavior. 142 143 The default settings of Viper try to mimic the behavior of Vi, 144preventing the cursor from going beyond the last character on the line. 145By using Emacs commands directly (such as those bound to arrow keys), it 146is possible to get the cursor beyond the end-of-line. However, this 147won’t (or shouldn’t) happen if you restrict yourself to standard Vi 148keys, unless you modify the default editing style. *Note 149Customization::. 150 151 In addition to the “point”, there is another distinguished buffer 152position called the “mark”. *Note Mark: (emacs)Mark, for more info on 153the mark. The text between the “point” and the “mark” is called the 154“region” of the buffer. For the Viper user, this simply means that in 155addition to the Vi textmarkers a–z, there is another marker called 156“mark”. This is similar to the unnamed Vi marker used by the jump 157commands ‘``’ and ‘''’, which move the cursor to the position of the 158last absolute jump. Viper provides access to the region in most text 159manipulation commands as ‘r’ and ‘R’ suffix to commands that operate on 160text regions, e.g., ‘dr’ to delete region, etc. 161 162 Furthermore, Viper lets Ex-style commands to work on the current 163region. This is done by typing a digit argument before ‘:’. For 164instance, typing ‘1:’ will prompt you with something like _:123,135_, 165assuming that the current region starts at line 123 and ends at line 166135. There is no need to type the line numbers, since Viper inserts 167them automatically in front of the Ex command. 168 169 *Note Basics::, for more info. 170 171 Emacs divides the screen into tiled “windows”. You can see the 172contents of a buffer through the window associated with the buffer. The 173cursor of the screen is positioned on the character after “point”. 174Every window has a “mode line” that displays information about the 175buffer. You can change the format of the mode line, but normally if you 176see ‘**’ at the beginning of a mode line it means that the buffer is 177“modified”. If you write out the contents of a buffer to a file, then 178the buffer will become not modified. Also if you see ‘%%’ at the 179beginning of the mode line, it means that the file associated with the 180buffer is write protected. The mode line will also show the buffer name 181and current major and minor modes (see below). A special buffer called 182“Minibuffer” is displayed as the last line in a minibuffer window. The 183minibuffer window is used for command input output. Viper uses 184minibuffer window for ‘/’ and ‘:’ commands. 185 186 An Emacs buffer can have a “major mode” that customizes Emacs for 187editing text of a particular sort by changing the functionality of the 188keys. Keys are defined using a “keymap” that records the bindings 189between keystrokes and functions. The “global keymap” is common to all 190the buffers. Additionally, each buffer has its “local keymap” that 191determines the “mode” of the buffer. If a function is bound to some key 192in the local keymap then that function will be executed when you type 193the key. If no function is bound to a key in the local map, however, 194the function bound to the key in the global map will be executed. *Note 195Major Modes: (emacs)Major Modes, for more information. 196 197 A buffer can also have a “minor mode”. Minor modes are options that 198you can use or not. A buffer in ‘text-mode’ can have ‘auto-fill-mode’ 199as minor mode, which can be turned off or on at any time. In Emacs, a 200minor mode may have it own keymap, which overrides the local keymap when 201the minor mode is turned on. For more information, *note Minor Modes: 202(emacs)Minor Modes. 203 204 Viper is implemented as a collection of minor modes. Different minor 205modes are involved when Viper emulates Vi command mode, Vi insert mode, 206etc. You can also turn Viper on and off at any time while in Vi command 207mode. *Note States in Viper::, for more information. 208 209 Emacs uses Control and Meta modifiers. These are denoted as C and M, 210e.g., ‘^Z’ as ‘C-z’ and ‘Meta-x’ as ‘M-x’. The Meta key is usually 211located on each side of the Space bar; it is used in a manner similar to 212the Control key, e.g., ‘M-x’ means typing ‘x’ while holding the Meta key 213down. For keyboards that do not have a Meta key, <ESC> is used as Meta. 214Thus ‘M-x’ is typed as ‘<ESC> x’. Viper uses <ESC> to switch from 215Insert state to Vi state. Therefore Viper defines ‘C-\’ as its Meta key 216in Vi state. *Note Vi State::, for more info. 217 218 Emacs is structured as a Lisp interpreter around a C core. Emacs 219keys cause Lisp functions to be called. It is possible to call these 220functions directly, by typing ‘M-x function-name’. 221 222 223File: viper.info, Node: Loading Viper, Next: States in Viper, Prev: Emacs Preliminaries, Up: Overview 224 2251.2 Loading Viper 226================= 227 228The most common way to load it automatically is to include the following 229lines (in the given order!): 230 231 (setq viper-mode t) 232 (require 'viper) 233 234in your ‘~/.emacs’ file. The ‘.emacs’ file is placed in your home 235directory and it is be executed every time you invoke Emacs. This is 236the place where all general Emacs customization takes place. Beginning 237with version 20.0, Emacsen have an interactive interface, which 238simplifies the job of customization significantly. 239 240 Viper also uses the file ‘~/.emacs.d/viper’ for Viper-specific 241customization. The location of Viper customization file can be changed 242by setting the variable ‘viper-custom-file-name’ in ‘.emacs’ _prior_ to 243loading Viper. 244 245 The latest versions of Emacs have an interactive customization 246facility, which allows you to (mostly) bypass the use of the ‘.emacs’ 247and ‘viper-custom-file-name’ files. You can reach this customization 248facility from within Viper’s VI state by executing the Ex command 249‘:customize’. 250 251 Once invoked, Viper will arrange to bring up Emacs buffers in Vi 252state whenever this makes sense. *Note Packages that Change Keymaps::, 253to find out when forcing Vi command state on a buffer may be 254counter-productive. 255 256 Even if your ‘.emacs’ file does not invoke Viper automatically, you 257can still load Viper and enter the Vi command state by typing the 258following from within Emacs: 259 260 M-x viper-mode 261 262 When Emacs first comes up, if you have not specified a file on the 263command line, it will show the ‘*scratch*’ buffer, in the ‘Lisp 264Interaction’ mode. After you invoke Viper, you can start editing files 265by using ‘:e’, ‘:vi’, or ‘v’ commands. (*Note File and Buffer 266Handling::, for more information on ‘v’ and other new commands that, in 267many cases, are more convenient than ‘:e’, ‘:vi’, and similar old-style 268Vi commands.) 269 270 Finally, if at some point you would want to de-Viperize your running 271copy of Emacs after Viper has been loaded, the command ‘M-x 272viper-go-away’ will do it for you. The function ‘toggle-viper-mode’ 273toggles Viperization of Emacs on and off. 274 275 276File: viper.info, Node: States in Viper, Next: The Minibuffer, Prev: Loading Viper, Up: Overview 277 2781.3 States in Viper 279=================== 280 281Viper has four states, Emacs, Vi, Insert, and Replace. 282 283‘Emacs state’ 284 This is the state plain vanilla Emacs is normally in. After you 285 have loaded Viper, ‘C-z’ will normally take you to Vi command 286 state. Another ‘C-z’ will take you back to Emacs state. This 287 toggle key can be changed, *note Customization:: You can also type 288 ‘M-x viper-mode’ to change to Vi state. 289 290 For users who chose to set their user level to 1 at Viper setup 291 time, switching to Emacs state is deliberately made harder in order 292 to not confuse the novice user. In this case, ‘C-z’ will either 293 iconify Emacs (if Emacs runs as an application under X) or it will 294 stop Emacs (if Emacs runs on a dumb terminal or in an Xterm 295 window). 296 297‘Vi state’ 298 This is the Vi command mode. Any of the Vi commands, such as ‘i, 299 o, a’, ..., will take you to Insert state. All Vi commands may be 300 used in this mode. Most Ex commands can also be used. For a full 301 list of Ex commands supported by Viper, type ‘:’ and then <TAB>. 302 To get help on any issue, including the Ex commands, type ‘:help’. 303 This will invoke Viper Info (if it is installed). Then typing ‘i’ 304 will prompt you for a topic to search in the index. Note: to 305 search for Ex commands in the index, you should start them with a 306 ‘:’, e.g., ‘:WW’. 307 308 In Viper, Ex commands can be made to work on the current Emacs 309 region. This is done by typing a digit argument before ‘:’. For 310 instance, typing ‘1:’ will prompt you with something like 311 _:123,135_, assuming that the current region starts at line 123 and 312 ends at line 135. There is no need to type the line numbers, since 313 Viper inserts them automatically in front of the Ex command. 314 315‘Insert state’ 316 Insert state is the Vi insertion mode. <ESC> will take you back to 317 Vi state. Insert state editing can be done, including 318 auto-indentation. By default, Viper disables Emacs key bindings in 319 Insert state. 320 321‘Replace state’ 322 Commands like ‘cw’ invoke the Replace state. When you cross the 323 boundary of a replacement region (usually designated via a ‘$’ 324 sign), it will automatically change to Insert state. You do not 325 have to worry about it. The key bindings remain practically the 326 same as in Insert state. If you type <ESC>, Viper will switch to 327 Vi command mode, terminating the replacement state. 328 329 The modes are indicated on the “mode line” as <E>, <I>, <V>, and <R>, 330so that the multiple modes do not confuse you. Most of your editing can 331be done in Vi and Insert states. Viper will try to make all new buffers 332be in Vi state, but sometimes they may come up in Emacs state. ‘C-z’ 333will take you to Vi state in such a case. In some major modes, like 334Dired, Info, Gnus, etc., you should not switch to Vi state (and Viper 335will not attempt to do so) because these modes are not intended for text 336editing and many of the Vi keys have special meaning there. If you plan 337to read news, browse directories, read mail, etc., from Emacs (which you 338should start doing soon!), you should learn about the meaning of the 339various keys in those special modes (typing ‘C-h m’ in a buffer provides 340help with key bindings for the major mode of that buffer). 341 342 If you switch to Vi in Dired or similar modes, no harm is done. It 343is just that the special key bindings provided by those modes will be 344temporarily overshadowed by Viper’s bindings. Switching back to Viper’s 345Emacs state will revive the environment provided by the current major 346mode. 347 348 States in Viper are orthogonal to Emacs major modes, such as C mode 349or Dired mode. You can turn Viper on and off for any Emacs state. When 350Viper is turned on, Vi state can be used to move around. In Insert 351state, the bindings for these modes can be accessed. For beginners 352(users at Viper levels 1 and 2), these bindings are suppressed in Insert 353state, so that new users are not confused by the Emacs states. Note 354that unless you allow Emacs bindings in Insert state, you cannot do many 355interesting things, like language sensitive editing. For the novice 356user (at Viper level 1), all major mode bindings are turned off in Vi 357state as well. This includes the bindings for key sequences that start 358with ‘C-c’, which practically means that all major mode bindings are 359unsupported. *Note Customization::, to find out how to allow Emacs keys 360in Insert state. 361 362* Menu: 363 364* Emacs State:: This is the state you should learn more about when 365 you get up to speed with Viper. 366* Vi State:: Vi commands are executed in this state. 367* Insert State:: You can enter text, and also can do sophisticated 368 editing if you know enough Emacs commands. 369* Replace State:: Like Insert mode, but it is invoked via the 370 replacement commands, such as cw, C, R, etc. 371 372 373File: viper.info, Node: Emacs State, Next: Vi State, Up: States in Viper 374 3751.3.1 Emacs State 376----------------- 377 378You will be in this mode only by accident (hopefully). This is the 379state Emacs is normally in (imagine!!). Now leave it as soon as 380possible by typing ‘C-z’. Then you will be in Vi state (sigh of relief) 381:-). 382 383 Emacs state is actually a Viperism to denote all the major and minor 384modes (*note Emacs Preliminaries::) other than Viper that Emacs can be 385in. Emacs can have several modes, such as C mode for editing C 386programs, LaTeX mode for editing LaTeX documents, Dired for directory 387editing, etc. These are major modes, each with a different set of 388key-bindings. Viper states are orthogonal to these Emacs major modes. 389The presence of these language sensitive and other modes is a major win 390over Vi. *Note Improvements over Vi::, for more. 391 392 The bindings for these modes can be made available in the Viper 393Insert state as well as in Emacs state. Unless you specify your user 394level as 1 (a novice), all major mode key sequences that start with 395‘C-x’ and ‘C-c’ are also available in Vi state. This is important 396because major modes designed for editing files, such as cc-mode or 397latex-mode, use key sequences that begin with ‘C-x’ and ‘C-c’. 398 399 There is also a key that lets you temporarily escape to Vi command 400state from the Insert state: typing ‘C-z’ will let you execute a single 401Vi command while staying in Viper’s Insert state. 402 403 404File: viper.info, Node: Vi State, Next: Insert State, Prev: Emacs State, Up: States in Viper 405 4061.3.2 Vi State 407-------------- 408 409This is the Vi command mode. When Viper is in Vi state, you will see 410the sign <V> in the mode line. Most keys will work as in Vi. The 411notable exceptions are: 412 413‘C-x’ 414 ‘C-x’ is used to invoke Emacs commands, mainly those that do window 415 management. ‘C-x 2’ will split a window, ‘C-x 0’ will close a 416 window. ‘C-x 1’ will close all other windows. ‘C-xb’ is used to 417 switch buffers in a window, and ‘C-xo’ to move through windows. 418 These are about the only necessary keystrokes. For the rest, see 419 the GNU Emacs Manual. 420 421‘C-c’ 422 For user levels 2 and higher, this key serves as a prefix key for 423 the key sequences used by various major modes. For users at Viper 424 level 1, ‘C-c’ simply beeps. 425 426‘C-g and C-]’ 427 428 These are the Emacs ‘quit’ keys. There will be cases where you 429 will have to use ‘C-g’ to quit. Similarly, ‘C-]’ is used to exit 430 ‘Recursive Edits’ in Emacs for which there is no comparable Vi 431 functionality and no key-binding. Recursive edits are indicated by 432 ‘[]’ brackets framing the modes on the mode line. *Note Recursive 433 Edit: (emacs)Recursive Edit. At user level 1, ‘C-g’ is bound to 434 ‘viper-info-on-file’ function instead. 435‘C-\’ 436 437 Viper uses <ESC> as a switch between Insert and Vi states. Emacs 438 uses <ESC> for Meta. The Meta key is very important in Emacs since 439 many functions are accessible only via that key as ‘M-x 440 function-name’. Therefore, we need to simulate it somehow. In 441 Viper’s Vi, Insert, and Replace states, the meta key is set to be 442 ‘C-\’. Thus, to get ‘M-x’, you should type ‘C-\ x’ (if the 443 keyboard has no Meta key, which is rare these days). This works 444 both in the Vi command state and in the Insert and Replace states. 445 In Vi command state, you can also use ‘\ <ESC>’ as the meta key. 446 447 Note: Emacs binds ‘C-\’ to a function that offers to change the 448 keyboard input method in the multilingual environment. Viper 449 overrides this binding. However, it is still possible to switch 450 the input method by typing ‘\ C-\’ in the Vi command state and ‘C-z 451 \ C-\’ in the Insert state. Or you can use the MULE menu in the 452 menubar. 453Other differences are mostly improvements. The ones you should know 454about are: 455 456‘Undo’ 457 ‘u’ will undo. Undo can be repeated by the ‘.’ key. Undo itself 458 can be undone. Another ‘u’ will change the direction. The 459 presence of repeatable undo means that ‘U’, undoing lines, is not 460 very important. Therefore, ‘U’ also calls ‘viper-undo’. 461 462‘Counts’ 463 Most commands, ‘~’, ‘[[’, ‘p’, ‘/’, ..., etc., take counts. 464 465‘Regexps’ 466 Viper uses Emacs Regular Expressions for searches. These are a 467 superset of Vi regular expressions, excepting the change-of-case 468 escapes ‘\u’, ‘\L’, ..., etc. *Note Syntax of Regular Expressions: 469 (emacs)Regexps, for details. Files specified to ‘:e’ use ‘csh’ 470 regular expressions (globbing, wildcards, what have you). However, 471 the function ‘viper-toggle-search-style’, bound to ‘C-c /’, lets 472 the user switch from search with regular expressions to plain 473 vanilla search and vice versa. It also lets one switch from 474 case-sensitive search to case-insensitive and back. *Note Viper 475 Specials::, for more details. 476 477‘Ex commands’ 478 The current working directory of a buffer is automatically inserted 479 in the minibuffer if you type ‘:e’ then space. Absolute filenames 480 are required less often in Viper. For file names, Emacs uses a 481 convention that is slightly different from other programs. It is 482 designed to minimize the need for deleting file names that Emacs 483 provides in its prompts. (This is usually convenient, but 484 occasionally the prompt may suggest a wrong file name for you.) If 485 you see a prompt ‘/usr/foo/’ and you wish to edit the file 486 ‘~/.file’, you don’t have to erase the prompt. Instead, simply 487 continue typing what you need. Emacs will interpret 488 ‘/usr/foo/~/.file’ correctly. Similarly, if the prompt is ‘~/foo/’ 489 and you need to get to ‘/bar/file’, keep typing. Emacs interprets 490 ‘~/foo//bar/’ as ‘/bar/file’, since when it sees ‘//’, it 491 understands that ‘~/foo/’ is to be discarded. 492 493 The command ‘:cd’ will change the default directory for the current 494 buffer. The command ‘:e’ will interpret the filename argument in 495 ‘csh’. *Note Customization::, if you want to change the default 496 shell. The command ‘:next’ takes counts from ‘:args’, so that 497 ‘:rew’ is obsolete. Also, ‘:args’ will show only the invisible 498 files (i.e., those that are not currently seen in Emacs windows). 499 500 When applicable, Ex commands support file completion and history. 501 This means that by typing a partial file name and then <TAB>, Emacs 502 will try to complete the name or it will offer a menu of possible 503 completions. This works similarly to Tcsh and extends the behavior 504 of Csh. While Emacs is waiting for a file name, you can type ‘M-p’ 505 to get the previous file name you typed. Repeatedly typing ‘M-p’ 506 and ‘M-n’ will let you browse through the file history. 507 508 Like file names, partially typed Ex commands can be completed by 509 typing <TAB>, and Viper keeps the history of Ex commands. After 510 typing ‘:’, you can browse through the previously entered Ex 511 commands by typing ‘M-p’ and ‘M-n’. Viper tries to rationalize 512 when it puts Ex commands on the history list. For instance, if you 513 typed ‘:w! foo’, only ‘:w!’ will be placed on the history list. 514 This is because the last history element is the default that can be 515 invoked simply by typing ‘: <RET>’. If ‘:w! foo’ were placed on 516 the list, it would be all to easy to override valuable data in 517 another file. Reconstructing the full command, ‘:w! foo’, from the 518 history is still not that hard, since Viper has a separate history 519 for file names. By typing ‘: M-p’, you will get ‘:w!’ in the 520 minibuffer. Then, repeated ‘M-p’ will get you through the file 521 history, inserting one file name after another. 522 523 In contrast to ‘:w! foo’, if the command were ‘:r foo’, the entire 524 command will appear in the history list. This is because having 525 ‘:r’ alone as a default is meaningless, since this command requires 526 a file argument. 527As in Vi, Viper’s destructive commands can be re-executed by typing a 528period (‘.’). However, in addition, Viper keeps track of the history of 529such commands. This history can be perused by typing ‘C-c M-p’ and ‘C-c 530M-n’. Having found the appropriate command, it can be then executed by 531typing a period. *Note Improvements over Vi::, for more information. 532 533 534File: viper.info, Node: Insert State, Next: Replace State, Prev: Vi State, Up: States in Viper 535 5361.3.3 Insert State 537------------------ 538 539To avoid confusing the beginner (at Viper level 1 and 2), Viper makes 540only the standard Vi keys available in Insert state. The implication is 541that Emacs major modes cannot be used in Insert state. It is strongly 542recommended that as soon as you are comfortable, make the Emacs state 543bindings visible (by changing your user level to 3 or higher). *Note 544Customization::, to see how to do this. 545 546 Once this is done, it is possible to do quite a bit of editing in 547Insert state. For instance, Emacs has a “yank” command, ‘C-y’, which is 548similar to Vi’s ‘p’. However, unlike ‘p’, ‘C-y’ can be used in Insert 549state of Viper. Emacs also has a kill ring where it keeps pieces of 550text you deleted while editing buffers. The command ‘M-y’ is used to 551delete the text previously put back by Emacs’s ‘C-y’ or by Vi’s ‘p’ 552command and reinsert text that was placed on the kill-ring earlier. 553 554 This works both in Vi and Insert states. In Vi state, ‘M-y’ is a 555much better alternative to the usual Vi’s way of recovering the 10 556previously deleted chunks of text. In Insert state, you can use this as 557follows. Suppose you deleted a piece of text and now you need to 558re-insert it while editing in Insert mode. The key ‘C-y’ will put back 559the most recently deleted chunk. If this is not what you want, type 560‘M-y’ repeatedly and, hopefully, you will find the chunk you want. 561 562 Finally, in Insert and Replace states, Viper provides the history of 563pieces of text inserted in previous insert or replace commands. These 564strings of text can be recovered by repeatedly typing ‘C-c M-p’ or ‘C-c 565M-n’ while in Insert or Replace state. (This feature is disabled in the 566minibuffer: the above keys are usually bound to other histories, which 567are more appropriate in the minibuffer.) 568 569 You can call Meta functions from Insert state. As in Vi state, the 570Meta key is ‘C-\’. Thus ‘M-x’ is typed as ‘C-\ x’. 571 572 Other Emacs commands that are useful in Insert state are ‘C-e’ and 573‘C-a’, which move the cursor to the end and the beginning of the current 574line, respectively. You can also use ‘M-f’ and ‘M-b’, which move the 575cursor forward (or backward) one word. If your display has a Meta key, 576these functions are invoked by holding the Meta key and then typing ‘f’ 577and ‘b’, respectively. On displays without the Meta key, these 578functions are invoked by typing ‘C-\ f’ and ‘C-\ b’ (‘C-\’ simulates the 579Meta key in Insert state, as explained above). 580 581 The key ‘C-z’ is sometimes also useful in Insert state: it allows you 582to execute a single command in Vi state without leaving the Insert 583state! For instance, ‘C-z d2w’ will delete the next two words without 584leaving the Insert state. 585 586 When Viper is in Insert state, you will see <I> in the mode line. 587 588 589File: viper.info, Node: Replace State, Prev: Insert State, Up: States in Viper 590 5911.3.4 Replace State 592------------------- 593 594This state is entered through Vi replacement commands, such as ‘C’, 595‘cw’, etc., or by typing ‘R’. In Replace state, Viper puts <R> in the 596mode line to let you know which state is in effect. If Replace state is 597entered through ‘R’, Viper stays in that state until the user hits 598<ESC>. If this state is entered via the other replacement commands, 599then Replace state is in effect until you hit <ESC> or until you cross 600the rightmost boundary of the replacement region. In the latter case, 601Viper changes its state from Replace to Insert (which you will notice by 602the change in the mode line). 603 604 Since Viper runs under Emacs, it is possible to switch between 605buffers while in Replace state. You can also move the cursor using the 606arrow keys (even on dumb terminals!) and the mouse. Because of this 607freedom (which is unattainable in regular Vi), it is possible to take 608the cursor outside the replacement region. (This may be necessary for 609several reasons, including the need to enable text selection and 610region-setting with the mouse.) 611 612 The issue then arises as to what to do when the user hits the <ESC> 613key. In Vi, this would cause the text between cursor and the end of the 614replacement region to be deleted. But what if, as is possible in Viper, 615the cursor is not inside the replacement region? 616 617 To solve the problem, Viper keeps track of the last cursor position 618while it was still inside the replacement region. So, in the above 619situation, Viper would delete text between this position and the end of 620the replacement region. 621 622 623File: viper.info, Node: The Minibuffer, Next: Multiple Files in Viper, Prev: States in Viper, Up: Overview 624 6251.4 The Minibuffer 626================== 627 628The minibuffer is where commands are entered in. Editing can be done by 629commands from Insert state, namely: 630 631‘C-h’ 632 Backspace 633‘C-w’ 634 Delete Word 635‘C-u’ 636 Erase line 637‘C-v’ 638 Quote the following character 639‘<RET>’ 640 Execute command 641‘C-g and C-]’ 642 Emacs quit and abort keys. These may be necessary. *Note Vi 643 State::, for an explanation. 644‘M-p and M-n’ 645 These keys are bound to functions that peruse minibuffer history. 646 The precise history to be perused depends on the context. It may 647 be the history of search strings, Ex commands, file names, etc. 648‘C-s’ 649 If the minibuffer is entered via the Viper search commands ‘/’ or 650 ‘?’, then this key inserts the last search string used by the Emacs 651 incremental search command (which is bound to ‘C-s’ everywhere 652 except in this case). 653 654 Most of the Emacs keys are functional in the minibuffer. While in 655the minibuffer, Viper tries to make editing resemble Vi’s behavior when 656the latter is waiting for the user to type an Ex command. In 657particular, you can use the regular Vi commands to edit the minibuffer. 658You can switch between the Vi state and Insert state at will, and even 659use the replace mode. Initially, the minibuffer comes up in Insert 660state. 661 662 Some users prefer plain Emacs bindings in the minibuffer. To this 663end, set ‘viper-vi-style-in-minibuffer’ to ‘nil’ in your Viper 664customization file. *Note Customization::, to learn how to do this. 665 666 When the minibuffer changes Viper states, you will notice that the 667appearance of the text there changes as well. This is useful because 668the minibuffer has no mode line to tell which Vi state it is in. The 669appearance of the text in the minibuffer can be changed. *Note Viper 670Specials::, for more details. 671 672 673File: viper.info, Node: Multiple Files in Viper, Next: Unimplemented Features, Prev: The Minibuffer, Up: Overview 674 6751.5 Multiple Files in Viper 676=========================== 677 678Viper can edit multiple files. This means, for example that you never 679need to suffer through ‘No write since last change’ errors. Some Viper 680elements are common over all the files. 681 682‘Textmarkers’ 683 Textmarkers remember _files and positions_. If you set marker ‘a’ 684 in file ‘foo’, start editing file ‘bar’ and type ‘'a’, then _YOU 685 WILL SWITCH TO FILE ‘foo’_. You can see the contents of a 686 textmarker using the Viper command ‘[<a-z>’ where <a-z> are the 687 textmarkers, e.g., ‘[a’ to view marker ‘a’ . 688‘Repeated Commands’ 689 Command repetitions are common over files. Typing ‘!!’ will repeat 690 the last ‘!’ command whichever file it was issued from. Typing ‘.’ 691 will repeat the last command from any file, and searches will 692 repeat the last search. Ex commands can be repeated by typing ‘: 693 <RET>’. Note: in some rare cases, that ‘: <RET>’ may do something 694 dangerous. However, usually its effect can be undone by typing 695 ‘u’. 696‘Registers’ 697 Registers are common to files. Also, text yanked with ‘y’ can be 698 put back (‘p’) into any file. The Viper command ‘]<a-z>’, where 699 <a-z> are the registers, can be used to look at the contents of a 700 register, e.g., type ‘]a’ to view register ‘a’. 701 702 There is one difference in text deletion that you should be aware 703 of. This difference comes from Emacs and was adopted in Viper 704 because we find it very useful. In Vi, if you delete a line, say, 705 and then another line, these two deletions are separated and are 706 put back separately if you use the ‘p’ command. In Emacs (and 707 Viper), successive series of deletions that are _not interrupted_ 708 by other commands are lumped together, so the deleted text gets 709 accumulated and can be put back as one chunk. If you want to break 710 a sequence of deletions so that the newly deleted text could be put 711 back separately from the previously deleted text, you should 712 perform a non-deleting action, e.g., move the cursor one character 713 in any direction. 714‘Absolute Filenames’ 715 The current directory name for a file is automatically prepended to 716 the file name in any ‘:e’, ‘:r’, ‘:w’, etc., command (in Emacs, 717 each buffer has a current directory). This directory is inserted 718 in the minibuffer once you type space after ‘:e, r’, etc. Viper 719 also supports completion of file names and Ex commands (<TAB>), and 720 it keeps track of command and file history (‘M-p’, ‘M-n’). 721 Absolute filenames are required less often in Viper. 722 723 You should be aware that Emacs interprets ‘/foo/bar//bla’ as ‘/bla’ 724 and ‘/foo/~/bar’ as ‘~/bar’. This is designed to minimize the need 725 for erasing file names that Emacs suggests in its prompts, if a 726 suggested file name is not what you wanted. 727 728 The command ‘:cd’ will change the default directory for the current 729 Emacs buffer. The Ex command ‘:e’ will interpret the filename 730 argument in ‘csh’, by default. *Note Customization::, if you want 731 to change this. 732 733Currently undisplayed files can be listed using the ‘:ar’ command. The 734command ‘:n’ can be given counts from the ‘:ar’ list to switch to other 735files. For example, use ‘:n3’ to move to the third file in that list. 736 737 738File: viper.info, Node: Unimplemented Features, Prev: Multiple Files in Viper, Up: Overview 739 7401.6 Unimplemented Features 741========================== 742 743Unimplemented features include: 744 745 • ‘:ab’ and ‘:una’ are not implemented, since ‘:ab’ is considered 746 obsolete, since Emacs has much more powerful facilities for 747 defining abbreviations. 748 • ‘:set option?’ is not implemented. The current ‘:set’ can also be 749 used to set Emacs variables. 750 • ‘:se list’ requires modification of the display code for Emacs, so 751 it is not implemented. A useful alternative is ‘cat -t -e file’. 752 Unfortunately, it cannot be used directly inside Emacs, since Emacs 753 will obdurately change ‘^I’ back to normal tabs. 754 755 756File: viper.info, Node: Improvements over Vi, Next: Customization, Prev: Overview, Up: Top 757 7582 Improvements over Vi 759********************** 760 761Some common problems with Vi and Ex have been solved in Viper. This 762includes better implementation of existing commands, new commands, and 763the facilities provided by Emacs. 764 765* Menu: 766 767* Basics:: Basic Viper differences, Multi-file effects. 768* Undo and Backups:: Multiple undo, auto-save, backups and changes 769* History:: History for Ex and Vi commands. 770* Macros and Registers:: Keyboard Macros (extended ".") @reg execution. 771* Completion:: Filename and Command Completion for Ex. 772* Improved Search:: Incremental Search and Buffer Content Search. 773* Abbreviation Facilities:: Normal Abbrevs, Templates, and Dynamic Abbrevs. 774* Movement and Markers:: Screen Editor movements, viewing textmarkers. 775* New Commands:: Commands that do not exist in Vi. 776* Useful Packages:: A Sampling of some Emacs packages, and things 777 you should know about. 778 779 780File: viper.info, Node: Basics, Next: Undo and Backups, Up: Improvements over Vi 781 7822.1 Basics 783========== 784 785The Vi command set is based on the idea of combining motion commands 786with other commands. The motion command is used as a text region 787specifier for other commands. We classify motion commands into “point 788commands” and “line commands”. 789 790 The point commands are: 791 792 ‘h’, ‘l’, ‘0’, ‘$’, ‘w’, ‘W’, ‘b’, ‘B’, ‘e’, ‘E’, ‘(’, ‘)’, ‘/’, 793 ‘?’, ‘`’, ‘f’, ‘F’, ‘t’, ‘T’, ‘%’, ‘;’, ‘,’, ‘^’ 794 795 The line commands are: 796 797 ‘j’, ‘k’, ‘+’, ‘-’, ‘H’, ‘M’, ‘L’, ‘{’, ‘}’, ‘G’, ‘'’, ‘[[’, ‘]]’, 798 ‘[]’ 799 800If a point command is given as an argument to a modifying command, the 801region determined by the point command will be affected by the modifying 802command. On the other hand, if a line command is given as an argument 803to a modifying command, the region determined by the line command will 804be enlarged so that it will become the smallest region properly 805containing the region and consisting of whole lines (we call this 806process “expanding the region”), and then the enlarged region will be 807affected by the modifying command. Text Deletion Commands (*note 808Deleting Text::), Change commands (*note Changing Text::), even Shell 809Commands (*note Shell Commands::) use these commands to describe a 810region of text to operate on. Thus, type ‘dw’ to delete a word, ‘>}’ to 811shift a paragraph, or ‘!'afmt’ to format a region from ‘point’ to 812textmarker ‘a’. 813 814 Viper adds the region specifiers ‘r’ and ‘R’. Emacs has a special 815marker called “mark”. The text-area between the current cursor position 816“point” and the “mark” is called the “region”. ‘r’ specifies the raw 817region and ‘R’ is the expanded region (i.e., the minimal contiguous 818chunk of full lines that contains the raw region). ‘dr’ will now delete 819the region, ‘>r’ will shift it, etc. ‘r,R’ are not motion commands, 820however. The special mark is set by ‘m.’ and other commands. *Note 821Marking::, for more info. 822 823 Viper also adds counts to most commands for which it would make 824sense. 825 826 In the Overview chapter, some Multiple File issues were discussed 827(*note Multiple Files in Viper::). In addition to the files, Emacs has 828buffers. These can be seen in the ‘:args’ list and switched using 829‘:next’ if you type ‘:set ex-cycle-through-non-files t’, or specify 830‘(setq ex-cycle-through-non-files t)’ in your Viper customization file. 831*Note Customization::, for details. 832 833 834File: viper.info, Node: Undo and Backups, Next: History, Prev: Basics, Up: Improvements over Vi 835 8362.2 Undo and Backups 837==================== 838 839Viper provides multiple undo. The number of undo’s and the size is 840limited by the machine. The Viper command ‘u’ does an undo. Undo can 841be repeated by typing ‘.’ (a period). Another ‘u’ will undo the undo, 842and further ‘.’ will repeat it. Typing ‘u’ does the first undo, and 843changes the direction. 844 845 Since the undo size is limited, Viper can create backup files and 846auto-save files. It will normally do this automatically. It is 847possible to have numbered backups, etc. For details, *note Backup and 848Auto-Save: (emacs)Backup. 849 850 The results of the 9 previous changes are available in the 9 numeric 851registers, as in Vi. The extra goody is the ability to _view_ these 852registers, in addition to being able to access them through ‘p’ and 853‘M-y’ (*Note Insert State::, for details.) The Viper command ‘] 854register’ will display the contents of any register, numeric or 855alphabetical. The related command ‘[ textmarker’ will show the text 856around the textmarker. ‘register’ and ‘textmarker’ can be any letters 857from a through z. 858 859 860File: viper.info, Node: History, Next: Macros and Registers, Prev: Undo and Backups, Up: Improvements over Vi 861 8622.3 History 863=========== 864 865History is provided for Ex commands, Vi searches, file names, pieces of 866text inserted in earlier commands that use Insert or Replace state, and 867for destructive commands in Vi state. These are useful for fixing those 868small typos that screw up searches and ‘:s’, and for eliminating routine 869associated with repeated typing of file names or pieces of text that 870need to be inserted frequently. At the ‘:’ or ‘/’ prompts in the 871minibuffer, you can do the following: 872 873‘M-p and M-n’ 874 To move to previous and next history items. This causes the 875 history items to appear on the command line, where you can edit 876 them, or simply type Return to execute. 877‘M-r and M-s’ 878 To search backward and forward through the history. 879‘<RET>’ 880 Type <RET> to accept a default (which is displayed in the prompt). 881 882 The history of insertions can be perused by typing ‘C-c M-p’ and ‘C-c 883M-n’ while in Insert or Replace state. The history of destructive Vi 884commands can be perused via the same keys when Viper is in Vi state. 885*Note Viper Specials::, for details. 886 887 All Ex commands have a file history. For instance, typing ‘:e’, 888space and then ‘M-p’ will bring up the name of the previously typed file 889name. Repeatedly typing ‘M-p’, ‘M-n’, etc., will let you browse through 890the file history. 891 892 Similarly, commands that have to do with switching buffers have a 893buffer history, and commands that expect strings or regular expressions 894keep a history on those items. 895 896 897File: viper.info, Node: Macros and Registers, Next: Completion, Prev: History, Up: Improvements over Vi 898 8992.4 Macros and Registers 900======================== 901 902Viper facilitates the use of Emacs-style keyboard macros. ‘@#’ will 903start a macro definition. As you type, the commands will be executed, 904and remembered (This is called “learn mode” in some editors.) 905‘@register’ will complete the macro, putting it into ‘register’, where 906‘register’ is any character from ‘a’ through ‘z’. Then you can execute 907this macro using ‘@register’. It is, of course, possible to yank some 908text into a register and execute it using ‘@register’. Typing ‘@@’, 909‘@<RET>’, or ‘@C-j’ will execute the last macro that was executed using 910‘@register’. 911 912 Viper will automatically lowercase the register, so that pressing the 913‘SHIFT’ key for ‘@’ will not create problems. This is for ‘@’ macros 914and ‘"p’ _only_. In the case of ‘y’, ‘"Ayy’ will append to _register 915a_. For ‘[,],',`’, it is an error to use a Uppercase register name. 916 917 The contents of a register can be seen by ‘]register’. 918(‘[textmarker’ will show the contents of a textmarker). 919 920 The last keyboard macro can also be executed using ‘*’, and it can be 921yanked into a register using ‘@!register’. This is useful for Emacs 922style keyboard macros defined using ‘C-x(’ and ‘C-x)’. Emacs keyboard 923macros have more capabilities. *Note Keyboard Macros: (emacs)Keyboard 924Macros, for details. 925 926 Keyboard Macros allow an interesting form of Query-Replace: 927‘/pattern’ or ‘n’ to go to the next pattern (the query), followed by a 928Keyboard Macro execution ‘@@’ (the replace). 929 930 Viper also provides Vi-style macros. *Note Vi Macros::, for details. 931 932 933File: viper.info, Node: Completion, Next: Improved Search, Prev: Macros and Registers, Up: Improvements over Vi 934 9352.5 Completion 936============== 937 938Completion is done when you type <TAB>. The Emacs completer does not 939grok wildcards in file names. Once you type a wildcard, the completer 940will no longer work for that file name. Remember that Emacs interprets 941a file name of the form ‘/foo//bar’ as ‘/bar’ and ‘/foo/~/bar’ as 942‘~/bar’. 943 944 945File: viper.info, Node: Improved Search, Next: Abbreviation Facilities, Prev: Completion, Up: Improvements over Vi 946 9472.6 Improved Search 948=================== 949 950Viper provides buffer search, the ability to search the buffer for a 951region under the cursor. You have to turn this on in your Viper 952customization file either by calling 953 954 (viper-buffer-search-enable) 955 956or by setting ‘viper-buffer-search-char’ to, say, ‘f3’: 957 (setq viper-buffer-search-char ?g) 958 959If the user calls ‘viper-buffer-search-enable’ explicitly (the first 960method), then ‘viper-buffer-search-char’ will be set to ‘g’. Regardless 961of how this feature is enabled, the key ‘viper-buffer-search-char’ will 962take movement commands, like ‘w,/,e’, to find a region and then search 963for the contents of that region. This command is very useful for 964searching for variable names, etc., in a program. The search can be 965repeated by ‘n’ or reversed by ‘N’. 966 967 Emacs provides incremental search. As you type the string in, the 968cursor will move to the next match. You can snarf words from the buffer 969as you go along. Incremental Search is normally bound to ‘C-s’ and 970‘C-r’. *Note Customization::, to find out how to change the bindings of 971‘C-r or C-s’. For details, *note Incremental Search: (emacs)Incremental 972Search. 973 974 Viper also provides a query replace function that prompts through the 975minibuffer. It is invoked by the ‘Q’ key in Vi state. 976 977 On a window display, Viper supports mouse search, i.e., you can 978search for a word by clicking on it. *Note Viper Specials::, for 979details. 980 981 Finally, on a window display, Viper highlights search patterns as it 982finds them. This is done through what is known as _faces_ in Emacs. 983The variable that controls how search patterns are highlighted is 984‘viper-search-face’. If you don’t want any highlighting at all, put 985 (copy-face 'default 'viper-search-face) 986in your Viper customization file. If you want to change how patterns 987are highlighted, you will have to change ‘viper-search-face’ to your 988liking. The easiest way to do this is to use Emacs customization 989widget, which is accessible from the menubar. Viper customization group 990is located under the _Emulations_ customization group, which in turn is 991under the _Editing_ group (or simply by typing ‘:customize’). All Viper 992faces are grouped together under Viper’s _Highlighting_ group. 993 994 Try it: it is really simple! 995 996 997File: viper.info, Node: Abbreviation Facilities, Next: Movement and Markers, Prev: Improved Search, Up: Improvements over Vi 998 9992.7 Abbreviation Facilities 1000=========================== 1001 1002It is possible in Emacs to define abbrevs based on the contents of the 1003buffer. Sophisticated templates can be defined using the Emacs 1004abbreviation facilities. *Note Abbreviations: (emacs)Abbrevs, for 1005details. 1006 1007 Emacs also provides Dynamic Abbreviations. Given a partial word, 1008Emacs will search the buffer to find an extension for this word. For 1009instance, one can type ‘Abbreviations’ by typing ‘A’, followed by a 1010keystroke that completed the ‘A’ to ‘Abbreviations’. Repeated typing 1011will search further back in the buffer, so that one could get ‘Abbrevs’ 1012by repeating the keystroke, which appears earlier in the text. Emacs 1013binds this to ‘<ESC> /’, so you will have to find a key and bind the 1014function ‘dabbrev-expand’ to that key. Facilities like this make Vi’s 1015‘:ab’ command obsolete. 1016 1017 1018File: viper.info, Node: Movement and Markers, Next: New Commands, Prev: Abbreviation Facilities, Up: Improvements over Vi 1019 10202.8 Movement and Markers 1021======================== 1022 1023Viper can be set free from the line-limited movements in Vi, such as ‘l’ 1024refusing to move beyond the line, <ESC> moving one character back, etc. 1025These derive from Ex, which is a line editor. If your Viper 1026customization file contains 1027 1028 (setq viper-ex-style-motion nil) 1029 1030the motion will be a true screen editor motion. One thing you must then 1031watch out for is that it is possible to be on the end-of-line character. 1032The keys ‘x’ and ‘%’ will still work correctly, i.e., as if they were on 1033the last character. 1034 1035 The word-movement commands ‘w’, ‘e’, etc., and the associated 1036deletion/yanking commands, ‘dw’, ‘yw’, etc., can be made to understand 1037Emacs syntax tables. If the variable ‘viper-syntax-preference’ is set 1038to ‘strict-vi’ then the meaning of _word_ is the same as in Vi. 1039However, if the value is ‘reformed-vi’ (the default) then the 1040alphanumeric symbols will be those specified by the current Emacs syntax 1041table (which may be different for different major modes) plus the 1042underscore symbol ‘_’, minus some non-word symbols, like ’.;,|, etc. 1043Both ‘strict-vi’ and ‘reformed-vi’ work close to Vi in traditional 1044cases, but ‘reformed-vi’ does a better job when editing text in 1045non-Latin alphabets. 1046 1047 The user can also specify the value ‘emacs’, which would make Viper 1048use exactly the Emacs notion of word. In particular, the underscore may 1049not be part of a word. Finally, if ‘viper-syntax-preference’ is set to 1050‘extended’, Viper words would consist of characters that are classified 1051as alphanumeric _or_ as parts of symbols. This is convenient for 1052writing programs and in many other situations. 1053 1054 ‘viper-syntax-preference’ is a local variable, so it can have 1055different values for different major modes. For instance, in 1056programming modes it can have the value ‘extended’. In text modes where 1057words contain special characters, such as European (non-English) 1058letters, Cyrillic letters, etc., the value can be ‘reformed-vi’ or 1059‘emacs’. 1060 1061 Changes to ‘viper-syntax-preference’ should be done in the hooks to 1062various major modes by executing ‘viper-set-syntax-preference’ as in the 1063following example: 1064 1065 (viper-set-syntax-preference nil "emacs") 1066 1067 The above discussion of the meaning of Viper’s words concerns only 1068Viper’s movement commands. In regular expressions, words remain the 1069same as in Emacs. That is, the expressions ‘\w’, ‘\>’, ‘\<’, etc., use 1070Emacs’s idea of what is a word, and they don’t look into the value of 1071variable ‘viper-syntax-preference’. This is because Viper doesn’t 1072change syntax tables in fear of upsetting the various major modes that 1073set these tables. 1074 1075 Textmarkers in Viper remember the file and the position, so that you 1076can switch files by simply doing ‘'a’. If you set up a regimen for 1077using Textmarkers, this is very useful. Contents of textmarkers can be 1078viewed by ‘[marker’. (Contents of registers can be viewed by 1079‘]register’). 1080 1081 1082File: viper.info, Node: New Commands, Next: Useful Packages, Prev: Movement and Markers, Up: Improvements over Vi 1083 10842.9 New Commands 1085================ 1086 1087These commands have no Vi analogs. 1088 1089‘C-x, C-c’ 1090 These two keys invoke many important Emacs functions. For example, 1091 if you hit ‘C-x’ followed by ‘2’, then the current window will be 1092 split into 2. Except for novice users, ‘C-c’ is also set to 1093 execute an Emacs command from the current major mode. <ESC> will 1094 do the same, if you configure <ESC> as Meta by setting 1095 ‘viper-no-multiple-ESC’ to ‘nil’ in your Viper customization file. 1096 *Note Customization::. ‘C-\’ in Insert, Replace, or Vi states will 1097 make Emacs think ‘Meta’ has been hit. 1098‘\’ 1099 Escape to Emacs to execute a single Emacs command. For instance, 1100 ‘\ <ESC>’ will act like a Meta key. 1101‘Q’ 1102 ‘Q’ is for query replace. By default, each string to be replaced 1103 is treated as a regular expression. You can use ‘(setq 1104 viper-re-query-replace nil)’ in your ‘.emacs’ file to turn this 1105 off. (For normal searches, ‘:se nomagic’ will work. Note that 1106 ‘:se nomagic’ turns Regexps off completely, unlike Vi). 1107‘v’ 1108‘V’ 1109‘C-v’ 1110 These keys are used to visit files. ‘v’ will switch to a buffer 1111 visiting file whose name can be entered in the minibuffer. ‘V’ is 1112 similar, but will use a window different from the current window. 1113 ‘C-v’ is like ‘V’, except that a new frame (X window) will be used 1114 instead of a new Emacs window. 1115‘#’ 1116 If followed by a certain character CH, it becomes an operator whose 1117 argument is the region determined by the motion command that 1118 follows (indicated as <move>). Currently, CH can be one of ‘c’, 1119 ‘C’, ‘g’, ‘q’, and ‘s’. For instance, ‘#qr’ will prompt you for a 1120 string and then prepend this string to each line in the buffer. 1121‘# c’ 1122 Change upper-case characters in the region to lower-case 1123 (‘downcase-region’). Emacs command ‘M-l’ does the same for words. 1124‘# C’ 1125 Change lower-case characters in the region to upper-case. For 1126 instance, ‘# C 3 w’ will capitalize 3 words from the current point 1127 (‘upcase-region’). Emacs command ‘M-u’ does the same for words. 1128‘# g’ 1129 Execute last keyboard macro for each line in the region 1130 (‘viper-global-execute’). 1131‘# q’ 1132 Insert specified string at the beginning of each line in the region 1133 (‘viper-quote-region’). The default string is composed of the 1134 comment character(s) appropriate for the current major mode. 1135‘# s’ 1136 Check spelling of words in the region (‘spell-region’). The 1137 function used for spelling is determined from the variable 1138 ‘viper-spell-function’. 1139‘*’ 1140 Call last keyboard macro. 1141‘m .’ 1142 Set mark at point and push old mark off the ring 1143‘m<’ 1144‘m>’ 1145 Set mark at beginning and end of buffer, respectively. 1146‘m,’ 1147 Jump to mark and pop mark off the ring. *Note Mark: (emacs)Mark, 1148 for more info. 1149‘] register’ 1150 View contents of register 1151‘[ textmarker’ 1152 View filename and position of textmarker 1153‘@#’ 1154‘@register’ 1155‘@!’ 1156 1157 Begin/end keyboard macro. @register has a different meaning when 1158 used after a ‘@#’. *Note Macros and Registers::, for details 1159‘[]’ 1160 Go to end of heading. 1161‘g <_movement command_>’ 1162 Search buffer for text delimited by movement command. The 1163 canonical example is ‘gw’ to search for the word under the cursor. 1164 *Note Improved Search::, for details. 1165‘C-g and C-]’ 1166 Quit and Abort Recursive edit. These may be necessary on occasion. 1167 *Note Vi State::, for a reason. 1168‘C-c C-g’ 1169 Hitting ‘C-c’ followed by ‘C-g’ will display the information on the 1170 current buffer. This is the same as hitting ‘C-g’ in Vi, but, as 1171 explained above, ‘C-g’ is needed for other purposes in Emacs. 1172‘C-c /’ 1173 Without a prefix argument, this command toggles 1174 case-sensitive/case-insensitive search modes and plain 1175 vanilla/regular expression search. With the prefix argument 1, 1176 i.e., ‘1 C-c /’, this toggles case-sensitivity; with the prefix 1177 argument 2, toggles plain vanilla search and search using regular 1178 expressions. *Note Viper Specials::, for alternative ways to 1179 invoke this function. 1180 1181‘M-p and M-n’ 1182 In the minibuffer, these commands navigate through the minibuffer 1183 histories, such as the history of search strings, Ex commands, etc. 1184 1185‘C-s’ 1186 If the minibuffer is entered via a Viper search commands ‘/’ or 1187 ‘?’, then typing this key inserts the last search string used by 1188 the Emacs incremental search command (that is bound to ‘C-s’ 1189 everywhere except in this case). 1190 1191‘C-c M-p and C-c M-n’ 1192 1193 In Insert or Replace state, these commands let the user peruse the 1194 history of insertion strings used in previous insert or replace 1195 commands. Try to hit ‘C-c M-p’ or ‘C-c M-n’ repeatedly and see 1196 what happens. *Note Viper Specials::, for more. 1197 1198 In Vi state, these commands let the user peruse the history of 1199 Vi-style destructive commands, such as ‘dw’, ‘J’, ‘a’, etc. By 1200 repeatedly typing ‘C-c M-p’ or ‘C-c M-n’ you will cycle Viper 1201 through the recent history of Vi commands, displaying the commands 1202 one by one. Once an appropriate command is found, it can be 1203 executed by typing a period. 1204 1205 Since typing ‘C-c M-p’ is tedious, it is more convenient to bind an 1206 appropriate function to a function key on the keyboard and use that 1207 key. *Note Viper Specials::, for details. 1208 1209‘Ex commands’ 1210 The commands ‘:args’, ‘:next’, ‘:pre’ behave differently. ‘:pwd’ 1211 exists to get current directory. The commands ‘:b’ and ‘:B’ switch 1212 buffers around. *Note File and Buffer Handling::, for details. 1213 There are also the new commands ‘:RelatedFile’ and 1214 ‘PreviousRelatedFile’ (which abbreviate to ‘R’ and ‘P’, 1215 respectively. *Note Viper Specials::, for details. 1216 1217 Apart from the new commands, many old commands have been enhanced. 1218Most notably, Vi style macros are much more powerful in Viper than in 1219Vi. *Note Vi Macros::, for details. 1220 1221 1222File: viper.info, Node: Useful Packages, Prev: New Commands, Up: Improvements over Vi 1223 12242.10 Useful Packages 1225==================== 1226 1227Some Emacs packages are mentioned here as an aid to the new Viper user, 1228to indicate what Viper is capable of. A vast number comes with the 1229standard Emacs distribution, and many more exist on the net and on the 1230archives. 1231 1232 This manual also mentions some Emacs features a new user should know 1233about. The details of these are found in the GNU Emacs Manual. 1234 1235 The features first. For details, look up the Emacs Manual. 1236 1237‘Make’ 1238 1239 Makes and Compiles can be done from the editor. Error messages 1240 will be parsed and you can move to the error lines. 1241‘Shell’ 1242 You can talk to Shells from inside the editor. Your entire shell 1243 session can be treated as a file. 1244‘Mail’ 1245 Mail can be read from and sent within the editor. Several 1246 sophisticated packages exist. 1247‘Language Sensitive Editing’ 1248 Editing modes are written for most computer languages in existence. 1249 By controlling indentation, they catch punctuation errors. 1250 1251 The packages, below, represents a drop in the sea of special-purpose 1252packages that come with standard distribution of Emacs. 1253 1254‘Transparent FTP’ 1255 ‘ange-ftp.el’ can ftp from the editor to files on other machines 1256 transparent to the user. 1257‘RCS Interfaces’ 1258 ‘vc.el’ for doing RCS commands from inside the editor 1259‘Directory Editor’ 1260 ‘dired.el’ for editing contents of directories and for navigating 1261 in the file system. 1262‘Syntactic Highlighting’ 1263 ‘font-lock.el’ for automatic highlighting various parts of a buffer 1264 using different fonts and colors. 1265‘Saving Emacs Configuration’ 1266 ‘desktop.el’ for saving/restoring configuration on Emacs 1267 exit/startup. 1268‘Spell Checker’ 1269 ‘ispell.el’ for spell checking the buffer, words, regions, etc. 1270‘File and Buffer Comparison’ 1271 ‘ediff.el’ for finding differences between files and for applying 1272 patches. 1273 1274Emacs Lisp archives exist on ‘archive.cis.ohio-state.edu’ and 1275‘wuarchive.wustl.edu’ 1276 1277 1278File: viper.info, Node: Customization, Next: Commands, Prev: Improvements over Vi, Up: Top 1279 12803 Customization 1281*************** 1282 1283Customization can be done in 2 ways. 1284 1285 • Elisp code in a ‘~/.emacs.d/viper’ (or ‘~/.viper’) file. Viper 1286 loads this file just before it does the binding for mode hooks. 1287 This is recommended for experts only. 1288 • Elisp code in your ‘.emacs’ file before and after the ‘(require 1289 'viper)’ line. This method is _not_ recommended, unless you know 1290 what you are doing. Only two variables, ‘viper-mode’ and 1291 ‘viper-custom-file-name’, are supposed to be customized in 1292 ‘.emacs’, prior to loading Viper (i.e., prior to ‘(require 'viper)’ 1293 command. 1294 • By executing the ‘:customize’ Ex command. This takes you to the 1295 Emacs customization widget, which lets you change the values of 1296 Viper customizable variables easily. This method is good for 1297 novice and experts alike. The customization code in the form of 1298 Lisp commands will be placed in ‘~/.emacs’ or some other 1299 customization file depending on the version of Emacs that you use. 1300 Still, it is recommended to separate Viper-related customization 1301 produced by the Emacs customization widget and keep it in your 1302 Viper customization file. 1303 1304 Some advanced customization cannot be accomplished this way, 1305 however, and has to be done in Emacs Lisp in your Viper 1306 customization file. For the common cases, examples are provided 1307 that you can use directly. 1308 1309* Menu: 1310 1311* Rudimentary Changes:: Simple constant definitions. 1312* Key Bindings:: Enabling Emacs Keys, Rebinding keys, etc. 1313* Packages that Change Keymaps:: How to deal with such beasts. 1314* Viper Specials:: Special Viper commands. 1315* Vi Macros:: How to do Vi style macros. 1316 1317 1318File: viper.info, Node: Rudimentary Changes, Next: Key Bindings, Up: Customization 1319 13203.1 Rudimentary Changes 1321======================= 1322 1323An easy way to customize Viper is to change the values of constants used 1324in Viper. Here is the list of the constants used in Viper and their 1325default values. The corresponding :se command is also indicated. (The 1326symbols ‘t’ and ‘nil’ represent “true” and “false” in Lisp). 1327 1328 Viper supports both the abbreviated Vi variable names and their full 1329names. Variable completion is done on full names only. <TAB> and <SPC> 1330complete variable names. Typing ‘=’ will complete the name and then 1331will prompt for a value, if applicable. For instance, ‘:se au <SPC>’ 1332will complete the command to ‘:set autoindent’; ‘:se ta <SPC>’ will 1333complete the command and prompt further like this: ‘:set tabstop = ’. 1334However, typing ‘:se ts <SPC>’ will produce a “No match” message because 1335‘ts’ is an abbreviation for ‘tabstop’ and Viper supports completion on 1336full names only. However, you can still hit <RET> or ‘=’, which will 1337complete the command like this: ‘:set ts = ’ and Viper will be waiting 1338for you to type a value for the tabstop variable. To get the full list 1339of Vi variables, type ‘:se <SPC> <TAB>’. 1340 1341‘viper-auto-indent nil’ 1342‘:se ai (:se autoindent)’ 1343‘:se ai-g (:se autoindent-global)’ 1344 If ‘t’, enable auto indentation. by <RET>, ‘o’ or ‘O’ command. 1345 1346 ‘viper-auto-indent’ is a local variable. To change the value 1347 globally, use ‘setq-default’. It may be useful for certain major 1348 modes to have their own values of ‘viper-auto-indent’. This can be 1349 achieved by using ‘setq’ to change the local value of this variable 1350 in the hooks to the appropriate major modes. 1351 1352 ‘:se ai’ changes the value of ‘viper-auto-indent’ in the current 1353 buffer only; ‘:se ai-g’ does the same globally. 1354‘viper-electric-mode t’ 1355 If not ‘nil’, auto-indentation becomes electric, which means that 1356 <RET>, ‘O’, and ‘o’ indent cursor according to the current major 1357 mode. In the future, this variable may control additional electric 1358 features. 1359 1360 This is a local variable: ‘setq’ changes the value of this variable 1361 in the current buffer only. Use ‘setq-default’ to change the value 1362 in all buffers. 1363‘viper-case-fold-search nil’ 1364‘:se ic (:se ignorecase)’ 1365 If not ‘nil’, search ignores cases. This can also be toggled by 1366 quickly hitting ‘/’ twice. 1367‘viper-re-search nil’ 1368‘:se magic’ 1369 If not ‘nil’, search will use regular expressions; if ‘nil’ then 1370 use vanilla search. This behavior can also be toggled by quickly 1371 hitting ‘/’ trice. 1372‘buffer-read-only’ 1373‘:se ro (:se readonly)’ 1374 Set current buffer to read only. To change globally put 1375 ‘(setq-default buffer-read-only t)’ in your ‘.emacs’ file. 1376‘blink-matching-paren t’ 1377‘:se sm (:se showmatch)’ 1378 Show matching parens by blinking cursor. 1379‘tab-width t (default setting via setq-default)’ 1380‘:se ts=value (:se tabstop=value)’ 1381‘:se ts-g=value (:se tabstop-global=value)’ 1382 ‘tab-width’ is a local variable that controls the width of the tab 1383 stops. To change the value globally, use ‘setq-default’; for local 1384 settings, use ‘setq’. 1385 1386 The command ‘:se ts’ sets the tab width in the current buffer only; 1387 it has no effect on other buffers. 1388 1389 The command ‘:se ts-g’ sets tab width globally, for all buffers 1390 where the tab is not yet set locally, including the new buffers. 1391 1392 Note that typing <TAB> normally doesn’t insert the tab, since this 1393 key is usually bound to a text-formatting function, 1394 ‘indent-for-tab-command’ (which facilitates programming and 1395 document writing). Instead, the tab is inserted via the command 1396 ‘viper-insert-tab’, which is bound to ‘S-tab’ (shift + tab). 1397 1398 On some non-windowing terminals, Shift doesn’t modify the <TAB> 1399 key, so ‘S-tab’ behaves as if it were <TAB>. In such a case, you 1400 will have to bind ‘viper-insert-tab’ to some other convenient key. 1401 1402‘viper-shift-width 8’ 1403‘:se sw=value (:se shiftwidth=value)’ 1404 The number of columns shifted by ‘>’ and ‘<’ commands. 1405‘viper-search-wrap-around t’ 1406‘:se ws (:se wrapscan)’ 1407 If not ‘nil’, search wraps around the end/beginning of buffer. 1408‘viper-search-scroll-threshold 2’ 1409 If search lands within this many lines of the window top or bottom, 1410 the window will be scrolled up or down by about 1/7-th of its size, 1411 to reveal the context. If the value is negative, don’t scroll. 1412‘viper-tags-file-name "TAGS"’ 1413 The name of the file used as the tag table. 1414‘viper-re-query-replace nil’ 1415 If not ‘nil’, use reg-exp replace in query replace. 1416‘viper-want-ctl-h-help nil’ 1417 If not ‘nil’, ‘C-h’ is bound to ‘help-command’; otherwise, ‘C-h’ is 1418 bound as usual in Vi. 1419‘viper-vi-style-in-minibuffer t’ 1420 If not ‘nil’, Viper provides a high degree of compatibility with Vi 1421 insert mode when you type text in the minibuffer; if ‘nil’, typing 1422 in the minibuffer feels like plain Emacs. 1423‘viper-no-multiple-ESC t’ 1424 If you set this to ‘nil’, you can use <ESC> as Meta in Vi state. 1425 Normally, this is not necessary, since graphical displays have 1426 separate Meta keys (usually on each side of the space bar). On a 1427 dumb terminal, Viper sets this variable to ‘twice’, which is almost 1428 like ‘nil’, except that double <ESC> beeps. This, too, lets <ESC> 1429 to be used as a Meta. 1430‘viper-fast-keyseq-timeout 200’ 1431 Key sequences separated by this many milliseconds are treated as 1432 Vi-style keyboard macros. If the key sequence is defined as such a 1433 macro, it will be executed. Otherwise, it is processed as an 1434 ordinary sequence of typed keys. 1435 1436 Setting this variable too high may slow down your typing. Setting 1437 it too low may make it hard to type macros quickly enough. 1438‘viper-ex-style-motion t’ 1439 Set this to ‘nil’, if you want ‘l,h’ to cross lines, etc. *Note 1440 Movement and Markers::, for more info. 1441‘viper-ex-style-editing t’ 1442 Set this to ‘nil’, if you want ‘C-h’ and <DEL> to not stop at the 1443 beginning of a line in Insert state, ‘X’ and ‘x’ to delete 1444 characters across lines in Vi command state, etc. 1445‘viper-ESC-moves-cursor-back t’ 1446 It ‘t’, cursor moves back 1 character when switching from insert 1447 state to vi state. If ‘nil’, the cursor stays where it was before 1448 the switch. 1449‘viper-always t’ 1450 ‘t’ means: leave it to Viper to decide when a buffer must be 1451 brought up in Vi state, Insert state, or Emacs state. This 1452 heuristics works well in virtually all cases. ‘nil’ means you 1453 either has to invoke ‘viper-mode’ manually for each buffer (or you 1454 can add ‘viper-mode’ to the appropriate major mode hooks using 1455 ‘viper-load-hook’). 1456 1457 This option must be set in your Viper customization file. 1458‘viper-custom-file-name "~/.emacs.d/viper"’ 1459 File used for Viper-specific customization. Change this setting, 1460 if you want. Must be set in ‘.emacs’ before Viper is loaded. Note 1461 that you have to set it as a string inside double quotes. 1462‘viper-spell-function 'ispell-region’ 1463 Function used by the command ‘#c<move>’ to spell. 1464‘viper-glob-function’ 1465 The value of this variable is the function symbol used to expand 1466 wildcard symbols. This is platform-dependent. The default tries 1467 to set this variable to work with most shells, MS Windows, etc. 1468 However, if it doesn’t work the way you expect, you should write 1469 your own. Use ‘viper-glob-unix-files’ and 1470 ‘viper-glob-mswindows-files’ in ‘viper-util.el’ as examples. 1471 1472 This feature is used to expand wildcards in the Ex command ‘:e’. 1473 Note that Viper doesn’t support wildcards in the ‘:r’ and ‘:w’ 1474 commands, because file completion is a better mechanism. 1475 1476‘ex-cycle-other-window t’ 1477 If not ‘nil’, ‘:n’ and ‘:b’ will cycle through files in another 1478 window, if one exists. 1479‘ex-cycle-through-non-files nil’ 1480 ‘:n’ does not normally cycle through buffers. Set this to get 1481 buffers also. 1482‘viper-want-emacs-keys-in-insert’ 1483 This is set to ‘nil’ for user levels 1 and 2 and to ‘t’ for user 1484 levels 3 and 4. Users who specify level 5 are allowed to set this 1485 variable as they please (the default for this level is ‘t’). If 1486 set to ‘nil’, complete Vi compatibility is provided in Insert 1487 state. This is really not recommended, as this precludes you from 1488 using language-specific features provided by the major modes. 1489‘viper-want-emacs-keys-in-vi’ 1490 This is set to ‘nil’ for user level 1 and to ‘t’ for user levels 1491 2–4. At level 5, users are allowed to set this variable as they 1492 please (the default for this level is ‘t’). If set to ‘nil’, 1493 complete Vi compatibility is provided in Vi command state. Setting 1494 this to ‘nil’ is really a bad idea, unless you are a novice, as 1495 this precludes the use of language-specific features provided by 1496 the major modes. 1497‘viper-keep-point-on-repeat t’ 1498 If not ‘nil’, point is not moved when the user repeats the previous 1499 command by typing a period. This is very useful for doing repeated 1500 changes with the ‘.’ key. 1501‘viper-repeat-from-history-key 'f12’ 1502 Prefix key used to invoke the macros ‘f12 1’ and ‘f12 2’ that 1503 repeat the second-last and the third-last destructive command. 1504 Both these macros are bound (as Viper macros) to 1505 ‘viper-repeat-from-history’, which checks the second key by which 1506 it is invoked to see which of the previous commands to invoke. 1507 Viper binds ‘f12 1’ and ‘f12 2’ only, but the user can bind more in 1508 his/her Viper customization file. *Note Vi Macros::, for how to do 1509 this. 1510‘viper-keep-point-on-undo nil’ 1511 If not ‘nil’, Viper tries to not move point when undoing commands. 1512 Instead, it will briefly move the cursor to the place where change 1513 has taken place. However, if the undone piece of text is not seen 1514 in window, then point will be moved to the place where the change 1515 took place. Set it to ‘t’ and see if you like it better. 1516‘viper-delete-backwards-in-replace nil’ 1517 If not ‘nil’, <DEL> key will delete characters while moving the 1518 cursor backwards. If ‘nil’, the cursor will move backwards without 1519 deleting anything. 1520‘viper-replace-overlay-face 'viper-replace-overlay-face’ 1521 On a graphical display, Viper highlights replacement regions 1522 instead of putting a ‘$’ at the end. This variable controls the so 1523 called “face” used to highlight the region. 1524 1525 By default, ‘viper-replace-overlay-face’ underlines the replacement 1526 on monochrome displays and also lays a stipple over them. On color 1527 displays, replacement regions are highlighted with color. 1528 1529 If you know something about Emacs faces and don’t like how Viper 1530 highlights replacement regions, you can change 1531 ‘viper-replace-overlay-face’ by specifying a new face. (Emacs 1532 faces are described in the Emacs Lisp reference.) On a color 1533 display, the following customization method is usually most 1534 effective: 1535 (set-face-foreground viper-replace-overlay-face "DarkSlateBlue") 1536 (set-face-background viper-replace-overlay-face "yellow") 1537 For a complete list of colors available to you, evaluate the 1538 expression ‘(x-defined-colors)’. (Type it in the buffer 1539 ‘*scratch*’ and then hit the ‘C-j’ key. 1540 1541‘viper-replace-overlay-cursor-color "Red"’ 1542 Cursor color when it is inside the replacement region. This has 1543 effect only on color displays and only when Emacs runs as an X 1544 application. 1545‘viper-insert-state-cursor-color nil’ 1546 If set to a valid color, this will be the cursor color when Viper 1547 is in insert state. 1548‘viper-emacs-state-cursor-color nil’ 1549 If set to a valid color, this will be the cursor color when Viper 1550 is in emacs state. 1551‘viper-replace-region-end-delimiter "$"’ 1552 A string used to mark the end of replacement regions. It is used 1553 only on TTYs or if ‘viper-use-replace-region-delimiters’ is 1554 non-‘nil’. 1555‘viper-replace-region-start-delimiter ""’ 1556 A string used to mark the beginning of replacement regions. It is 1557 used only on TTYs or if ‘viper-use-replace-region-delimiters’ is 1558 non-‘nil’. 1559‘viper-use-replace-region-delimiters’ 1560 If non-‘nil’, Viper will always use 1561 ‘viper-replace-region-end-delimiter’ and 1562 ‘viper-replace-region-start-delimiter’ to delimit replacement 1563 regions, even on color displays (where this is unnecessary). By 1564 default, this variable is non-‘nil’ only on TTYs or monochrome 1565 displays. 1566‘viper-allow-multiline-replace-regions t’ 1567 If non-‘nil’, multi-line text replacement regions, such as those 1568 produced by commands ‘c55w’, ‘3C’, etc., will stay around until the 1569 user exits the replacement mode. In this variable is set to ‘nil’, 1570 Viper will emulate the standard Vi behavior, which supports only 1571 intra-line replacement regions (and multi-line replacement regions 1572 are deleted). 1573‘viper-toggle-key "\C-z"’ 1574 Specifies the key used to switch from Emacs to Vi and back. Must 1575 be set in your Viper customization file. This variable can’t be 1576 changed interactively after Viper is loaded. 1577 1578 In Insert state, this key acts as a temporary escape to Vi state, 1579 i.e., it will set Viper up so that the very next command will be 1580 executed as if it were typed in Vi state. 1581‘viper-buffer-search-char nil’ 1582 Key used for buffer search. *Note Viper Specials::, for details. 1583‘viper-surrounding-word-function 'viper-surrounding-word’ 1584 The value of this variable is a function name that is used to 1585 determine what constitutes a word clicked upon by the mouse. This 1586 is used by mouse search and insert. 1587‘viper-search-face 'viper-search-face’ 1588 Variable that controls how search patterns are highlighted when 1589 they are found. 1590‘viper-vi-state-hook nil’ 1591 List of parameterless functions to be run just after entering the 1592 Vi command state. 1593‘viper-insert-state-hook nil’ 1594 Same for Insert state. This hook is also run after entering 1595 Replace state. 1596‘viper-replace-state-hook nil’ 1597 List of (parameterless) functions called just after entering 1598 Replace state (and after all ‘viper-insert-state-hook’). 1599‘viper-emacs-state-hook nil’ 1600 List of (parameterless) functions called just after switching from 1601 Vi state to Emacs state. 1602‘viper-load-hook nil’ 1603 List of (parameterless) functions called just after loading Viper. 1604 This is the last chance to do customization before Viper is up and 1605 running. 1606You can reset some of these constants in Viper with the Ex command 1607‘:set’ (when so indicated in the table). Or you can include a line like 1608this in your Viper customization file: 1609 (setq viper-case-fold-search t) 1610 1611 1612File: viper.info, Node: Key Bindings, Next: Packages that Change Keymaps, Prev: Rudimentary Changes, Up: Customization 1613 16143.2 Key Bindings 1615================ 1616 1617Viper lets you define hot keys, i.e., you can associate keyboard keys 1618such as F1, Help, PgDn, etc., with Emacs Lisp functions (that may 1619already exist or that you will write). Each key has a “preferred form” 1620in Emacs. For instance, the Up key’s preferred form is [up], the Help 1621key’s preferred form is [help], and the Undo key has the preferred form 1622[f14]. You can find out the preferred form of a key by typing ‘M-x 1623describe-key-briefly’ and then typing the key you want to know about. 1624 1625 Under the X Window System, every keyboard key emits its preferred 1626form, so you can just type 1627 1628 (global-set-key [f11] 'calendar) ; L1, Stop 1629 (global-set-key [f14] 'undo) ; L4, Undo 1630 1631to bind L1 (a key that exists on some SUN workstations) so it will 1632invoke the Emacs Calendar and to bind L4 so it will undo changes. 1633However, on a dumb terminal or in an Xterm window, even the standard 1634arrow keys may not emit the right signals for Emacs to understand. To 1635let Emacs know about those keys, you will have to find out which key 1636sequences they emit by typing ‘C-q’ and then the key (you should switch 1637to Emacs state first). Then you can bind those sequences to their 1638preferred forms using ‘input-decode-map’ as follows: 1639 1640 (cond ((string= (getenv "TERM") "xterm") 1641 (define-key input-decode-map "\e[192z" [f11]) ; L1 1642 (define-key input-decode-map "\e[195z" [f14]) ; L4, Undo 1643 1644 The above illustrates how to do this for Xterm. On VT100, you would 1645have to replace "xterm" with "vt100" and also change the key sequences 1646(the same key may emit different sequences on different types of 1647terminals). 1648 1649 The above keys are global, so they are overwritten by the local maps 1650defined by the major modes and by Viper itself. Therefore, if you wish 1651to change a binding set by a major mode or by Viper, read this. 1652 1653 Viper users who wish to specify their own key bindings should be 1654concerned only with the following three keymaps: 1655‘viper-vi-global-user-map’ for Vi state commands, 1656‘viper-insert-global-user-map’ for Insert state commands, and 1657‘viper-emacs-global-user-map’ for Emacs state commands (note: customized 1658bindings for Emacs state made to ‘viper-emacs-global-user-map’ are _not_ 1659inherited by Insert state). 1660 1661 For more information on Viper keymaps, see the header of the file 1662‘viper.el’. If you wish to change a Viper binding, you can use the 1663‘define-key’ command, to modify ‘viper-vi-global-user-map’, 1664‘viper-insert-global-user-map’, and ‘viper-emacs-global-user-map’, as 1665explained below. Each of these key maps affects the corresponding Viper 1666state. The keymap ‘viper-insert-global-user-map’ also affects Viper’s 1667Replace state. 1668 1669If you want to bind a key, say ‘C-v’, to the function that scrolls page 1670down and to make ‘0’ display information on the current buffer, putting 1671this in your Viper customization file will do the trick in Vi state: 1672 (define-key viper-vi-global-user-map "\C-v" 'scroll-down) 1673To set a key globally, 1674 (define-key viper-emacs-global-user-map "\C-c m" 'smail) 1675 (define-key viper-vi-global-user-map "0" 'viper-info-on-file) 1676Note, however, that this binding may be overwritten by other keymaps, 1677since the global keymap has the lowest priority. To make sure that 1678nothing will override a binding in Emacs state, you can write this: 1679 (define-key viper-emacs-global-user-map "\C-c m" 'smail) 1680To customize the binding for ‘C-h’ in Insert state: 1681 (define-key viper-insert-global-user-map "\C-h" 1682 'my-del-backwards-function) 1683 1684 Each Emacs command key calls some Lisp function. If you have enabled 1685the Help, (*note Rudimentary Changes::) ‘C-h k’ will show you the 1686function for each specific key; ‘C-h b’ will show all bindings, and ‘C-h 1687m’ will provide information on the major mode in effect. If Help is not 1688enabled, you can still get help in Vi state by prefixing the above 1689commands with ‘\’, e.g., ‘\ C-h k’ (or you can use the Help menu in the 1690menu bar, if Emacs runs under X). 1691 1692 Viper users can also change bindings on a per major mode basis. As 1693with global bindings, this can be done separately for each of the three 1694main Viper states. To this end, Viper provides the function 1695‘viper-modify-major-mode’. 1696 1697 To modify keys in Emacs state for ‘my-favorite-major-mode’, the user 1698needs to create a sparse keymap, say, ‘my-fancy-map’, bind whatever keys 1699necessary in that keymap, and put 1700 1701 (viper-modify-major-mode 'dired-mode 'emacs-state my-fancy-map) 1702 1703in your Viper customization file. To do the same in Vi and Insert 1704states, you should use ‘vi-state’ and ‘insert-state’. Changes in Insert 1705state are also in effect in Replace state. For instance, suppose that 1706the user wants to use ‘dd’ in Vi state under Dired mode to delete files, 1707‘u’ to unmark files, etc. The following code in the Viper customization 1708file will then do the job: 1709 1710 (setq my-dired-modifier-map (make-sparse-keymap)) 1711 (define-key my-dired-modifier-map "dd" 'dired-flag-file-deletion) 1712 (define-key my-dired-modifier-map "u" 'dired-unmark) 1713 (viper-modify-major-mode 'dired-mode 'vi-state my-dired-modifier-map) 1714 1715 A Vi purist may want to modify Emacs state under Dired mode so that 1716‘k’, ‘l’, etc., will move around in directory buffers, as in Vi. 1717Although this is not recommended, as these keys are bound to useful 1718Dired functions, the trick can be accomplished via the following code: 1719 1720 (setq my-dired-vi-purist-map (make-sparse-keymap)) 1721 (define-key my-dired-vi-purist-map "k" 'viper-previous-line) 1722 (define-key my-dired-vi-purist-map "l" 'viper-forward-char) 1723 (viper-modify-major-mode 'dired-mode 1724 'emacs-state my-dired-vi-purist-map) 1725 1726 Yet another way to customize key bindings in a major mode is to edit 1727the list ‘viper-major-mode-modifier-list’ using the customization 1728widget. (This variable is in the Viper-misc customization group.) The 1729elements of this list are triples of the form: (major-mode viper-state 1730keymap), where the keymap contains bindings that are supposed to be 1731active in the given major mode and the given viper-state. 1732 1733 Effects similar to key binding changes can be achieved by defining Vi 1734keyboard macros using the Ex commands ‘:map’ and ‘:map!’. The 1735difference is that multi-key Vi macros do not override the keys they are 1736bound to, unless these keys are typed in quick succession. So, with 1737macros, one can use the normal keys alongside with the macros. If 1738per-mode modifications are needed, the user can try both ways and see 1739which one is more convenient. *Note Vi Macros::, for details. 1740 1741 Note: in major modes that come up in _Emacs state_ by default, the 1742aforesaid modifications may not take place immediately (but only after 1743the buffer switches to some other Viper state and then back to Emacs 1744state). To avoid this, one should add ‘viper-change-state-to-emacs’ to 1745an appropriate hook of that major mode. (Check the function 1746‘viper-set-hooks’ in ‘viper.el’ for examples.) However, if you did not 1747set ‘viper-always’ to ‘nil’, chances are that you won’t need to perform 1748the above procedure, because Viper will take care of most useful 1749defaults. 1750 1751 Finally, Viper has a facility that lets the user define per-buffer 1752bindings, i.e., bindings that are in effect in some specific buffers 1753only. Unlike per-mode bindings described above, per-buffer bindings can 1754be defined based on considerations other than the major mode. This is 1755done via the function ‘viper-add-local-keys’, which lets one specify 1756bindings that should be in effect in the current buffer only and for a 1757specific Viper state. For instance, 1758 (viper-add-local-keys 'vi-state '(("ZZ" . TeX-command-master) 1759 ("ZQ" . viper-save-kill-buffer))) 1760redefines ‘ZZ’ to invoke ‘TeX-command-master’ in ‘vi-state’ and ‘ZQ’ to 1761save-then-kill the current buffer. These bindings take effect only in 1762the buffer where this command is executed. The typical use of this 1763function is to execute the above expression from within a function that 1764is included in a hook to some major mode. For instance, the above 1765expression could be called from a function, ‘my-tex-init’, which may be 1766added to ‘tex-mode-hook’ as follows: 1767 (add-hook 'tex-mode-hook 'my-tex-init) 1768When TeX mode starts, the hook is executed and the above Lisp expression 1769is evaluated. Then, the bindings for ‘ZZ’ and ‘ZQ’ are changed in Vi 1770command mode for all buffers in TeX mode. 1771 1772 Another useful application is to bind ‘ZZ’ to ‘send-mail’ in the Mail 1773mode buffers (the specifics of this depend on which mail package you are 1774using, ‘rmail’, ‘mh-e’, ‘vm’, etc. For instance, here is how to do this 1775for ‘mh-e’, the Emacs interface to MH: 1776 (defun mh-add-vi-keys () 1777 "Set up ZZ for MH-e and XMH." 1778 (viper-add-local-keys 'vi-state '(("ZZ" . mh-send-letter)))) 1779 (add-hook 'mh-letter-mode-hook 'mh-add-vi-keys) 1780 1781 You can also use ‘viper-add-local-keys’ to set per buffer bindings in 1782Insert state and Emacs state by passing as a parameter the symbols 1783‘insert-state’ and ‘emacs-state’, respectively. As with global 1784bindings, customized local bindings done to Emacs state are not 1785inherited by Insert state. 1786 1787 On rare occasions, local keys may be added by mistake. Usually this 1788is done indirectly, by invoking a major mode that adds local keys (e.g., 1789‘shell-mode’ redefines <RET>). In such a case, exiting the wrong major 1790mode won’t rid you from unwanted local keys, since these keys are local 1791to Viper state and the current buffer, not to the major mode. In such 1792situations, the remedy is to type ‘M-x viper-zap-local-keys’. 1793 1794 So much about Viper-specific bindings. *Note Customization: 1795(emacs)Customization, and the Emacs quick reference card for the general 1796info on key bindings in Emacs. 1797 1798 1799File: viper.info, Node: Packages that Change Keymaps, Next: Viper Specials, Prev: Key Bindings, Up: Customization 1800 18013.3 Packages that Change Keymaps 1802================================ 1803 1804Viper is designed to coexist with all major and minor modes of Emacs. 1805This means that bindings set by those modes are generally available with 1806Viper (unless you explicitly prohibit them by setting 1807‘viper-want-emacs-keys-in-vi’ and ‘viper-want-emacs-keys-in-insert’ to 1808‘nil’). If ‘viper-always’ is set to ‘t’ (which is the default), Viper 1809will try to bring each buffer in the Viper state that is most 1810appropriate for that buffer. Usually, this would be the Vi state, but 1811sometimes it could be the Insert state or the Emacs state. 1812 1813 Some major mode bindings will necessarily be overwritten by Viper. 1814Indeed, in Vi state, most of the 1-character keys are used for Vi-style 1815editing. This usually causes no problems because most packages designed 1816for editing files typically do not bind such keys. Instead, they use 1817key sequences that start with ‘C-x’ and ‘C-c’. This is why it was so 1818important for us to free up ‘C-x’ and ‘C-c’. It is common for 1819language-specific major modes to bind <TAB> and ‘C-j’ (the line feed) 1820keys to various formatting functions. This is extremely useful, but may 1821require some getting used to for a Vi user. If you decide that this 1822feature is not for you, you can re-bind these keys as explained earlier 1823(*note Customization::). 1824 1825 Binding for <TAB> is one of the most unusual aspects of Viper for 1826many novice users. In Emacs, <TAB> is used to format text and programs, 1827and is extremely useful. For instance, hitting <TAB> causes the current 1828line to be re-indented in accordance with the context. In programming, 1829this is very important, since improper automatic indentation would 1830immediately alert the programmer to a possible error. For instance, if 1831a ‘)’ or a ‘"’ is missing somewhere above the current line, <TAB> is 1832likely to mis-indent the line. 1833 1834 For this reason, Viper doesn’t change the standard Emacs binding of 1835<TAB>, thereby sacrificing Vi compatibility (except for users at level 18361). Instead, in Viper, the key ‘S-tab’ (shift+ tab) is chosen to 1837emulate Vi’s <TAB>. 1838 1839 We should note that on some non-windowing terminals, Shift doesn’t 1840modify the <TAB> key, so ‘S-tab’ behaves as if it were <TAB>. In such a 1841case, you will have to bind ‘viper-insert-tab’ to some other convenient 1842key. 1843 1844 Some packages, notably Dired, Gnus, Info, etc., attach special 1845meaning to common keys like <SPC>, ‘x’, ‘d’, ‘v’, and others. This 1846means that Vi command state is inappropriate for working with these 1847packages. Fortunately, these modes operate on read-only buffers and are 1848designed not for editing files, but for special-purpose browsing, 1849reading news, mail, etc., and Vi commands are meaningless in these 1850situations. For this reason, Viper doesn’t force Vi state on such major 1851modes—it brings them in Emacs state. You can switch to Vi state by 1852typing ‘C-z’ if, for instance, you want to do Vi-style search in a 1853buffer (although, usually, incremental search, which is bound to ‘C-s’, 1854is sufficient in these situations). But you should then switch back to 1855Emacs state if you plan to continue using these major modes 1856productively. You can also switch to Vi temporarily, to execute just 1857one command. This is done by typing ‘C-c \’. (In some of these modes, 1858‘/’ and ‘:’ are bound Vi-style, unless these keys perform essential 1859duties.) 1860 1861 If you would like certain major modes to come up in Emacs state 1862rather than Vi state (but Viper thinks otherwise), you should put these 1863major modes on the ‘viper-emacs-state-mode-list’ list and delete them 1864from ‘viper-vi-state-mode-list’. Likewise, you can force Viper’s Insert 1865state on a major mode by putting it in ‘viper-insert-state-mode-list’. 1866 1867 It is also possible to impose Vi on some major modes, even though 1868they may bind common keys to specialized commands. This might make 1869sense for modes that bind only a small number of common keys. For 1870instance, Viper subverts the Shell mode by changing the bindings for 1871‘C-m’ and ‘C-d’ using ‘viper-add-local-keys’ described in the section on 1872customization (*note Customization::). 1873 1874 In some cases, some _minor_ modes might override certain essential 1875bindings in Vi command state. This is not a big problem because this 1876can happen only in the beginning, when the minor mode kicks in. Typing 1877‘M-x viper-mode’ will correct the situation. Viper knows about several 1878such minor modes and takes care of them, so the above trick is usually 1879not necessary. If you find that some minor mode, e.g., ‘nasty-mode’ 1880interferes with Viper, putting the following in your Viper customization 1881file should fix the problem: 1882 (viper-harness-minor-mode "nasty-mode") 1883The argument to ‘viper-harness-minor-mode’ is the name of the file for 1884the offending minor mode with the suffixes ‘.el’ and ‘.elc’ removed. 1885 1886 It may not be always obvious which minor mode is at fault. The only 1887guidance here is to look into the file that defines the minor mode you 1888are suspecting, say ‘nasty-mode.el’, and see if it has a variable called 1889‘nasty-mode-map’. Then check if there is a statement of the form 1890 (define-key nasty-mode-map key function) 1891that binds the misbehaving keys. If so, use the above line to harness 1892‘nasty-mode’. If your suspicion is wrong, no harm is done if you 1893harness a minor mode that doesn’t need to be harnessed. 1894 1895 It is recommended to harness even those minor modes that don’t 1896override Viper keys, but still have their own keymaps. A general way to 1897make a minor mode, ‘my-mode’, compatible with Viper is to have the file 1898‘my-mode.el’ include the following code: 1899 1900 (when (fboundp 'viper-harness-minor-mode) 1901 (let ((lib (file-name-sans-extension 1902 (file-name-nondirectory load-file-name)))) 1903 (viper-harness-minor-mode lib))) 1904 1905 1906File: viper.info, Node: Viper Specials, Next: Vi Macros, Prev: Packages that Change Keymaps, Up: Customization 1907 19083.4 Viper Specials 1909================== 1910 1911Viper extends Vi with a number of useful features. This includes 1912various search functions, histories of search strings, Ex commands, 1913insertions, and Vi’s destructive commands. In addition, Viper supports 1914file name completion and history, completion of Ex commands and 1915variables, and many other features. Some of these features are 1916explained in detail elsewhere in this document. Other features are 1917explained here. 1918 1919‘(viper-buffer-search-enable)’ 1920‘viper-buffer-search-char nil’ 1921 Enable buffer search. Explicit call to 1922 ‘viper-buffer-search-enable’ sets ‘viper-buffer-search-char’ to 1923 ‘g’. Alternatively, the user can set ‘viper-buffer-search-char’ in 1924 his/her Viper customization file to a key sequence to be used for 1925 buffer search. There is no need to call 1926 ‘viper-buffer-search-enable’ in that case. 1927‘viper-toggle-search-style’ 1928 This function, bound to ‘C-c /’, lets one toggle case-sensitive and 1929 case-insensitive search, and also switch between plain vanilla 1930 search and search via regular expressions. Without the prefix 1931 argument, the user is asked which mode to toggle. With prefix 1932 argument 1, this toggles case-sensitivity. With prefix argument 2, 1933 regular expression/vanilla search will be toggled. 1934 1935 However, we found that the most convenient way to toggle these 1936 options is to bind a Vi macro to bind ‘//’ to toggles case 1937 sensitivity and to ‘///’ to toggles vanilla search. Thus, quickly 1938 hitting ‘/’ twice will switch Viper from case sensitive search to 1939 case-insensitive. Repeating this once again will restore the 1940 original state. Likewise, quickly hitting ‘/’ three times will 1941 switch you from vanilla-style search to search via regular 1942 expressions. If you hit something other than ‘/’ after the first 1943 ‘/’ or if the second ‘/’ doesn’t follow quickly enough, then Viper 1944 will issue the usual prompt ‘/’ and will wait for input, as usual 1945 in Vi. If you don’t like this behavior, you can “unrecord” these 1946 macros in your Viper customization file. For instance, if you 1947 don’t like the above feature, put this in the file: 1948 (viper-set-searchstyle-toggling-macros 'undefine) 1949 1950 If you don’t like this feature as a default, but would still like 1951 to have it in some major modes, you can do so by first unsetting it 1952 globally, as shown above, and then setting it in the desired major 1953 modes as follows: 1954 (viper-set-searchstyle-toggling-macros nil 'c-mode) 1955 (viper-set-searchstyle-toggling-macros nil 'lisp-mode) 1956 1957‘Vi-isms in Emacs state’ 1958 Some people find it useful to use the Vi-style search key, ‘/’, to 1959 invoke search in modes which Viper leaves in emacs-state. These 1960 modes are: ‘dired-mode’, ‘mh-folder-mode’, ‘Info-mode’, and 1961 ‘Buffer-menu-mode’ (more may be added in the future). So, in the 1962 above modes, Viper binds ‘/’ so that it will behave Vi-style. 1963 Furthermore, in those major modes, Viper binds ‘:’ to invoke 1964 ex-style commands, like in vi-state. And, as described above, ‘//’ 1965 and ‘///’ get bound to Vi-style macros that toggle 1966 case-insensitivity and regexp-search. 1967 1968 If you don’t like these features—which I don’t really 1969 understand—you can unbind ‘/’ and ‘:’ in ‘viper-dired-modifier-map’ 1970 (for Dired) or in ‘viper-slash-and-colon-map’, for other modes. 1971 1972 To unbind the macros ‘//’ and ‘///’ for a major mode where you feel 1973 they are undesirable, execute 1974 ‘viper-set-emacs-state-searchstyle-macros’ with a non-‘nil’ 1975 argument. This can be done either interactively, by supplying a 1976 prefix argument, or by placing 1977 (viper-set-emacs-state-searchstyle-macros 'undefine) 1978 in the hook to the major mode (e.g., ‘dired-mode-hook’). *Note Vi 1979 Macros::, for more information on Vi macros. 1980 1981‘viper-heading-start’ 1982‘viper-heading-end’ 1983 Regular Expressions for ‘[[’ and ‘]]’. Note that Emacs defines 1984 Regexps for paragraphs and sentences. *Note Paragraphs and 1985 Sentences: (emacs)Paragraphs, for details. 1986‘M-x viper-set-expert-level’ 1987 Change your user level interactively. 1988‘viper-smart-suffix-list '("" "tex" "c" "cc" "el" "p")’ 1989 Viper supports Emacs-style file completion when it prompts the user 1990 for a file name. However, in many cases, the same directory may 1991 contain files with identical prefix but different suffixes, e.g., 1992 prog.c, prog.o, paper.tex, paper.dvi. In such cases, completion 1993 will stop at the period. If the above variable is a list of 1994 strings representing suffixes, Viper will try these suffixes in the 1995 order listed and will check if the corresponding file exists. 1996 1997 For instance, if completion stopped at ‘paper.’ and the user typed 1998 <RET>, then Viper will check if the files ‘paper.’, ‘paper.tex’, 1999 ‘paper.c’, etc., exist. It will take the first such file. If no 2000 file exists, Viper will give a chance to complete the file name by 2001 typing the appropriate suffix. If ‘paper.’ was the intended file 2002 name, hitting return will accept it. 2003 2004 To turn this feature off, set the above variable to ‘nil’. 2005 2006‘viper-insertion-ring-size 14’ 2007 Viper remembers what was previously inserted in Insert and Replace 2008 states. Several such recent insertions are kept in a special ring 2009 of strings of size ‘viper-insertion-ring-size’. If you enter 2010 Insert or Replace state you can reinsert strings from this ring by 2011 typing ‘C-c M-p’ or ‘C-c M-n’. The former will search the ring in 2012 the direction of older insertions, and the latter will search in 2013 the direction of newer insertions. Hitting ‘C-c M-p’ or ‘C-c M-n’ 2014 in succession will undo the previous insertion from the ring and 2015 insert the next item on the ring. If a larger ring size is needed, 2016 change the value of the above variable in the Viper customization 2017 file. 2018 2019 Since typing these sequences of keys may be tedious, it is 2020 suggested that the user should bind a function key, such as ‘f31’, 2021 as follows: 2022 (define-key viper-insert-global-user-map [f31] 2023 'viper-insert-prev-from-insertion-ring) 2024 This binds ‘f31’ (which is usually ‘R11’ on a Sun workstation) to 2025 the function that inserts the previous string in the insertion 2026 history. To rotate the history in the opposite direction, you can 2027 either bind an unused key to 2028 ‘viper-insert-next-from-insertion-ring’ or hit any digit (1 to 9) 2029 then ‘f31’. 2030 2031 One should not bind the above functions to ‘M-p’ or ‘M-n’, since 2032 this will interfere with the minibuffer histories and, possibly, 2033 other major modes. 2034 2035‘viper-command-ring-size 14’ 2036 Viper keeps track of the recent history of destructive commands, 2037 such as ‘dw’, ‘i’, etc. In Vi state, the most recent command can 2038 be re-executed by hitting a period, as in Vi. However, repeated 2039 typing ‘C-c M-p’ will cause Viper to show the previous destructive 2040 commands in the minibuffer. Subsequent hitting period will execute 2041 the command that was displayed last. The key ‘C-c M-n’ will cycle 2042 through the command history in the opposite direction. Since 2043 typing ‘C-c M-p’ may be tedious, it is more convenient to bind an 2044 appropriate function to an unused function key on the keyboard and 2045 use that key. For instance, the following 2046 (define-key viper-vi-global-user-map [f31] 2047 'viper-prev-destructive-command) 2048 binds the key ‘f31’ (which is usually ‘R11’ on a Sun workstation) 2049 to the function that searches the command history in the direction 2050 of older commands. To search in the opposite direction, you can 2051 either bind an unused key to ‘viper-next-destructive-command’ or 2052 hit any digit (1 to 9) then ‘f31’. 2053 2054 One should not bind the above functions to ‘M-p’ or ‘M-n’, since 2055 this will interfere with the minibuffer histories and, possibly, 2056 other major modes. 2057 2058‘viper-minibuffer-vi-face 'viper-minibuffer-vi-face’ 2059‘viper-minibuffer-insert-face 'viper-minibuffer-insert-face’ 2060‘viper-minibuffer-emacs-face 'viper-minibuffer-emacs-face’ 2061 These faces control the appearance of the minibuffer text in the 2062 corresponding Viper states. You can change the appearance of these 2063 faces through Emacs’s customization widget, which is accessible 2064 through the menubar. 2065 2066 Viper is located in this widget under the _Emulations_ 2067 customization subgroup of the _Editing_ group. All Viper faces are 2068 grouped together in Viper’s _Highlighting_ customization subgroup. 2069 2070 Note that only the text you type in is affected by the above faces. 2071 Prompts and minibuffer messages are not affected. 2072 2073 Purists who do not like adornments in the minibuffer can always zap 2074 them by putting 2075 (copy-face 'default 'viper-minibuffer-vi-face) 2076 (copy-face 'default 'viper-minibuffer-insert-face) 2077 (copy-face 'default 'viper-minibuffer-emacs-face) 2078 in their Viper customization file or through the customization 2079 widget, as described above. However, in that case, the user will 2080 not have any indication of the current Viper state in the 2081 minibuffer. (This is important if the user accidentally switches 2082 to another Viper state by typing <ESC> or ‘C-z’). 2083‘M-x viper-go-away’ 2084 Make Viper disappear from the face of your running Emacs instance. 2085 If your fingers start aching again, ‘M-x viper-mode’ might save 2086 your day. 2087‘M-x toggle-viper-mode’ 2088 Toggle Viperization of Emacs on and off. 2089 2090 Viper provides some support for multi-file documents and programs. 2091If a document consists of several files we can designate one of them as 2092a master and put the following at the end of that file: 2093 ;; Local Variables: 2094 ;; eval: (viper-setup-master-buffer "file1" "file2" "file3" "file4") 2095 ;; End: 2096where ‘file1’ to ‘file4’ are names of files related to the master file. 2097Next time, when the master file is visited, the command 2098‘viper-setup-master-buffer’ will be evaluated and the above files will 2099be associated with the master file. Then, the new Ex command 2100‘:RelatedFile’ (abbr. ‘:R’) will display files 1 to 4 one after another, 2101so you can edit them. If a file is not in any Emacs buffer, it will be 2102visited. The command ‘PreviousRelatedFile’ (abbr., ‘:P’) goes through 2103the file list in the opposite direction. 2104 2105 These commands are akin to ‘:n’ and ‘:N’, but they allow the user to 2106focus on relevant files only. 2107 2108 Note that only the master file needs to have the aforementioned block 2109of commands. Also, ";;" above can be replaced by some other markers. 2110Semicolon is good for Lisp programs, since it is considered a comment 2111designator there. For LaTeX, this could be "%%%", and for C the above 2112block should be commented out. 2113 2114 Even though these commands are sometimes useful, they are no 2115substitute for the powerful _tag table_ facility of Emacs. Viper’s 2116‘:tag’ command in a primitive interface to Emacs tags. *Note 2117(emacs)Tags Tables::, for more information on tags. 2118 2119 The following two commands are normally bound to a mouse click and 2120are part of Viper. They work only if Emacs runs as an application under 2121X Windows (or under some other window system for which a port of GNU 2122Emacs 20 is available). Clicking the mouse when Emacs is invoked in an 2123Xterm window (using ‘emacs -nw’) will do no good. 2124 2125‘viper-mouse-search-key (meta shift 1)’ 2126 This variable controls the _mouse-search_ feature of Viper. The 2127 default value states that holding Meta and Shift keys while 2128 clicking mouse button 1 should initiate search for a region under 2129 the mouse pointer (defined below). This command can take a prefix 2130 argument, which indicates the occurrence of the pattern to search 2131 for. 2132 2133 Note: while loading initially, Viper binds this mouse action only 2134 if it is not already bound to something else. If you want to use 2135 the mouse-search feature, and the ‘Meta-Shift-mouse-1’ mouse action 2136 is already bound to something else, you can rebind the mouse-search 2137 feature by setting ‘viper-mouse-search-key’ to something else in 2138 your Viper customization file: 2139 (setq viper-mouse-search-key '(meta 1)) 2140 This would bind mouse search to the action invoked by pressing the 2141 Meta key and clicking mouse button 1. The allowed values of 2142 ‘viper-mouse-search-key’ are lists that contain a mouse-button 2143 number (1,2, or 3) and any combination of the words “control”, 2144 “meta”, and “shift”. 2145 2146 If the requested mouse action (e.g., (meta 1)) is already taken for 2147 other purposes then you have to confirm your intention by placing 2148 the following command in your Viper customization file after 2149 setting ‘viper-mouse-search-key’: 2150 (viper-bind-mouse-search-key 'force) 2151 2152 You can also change this setting interactively, through the 2153 customization widget of Emacs (type ‘:customize’). 2154 2155 The region that is chosen as a pattern to search for is determined 2156 as follows. If search is invoked via a single click, Viper chooses 2157 the region that lies between the beginning of the “word” under the 2158 pointer (“word” is understood in Vi sense) and the end of that 2159 word. The only difference with Vi’s words is that in Lisp major 2160 modes ‘-’ is considered an alphanumeric symbol. This is done for 2161 the convenience of working with Lisp symbols, which often have an 2162 ‘-’ in them. Also, if you click on a non-alphanumeric character 2163 that is not a word separator (in Vi sense) then this character will 2164 also be considered alphanumeric, provided that it is adjacent (from 2165 either side) to an alphanumeric character. This useful feature 2166 gives added control over the patterns selected by the mouse click. 2167 2168 On a double-click, the region is determined by the beginning of the 2169 current Vi’s “Word” (i.e., the largest non-separator chunk of text) 2170 and the End of that “Word” (as determined by the ‘E’ command). 2171 2172 On a triple-click, the region consists of the entire line where the 2173 click occurred with all leading and trailing spaces and tabs 2174 removed. 2175 2176‘viper-mouse-insert-key (meta shift 2)’ 2177 This variable controls the _mouse-insert_ feature of Viper. The 2178 above default value states that holding Meta and Shift keys while 2179 clicking mouse button 2 should insert the region surrounding the 2180 mouse pointer. The rules defining this region are the same as for 2181 mouse-search. This command takes an optional prefix argument, 2182 which indicates how many such regions to snarf from the buffer and 2183 insert. (In case of a triple-click, the prefix argument is 2184 ignored.) 2185 2186 Note: while loading initially, Viper binds this mouse action only 2187 if it not already bound to something else. If you want to use this 2188 feature and the default mouse action is already bound, you can 2189 rebind mouse-insert by placing this command in your Viper 2190 customization file: 2191 (setq viper-mouse-insert-key '(meta 2)) 2192 If you want to bind mouse-insert to an action even if this action 2193 is already taken for other purposes in Emacs, then you should add 2194 this command to your Viper customization file, after setting 2195 ‘viper-mouse-insert-key’: 2196 (viper-bind-mouse-insert-key 'force) 2197 2198 This value can also be changed via the Emacs customization widget 2199 at the menubar. 2200 2201‘viper-multiclick-timeout’ 2202 This variable controls the rate at which double-clicking must occur 2203 for the purpose of mouse search and mouse insert. By default, this 2204 is set to ‘double-click-time’. 2205 2206 Note: The above functions search and insert in the selected window of 2207the latest active frame. This means that you can click in another 2208window or another frame and have search or insertion done in the frame 2209and window you just left. This lets one use these functions in a 2210multi-frame configuration. However, this may require some getting used 2211to. For instance, if you are typing in a frame, A, and then move the 2212mouse to frame B and click to invoke mouse search, search (or insertion) 2213will be performed in frame A. To perform search/insertion in frame B, 2214you will first have to shift focus there, which doesn’t happen until you 2215type a character or perform some other action in frame B—mouse search 2216doesn’t shift focus. 2217 2218 If you decide that you don’t like the above feature and always want 2219search/insertion be performed in the frame where the click occurs, don’t 2220bind (and unbind, if necessary) ‘viper-mouse-catch-frame-switch’ from 2221the mouse event it is bound to. 2222 2223 Mouse search is integrated with Vi-style search, so you can repeat it 2224with ‘n’ and ‘N’. It should be also noted that, while case-sensitivity 2225of search in Viper is controlled by the variable 2226‘viper-case-fold-search’, the case of mouse search is controlled by the 2227Emacs variable ‘case-fold-search’, which may be set differently from 2228‘viper-case-fold-search’. Therefore, case-sensitivity of mouse search 2229may be different from that of the usual Vi-style search. 2230 2231 Finally, if the way Viper determines the word to be searched for or 2232to be inserted is not what you want, there is a variable, 2233‘viper-surrounding-word-function’, which can be changed to indicate 2234another function for snarfing words out of the buffer. The catch is 2235that you will then have to write such a function and make it known to 2236your Emacs. The function ‘viper-surrounding-word’ in ‘viper.el’ can be 2237used as a guiding example. 2238 2239 2240File: viper.info, Node: Vi Macros, Prev: Viper Specials, Up: Customization 2241 22423.5 Vi Macros 2243============= 2244 2245Viper supports much enhanced Vi-style macros and also facilitates the 2246use of Emacs-style macros. To define a temporary macro, it is generally 2247more convenient to use Emacs keyboard macro facility. Emacs keyboard 2248macros are usually defined anonymously, and the latest macro can be 2249executed by typing ‘C-x e’ (or ‘*’, if Viper is in Vi state). If you 2250need to use several temporary macros, Viper lets you save them to a 2251register (a lowercase letter); such macros can then be executed by 2252typing ‘@a’ in Vi state (if a macro was previously saved in register 2253‘a’). *Note Macros and Registers::, for details. 2254 2255 If, however, you need to use a macro regularly, it must be given a 2256permanent name and saved. Emacs manual explains how to do this, but 2257invocation of named Emacs macros is quite different from Vi’s. First, 2258invocation of permanent Emacs macros takes time because it requires 2259typing too many keys (to a Vi user’s taste, anyway). Second, binding 2260such macros to function keys, for fast access, hogs valuable real estate 2261on the keyboard. 2262 2263 Vi-style macros are better in that respect, since Vi lets the user 2264overload the meaning of key sequences: keys typed in fast succession are 2265treated specially, if this key sequence is bound to a macro. 2266 2267 Viper provides Vi-style keyboard macros through the usual Ex 2268commands, ‘:map’ and ‘:map!’. These macros are much more powerful in 2269Viper than they are in the original Vi and in other emulators. This is 2270because Viper implements an enhanced vi-style interface to the powerful 2271Emacs keyboard macro facility. 2272 2273 First, any Emacs command can be executed while defining a macro, not 2274just the Vi commands. In particular, the user can invoke Emacs commands 2275via ‘M-x command-name’ or by pressing various function keys on the 2276keyboard. One can even use the mouse, although this is usually not 2277useful and is not recommended (and macros defined with the use of the 2278mouse cannot be saved in command history and in the startup file, for 2279future use). 2280 2281 Macros defined by mixing Vi and Emacs commands are represented as 2282vectors. So, don’t be confused when you see one (usually through the 2283history of Ex commands). For instance, if ‘gg’ is defined by typing 2284‘l’, the up-arrow key and ‘M-x next-line’, its definition will look as 2285follows in Emacs: 2286 2287 [l up (meta x) n e x t - l i n e return] 2288 2289 Second, Viper macros are defined in a WYSIWYG style. This means that 2290commands are executed as you type them, so you can see precisely what is 2291being defined. Third, macros can be bound to arbitrary sequences of 2292keys, not just to printable keys. For instance, one can define a macro 2293that will be invoked by hitting ‘f3’ then ‘f2’ function keys. (The keys 2294‘delete’ and ‘backspace’ are excluded; also, a macro invocation sequence 2295can’t start with <ESC>. Some other keys, such as ‘f1’ and ‘help’, can’t 2296be bound to macros under Emacs, since they are bound in 2297‘key-translation-map’, which overrides any other binding the user gives 2298to keys. In general, keys that have a binding in ‘key-translation-map’ 2299can’t be bound to a macro.) 2300 2301 Fourth, in Viper, one can define macros that are specific to a given 2302buffer, a given major mode, or macros that are defined for all buffers. 2303In fact, the same macro name can have several different definitions: one 2304global, several definitions for various major modes, and definitions for 2305various specific buffers. Buffer-specific definitions override 2306mode-specific definitions, which, in turn, override global definitions. 2307 2308 As if all that is not enough, Viper (through its interface to Emacs 2309macros) lets the user define keyboard macros that ask for confirmation 2310or even prompt the user for input and then continue. To do this, one 2311should type ‘C-x q’ (for confirmation) or ‘C-u C-x q’ (for prompt). For 2312details, *note Customization: (emacs)Keyboard Macro Query. 2313 2314 When the user finishes defining a macro (which is done by typing 2315‘C-x)’, a departure from Vi), you will be asked whether you want this 2316macro to be global, mode-specific, or buffer-specific. You will also be 2317given a chance to save the macro in your Viper customization file. This 2318is the easiest way to save a macro and make it permanently available. 2319If you work your startup files with bare hands, here is how Viper saves 2320the above macro so that it will be available in Viper’s Insert state 2321(and Replace state) in buffer ‘my-buf’ only: 2322 2323 (viper-record-kbd-macro "gg" 'insert-state 2324 [l up (meta x) n e x t - l i n e return] 2325 "my-buf") 2326 2327To do the same for Vi state and all buffers with the major mode 2328‘cc-mode’, use: 2329 2330 (viper-record-kbd-macro "gg" 'vi-state 2331 [l up (meta x) n e x t - l i n e return] 2332 'cc-mode) 2333 2334Both macro names and macro definitions are vectors of symbols that 2335denote keys on the keyboard. Some keys, like ‘\’, ‘ ’, or digit-keys 2336must be escaped with a backslash. Modified keys are represented as 2337lists. For instance, holding Meta and Control and pressing ‘f4’ is 2338represented as ‘(control meta f4)’. If all members of a vectors are 2339printable characters (or sequences, such as ‘\e’, ‘\t’, for <ESC> and 2340<TAB>), then they can also be represented as strings: 2341 2342 (viper-record-kbd-macro "aa" 'vi-state "aaa\e" "my-buffer") 2343 2344Thus, typing ‘aa’ fast in Vi state will switch Viper to Insert state 2345(due to the first ‘a’), insert ‘aa’, and then it will switch back to Vi 2346state. All this will take effect only in the buffer named ‘my-buffer’. 2347 2348 Note that the last argument to ‘viper-record-kbd-macro’ must be 2349either a string (a buffer name), a symbol representing a major mode, or 2350‘t’; the latter says that the macro is to be defined for all buffers 2351(which is how macros are defined in original Vi). 2352 2353 For convenience, Viper also lets you define Vi-style macros in its 2354Emacs state. There is no Ex command, like ‘:map’ and ‘:map!’ for doing 2355this, but the user can include such a macro in the Viper customization 2356file. The only thing is that the ‘viper-record-kbd-macro’ command 2357should specify ‘emacs-state’ instead of ‘vi-state’ or ‘insert-state’. 2358 2359 The user can get rid of a macro either by using the Ex commands 2360‘:unmap’ and ‘:unmap!’ or by issuing a call to 2361‘viper-unrecord-kbd-macro’. The latter is more powerful, since it can 2362delete macros even in ‘emacs-state’. However, 2363‘viper-unrecord-kbd-macro’ is usually needed only when the user needs to 2364get rid of the macros that are already predefined in Viper. The syntax 2365is: 2366 (viper-unrecord-kbd-macro macro state) 2367The second argument must be ‘vi-state’, ‘insert-state’, or 2368‘emacs-state’. The first argument is a name of a macro. To avoid 2369mistakes in specifying names of existing macros, type ‘M-x 2370viper-describe-kbd-macros’ and use a name from the list displayed by 2371this command. 2372 2373 If an error occurs during macro definition, Emacs aborts the process, 2374and it must be repeated. This is analogous to Vi, except that in Vi the 2375user doesn’t know there is an error until the macro is actually run. 2376All that means that in order for a definition to be successful, the user 2377must do some simple planning of the process in advance, to avoid errors. 2378For instance, if you want to map ‘gg’ to ‘llll’ in Vi state, you must 2379make sure that there is enough room on the current line. Since ‘l’ 2380moves the cursor forward, it may signal an error on reaching the end of 2381line, which will abort the definition. 2382 2383 These precautions are necessary only when defining macros; they will 2384help avoid the need to redo the job. When macros are actually run, an 2385error during the execution will simply terminate the current execution 2386(but the macro will remain mapped). 2387 2388 A macro name can be a string of characters or a vector of keys. The 2389latter makes it possible to define macros bound to, say, double-hits on 2390a function key, such as ‘up’ or ‘f13’. This is very useful if you run 2391out of function keys on your keyboard; it makes Viper macro facility a 2392_keyboard doubler_, so to speak. 2393 2394 Elsewhere (*Note Key Bindings::, for details), we review the standard 2395Emacs mechanism for binding function keys to commands. For instance, 2396 2397 (global-set-key [f13] 'repeat-complex-command) 2398 2399binds the key f13 to the Emacs function that repeats the last minibuffer 2400command. Under Viper, however, you may still use this key for 2401additional purposes, if you bind, say, a double-hitting action for that 2402key to some other function. Emacs doesn’t allow the user to do that, 2403but Viper does this through its keyboard macro facility. To do this, 2404type ‘:map ’ first. When you are asked to enter a macro name, hit f13 2405twice, followed by <RET> or <SPC>. 2406 2407 Emacs will now start the mapping process by actually executing Vi and 2408Emacs commands, so that you could see what will happen each time the 2409macro is executed. Suppose now we wanted to bind the key sequence ‘f13 2410f13’ to the command ‘eval-last-sexp’. To accomplish this, we can type 2411‘M-x eval-last-sexp’ followed by ‘C-x )’. If you answer positively to 2412Viper’s offer to save this macro in your Viper customization file for 2413future uses, the following will be inserted in that file: 2414 2415 (viper-record-kbd-macro [f16 f16] 'vi-state 2416 [(meta x) e v a l - l a s t - s e x p] 2417 'lisp-interaction-mode) 2418 2419 To illustrate the above point, Viper provides two canned macros, 2420which, by default, are bound to ‘[f12 \1]’ and ‘[f12 \2]’ (invoked by 2421typing ‘f12’ then ‘1’ and ‘2’, respectively). These macros are useful 2422shortcuts to Viper’s command ring history. The first macro will execute 2423the second-last destructive command (the last one is executed by ‘.’, as 2424usual). The second macro executes the third-last command. 2425 2426 If you need to go deeper into the command history, you will have to 2427use other commands, as described earlier in this section; or you can 2428bind, say, ‘f12 \3’ like this: 2429 2430 (viper-record-kbd-macro [f12 \3] 'vi-state 2431 [(meta x) r e p e a t - f r o m - h i s t o r y] 2432 t) 2433 2434 Note that even though the macro uses the function key ‘f12’, the key 2435is actually free and can still be bound to some Emacs function via 2436‘define-key’ or ‘global-set-key’. 2437 2438 Viper allows the user to define macro names that are prefixes of 2439other macros. For instance, one can define ‘[[’ and ‘[[[[’ to be 2440macros. If you type the exact sequence of such keys and then pause, 2441Viper will execute the right macro. However, if you don’t pause and, 2442say, type ‘[[[[text’ then the conflict is resolved as follows. If only 2443one of the key sequences, ‘[[’ or ‘[[[[’ has a definition applicable to 2444the current buffer, then, in fact, there is no conflict and the right 2445macro will be chosen. If both have applicable definitions, then the 2446first one found will be executed. Usually this is the macro with a 2447shorter name. So, in our case, ‘[[[[text’ will cause the macro ‘[[’ to 2448be executed twice and then the remaining keys, ‘t e x t’, will be 2449processed. 2450 2451 When defining macros using ‘:map’ or ‘:map!’, the user enters the 2452actually keys to be used to invoke the macro. For instance, you should 2453hit the actual key ‘f6’ if it is to be part of a macro name; you do 2454_not_ write ‘f 6’. When entering keys, Viper displays them as strings 2455or vectors (e.g., ‘"abc"’ or ‘[f6 f7 a]’). The same holds for 2456unmapping. Hitting <TAB> while typing a macro name in the ‘:unmap’ or 2457‘:unmap!’ command will cause name completion. Completions are displayed 2458as strings or vectors. However, as before, you don’t actually type ‘"’, 2459‘[’, or ‘]’ that appear in the completions. These are meta-symbols that 2460indicate whether the corresponding macro name is a vector or a string. 2461 2462 One last difference from Vi: Vi-style keyboard macros cannot be 2463defined in terms of other Vi-style keyboard macros (but named Emacs 2464macros are OK). More precisely, while defining or executing a macro, the 2465special meaning of key sequences (as Vi macros) is ignored. This is 2466because it is all too easy to create an infinite loop in this way. 2467Since Viper macros are much more powerful than Vi’s it is impossible to 2468detect such loops. In practice, this is not really a limitation but, 2469rather, a feature. 2470 2471 We should also note that Vi macros are disabled in the minibuffer, 2472which helps keep some potential troubles away. 2473 2474 The rate at which the user must type keys in order for them to be 2475recognized as a timeout macro is controlled by the variable 2476‘viper-fast-keyseq-timeout’, which defaults to 200 milliseconds. 2477 2478 For the most part, Viper macros defined in the Viper customization 2479file can be shared between X and TTY modes. The problem with TTY may be 2480that the function keys there generate sequences of events instead of a 2481single event (as under a window system). Emacs maps some of these 2482sequences back to the logical keys (e.g., the sequences generated by the 2483arrow keys are mapped to ‘up’, ‘left’, etc.). However, not all function 2484keys are mapped in this way. Macros that are bound to key sequences 2485that contain such unmapped function keys have to be redefined for TTY’s 2486(and possibly for every type of TTY you may be using). To do this, 2487start Emacs on an appropriate TTY device and define the macro using 2488‘:map’, as usual. 2489 2490 Finally, Viper provides a function that conveniently displays all 2491macros currently defined. To see all macros along with their 2492definitions, type ‘M-x viper-describe-kbd-macros’. 2493 2494 2495File: viper.info, Node: Commands, Next: GNU Free Documentation License, Prev: Customization, Up: Top 2496 24974 Commands 2498********** 2499 2500This section is a semi-automatically bowdlerized version of the Vi 2501reference created by 2502‘maart@cs.vu.nl’ and others. It can be found on the Vi archives. This 2503reference has been adapted for Viper. 2504 2505* Menu: 2506 2507* Groundwork:: Textual Conventions and Viper basics 2508* Text Handling:: Moving, Editing, Undoing. 2509* Display:: Scrolling. 2510* File and Buffer Handling:: Editing, Writing and Quitting. 2511* Mapping:: Mapping Keys, Keyboard Macros 2512* Shell Commands:: Accessing Shell Commands, Processing Text 2513* Options:: Ex options, the ‘:set’ commands 2514* Emacs Related Commands:: Meta Keys, Windows 2515* Mouse-bound Commands:: Search and insertion of text 2516 2517 2518File: viper.info, Node: Groundwork, Next: Text Handling, Up: Commands 2519 25204.1 Groundwork 2521============== 2522 2523The VI command set is based on the idea of combining motion commands 2524with other commands. The motion command is used as a text region 2525specifier for other commands. We classify motion commands into “point 2526commands” and “line commands”. 2527 2528 The point commands are: 2529 2530 ‘h’, ‘l’, ‘0’, ‘$’, ‘w’, ‘W’, ‘b’, ‘B’, ‘e’, ‘E’, ‘(’, ‘)’, ‘/’, 2531 ‘?’, ‘`’, ‘f’, ‘F’, ‘t’, ‘T’, ‘%’, ‘;’, ‘,’, ‘^’ 2532 2533 The line commands are: 2534 2535 ‘j’, ‘k’, ‘+’, ‘-’, ‘H’, ‘M’, ‘L’, ‘{’, ‘}’, ‘G’, ‘'’, ‘[[’, ‘]]’, 2536 ‘[]’ 2537 2538 Text Deletion Commands (*note Deleting Text::), Change commands 2539(*note Changing Text::), even Shell Commands (*note Shell Commands::) 2540use these commands to describe a region of text to operate on. 2541 2542 Viper adds two region descriptors, ‘r’ and ‘R’. These describe the 2543Emacs regions (*note Basics::), but they are not movement commands. 2544 2545 The command description uses angle brackets ‘<>’ to indicate 2546metasyntactic variables, since the normal conventions of using simple 2547text can be confusing with Viper where the commands themselves are 2548characters. Watch out where ‘<’ shift commands and ‘<count>’ are 2549mentioned together!!! 2550 2551 ‘<move>’ refers to the above movement commands, and ‘<a-z>’ refers to 2552registers or textmarkers from ‘a’ to ‘z’. Note that the ‘<move>’ is 2553described by full move commands, that is to say they will take counts, 2554and otherwise behave like normal move commands. ‘<address>’ refers to 2555Ex line addresses, which include 2556 2557‘. <No address>’ 2558 Current line 2559‘.+n .-n’ 2560 Add or subtract for current line 2561‘number’ 2562 Actual line number, use ‘.=’ to get the line number 2563‘'<a-z>’ 2564 Textmarker 2565‘$’ 2566 Last line 2567‘x,y’ 2568 Where x and y are one of the above 2569‘%’ 2570 For the whole file, same as (1,$). 2571‘/<pat>/’ 2572‘?<pat>?’ 2573 Next or previous line with pattern <pat>. 2574 2575 Note that the pattern is allowed to contain newline character 2576 (inserted as ‘C-qC-j’). Therefore, one can search for patterns 2577 that span several lines. 2578 2579 Note that ‘%’ is used in Ex commands ‘:e’ and ‘:r <shell-cmd>’ to 2580mean current file. If you want a ‘%’ in your command, it must be 2581escaped as ‘\%’. Note that ‘:w’ and the regular ‘:r <file>’ command 2582doesn’t support the meta symbols ‘%’ and ‘#’, because file history is a 2583better mechanism. Similarly, ‘#’ expands to the previous file. The 2584previous file is the first file in ‘:args’ listing. This defaults to 2585previous window in the VI sense if you have one window only. 2586 2587Others like ‘<args> -- arguments’, ‘<cmd> -- command’ etc. should be 2588fairly obvious. 2589 2590Common characters referred to include: 2591 2592‘<sp>’ 2593 Space 2594‘<ht>’ 2595 Tab 2596‘<lf>’ 2597 Linefeed 2598‘<esc>’ 2599 Escape 2600‘<cr>’ 2601 Return, Enter 2602 2603 We also use ‘word’ for alphanumeric/non-alphanumeric words, and 2604‘WORD’ for whitespace delimited words. ‘char’ refers to any ASCII 2605character, ‘CHAR’ to non-whitespace character. Brackets ‘[]’ indicate 2606optional parameters; ‘<count>’ also optional, usually defaulting to 1. 2607Brackets are elided for ‘<count>’ to eschew obfuscation. 2608 2609 Viper’s idea of Vi’s words is slightly different from Vi. First, 2610Viper words understand Emacs symbol tables. Therefore, all symbols 2611declared to be alphanumeric in a symbol table can automatically be made 2612part of the Viper word. This is useful when, for instance, editing text 2613containing European, Cyrillic, Japanese, etc., texts. 2614 2615 Second, Viper lets you depart from Vi’s idea of a word by changing 2616the a syntax preference via the customization widget (the variable 2617‘viper-syntax-preference’) or by executing ‘viper-set-syntax-preference’ 2618interactively. 2619 2620 By default, Viper syntax preference is ‘reformed-vi’, which means 2621that Viper considers only those symbols to be part of a word that are 2622specified as word-symbols by the current Emacs syntax table (which may 2623be different for different major modes) plus the underscore symbol ‘_’, 2624minus the symbols that are not considered words in Vi (e.g., ‘,’, ‘;’, 2625etc.), but may be considered as word-symbols by various Emacs major 2626modes. Reformed-Vi works very close to Vi, and it also recognizes words 2627in other alphabets. Therefore, this is the most appropriate mode for 2628editing text and is likely to fit all your needs. 2629 2630 You can also set Viper syntax preference to ‘strict-vi’, which would 2631cause Viper to view all non-English letters as non-word-symbols. 2632 2633 You can also specify ‘emacs’ as your preference, which would make 2634Viper use exactly the same notion of a word as Emacs does. In 2635particular, the underscore may not be part of a word in some major 2636modes. 2637 2638 Finally, if ‘viper-syntax-preference’ is set to ‘extended’, Viper 2639words would consist of characters that are classified as alphanumeric 2640_or_ as parts of symbols. This is convenient for editing programs. 2641 2642 ‘viper-syntax-preference’ is a local variable, so it can have 2643different values for different major modes. For instance, in 2644programming modes it can have the value ‘extended’. In text modes where 2645words contain special characters, such as European (non-English) 2646letters, Cyrillic letters, etc., the value can be ‘reformed-vi’ or 2647‘emacs’. If you consider using different syntactic preferences for 2648different major modes, you should execute, for example, 2649 2650 (viper-set-syntax-preference nil "extended") 2651 2652 in the appropriate major mode hooks. 2653 2654 The above discussion concerns only the movement commands. In regular 2655expressions, words remain the same as in Emacs. That is, the 2656expressions ‘\w’, ‘\>’, ‘\<’, etc., use Emacs’s idea of what is a word, 2657and they don’t look into the value of variable 2658‘viper-syntax-preference’. This is because Viper avoids changing syntax 2659tables in order to not thwart the various major modes that set these 2660tables. 2661 2662 The usual Emacs convention is used to indicate Control Characters, 2663i.e., C-h for Control-h. _Do not confuse this with a sequence of 2664separate characters C, -, h!!!_ The ‘^’ is itself, never used to 2665indicate a Control character. 2666 2667 Finally, we note that Viper’s Ex-style commands can be made to work 2668on the current Emacs region. This is done by typing a digit argument 2669before ‘:’. For instance, typing ‘1:’ will prompt you with something 2670like _:123,135_, assuming that the current region starts at line 123 and 2671ends at line 135. There is no need to type the line numbers, since 2672Viper inserts them automatically in front of the Ex command. 2673 2674 2675File: viper.info, Node: Text Handling, Next: Display, Prev: Groundwork, Up: Commands 2676 26774.2 Text Handling 2678================= 2679 2680* Menu: 2681 2682* Move Commands:: Moving, Searching 2683* Marking:: Textmarkers in Viper and the Emacs Mark. 2684* Appending Text:: Text insertion, Shifting, Putting 2685* Editing in Insert State:: Autoindent, Quoting etc. 2686* Deleting Text:: Deleting 2687* Changing Text:: Changing, Replacement, Joining 2688* Search and Replace:: Searches, Query Replace, Pattern Commands 2689* Yanking:: Yanking, Viewing Registers 2690* Undoing:: Multiple Undo, Backups 2691 2692 2693File: viper.info, Node: Move Commands, Next: Marking, Up: Text Handling 2694 26954.2.1 Move Commands 2696------------------- 2697 2698‘<count> h C-h’ 2699 <count> chars to the left. 2700‘<count> j <lf> C-n’ 2701 <count> lines downward. 2702‘<count> l <sp>’ 2703 <count> chars to the right. 2704‘<count> k C-p’ 2705 <count> lines upward. 2706‘<count> $’ 2707 To the end of line <count> from the cursor. 2708‘<count> ^’ 2709 To the first CHAR <count> − 1 lines lower. 2710‘<count> -’ 2711 To the first CHAR <count> lines higher. 2712‘<count> + <cr>’ 2713 To the first CHAR <count> lines lower. 2714‘0’ 2715 To the first char of the line. 2716‘<count> |’ 2717 To column <count> 2718‘<count> f<char>’ 2719 <count> <char>s to the right (find). 2720‘<count> t<char>’ 2721 Till before <count> <char>s to the right. 2722‘<count> F<char>’ 2723 <count> <char>s to the left. 2724‘<count> T<char>’ 2725 Till after <count> <char>s to the left. 2726‘<count> ;’ 2727 Repeat latest ‘f t F T’ <count> times. 2728‘<count> ,’ 2729 Repeat latest ‘f t F T’ <count> times in opposite direction. 2730‘<count> w’ 2731 <count> words forward. 2732‘<count> W’ 2733 <count> WORDS forward. 2734‘<count> b’ 2735 <count> words backward. 2736‘<count> B’ 2737 <count> WORDS backward. 2738‘<count> e’ 2739 To the end of word <count> forward. 2740‘<count> E’ 2741 To the end of WORD <count> forward. 2742‘<count> G’ 2743 Go to line <count> (default end-of-file). 2744‘<count> H’ 2745 To line <count> from top of the screen (home). 2746‘<count> L’ 2747 To line <count> from bottom of the screen (last). 2748‘M’ 2749 To the middle line of the screen. 2750‘<count> )’ 2751 <count> sentences forward. 2752‘<count> (’ 2753 <count> sentences backward. 2754‘<count> }’ 2755 <count> paragraphs forward. 2756‘<count> {’ 2757 <count> paragraphs backward. 2758‘<count> ]]’ 2759 To the <count>th heading. 2760‘<count> [[’ 2761 To the <count>th previous heading. 2762‘<count> []’ 2763 To the end of <count>th heading. 2764‘m<a-z>’ 2765 Mark the cursor position with a letter. 2766‘`<a-z>’ 2767 To the mark. 2768‘'<a-z>’ 2769 To the first CHAR of the line with the mark. 2770‘[<a-z>’ 2771 Show contents of textmarker. 2772‘]<a-z>’ 2773 Show contents of register. 2774‘``’ 2775 To the cursor position before the latest absolute jump (of which 2776 are examples ‘/’ and ‘G’). 2777‘''’ 2778 To the first CHAR of the line on which the cursor was placed before 2779 the latest absolute jump. 2780‘<count> /<string>’ 2781 To the <count>th occurrence of <string>. 2782‘<count> /<cr>’ 2783 To the <count>th occurrence of <string> from previous ‘/ or ?’. 2784‘<count> ?<string>’ 2785 To the <count>th previous occurrence of <string>. 2786‘<count> ?<cr>’ 2787 To the <count>th previous occurrence of <string> from previous ‘? 2788 or /’. 2789‘n’ 2790 Repeat latest ‘/’ ‘?’ (next). 2791‘N’ 2792 Repeat latest search in opposite direction. 2793‘C-c /’ 2794 Without a prefix argument, this command toggles 2795 case-sensitive/case-insensitive search modes and plain 2796 vanilla/regular expression search. With the prefix argument 1, 2797 i.e., ‘1 C-c /’, this toggles case-sensitivity; with the prefix 2798 argument 2, toggles plain vanilla search and search using regular 2799 expressions. *Note Viper Specials::, for alternative ways to 2800 invoke this function. 2801‘%’ 2802 Find the next bracket/parenthesis/brace and go to its match. By 2803 default, Viper ignores brackets/parentheses/braces that occur 2804 inside parentheses. You can change this by setting 2805 ‘viper-parse-sexp-ignore-comments’ to ‘nil’ in your Viper 2806 customization file. This option can also be toggled interactively 2807 if you quickly hit ‘%%%’. 2808 2809 This latter feature is implemented as a vi-style keyboard macro. 2810 If you don’t want this macro, put 2811 2812 (viper-set-parsing-style-toggling-macro 'undefine) 2813 2814 in your Viper customization file. 2815 2816 2817File: viper.info, Node: Marking, Next: Appending Text, Prev: Move Commands, Up: Text Handling 2818 28194.2.2 Marking 2820------------- 2821 2822Emacs mark is referred to in the region specifiers ‘r’ and ‘R’. *Note 2823Emacs Preliminaries::, and *Note Basics::, for explanation. Also see 2824*note Mark: (emacs)Mark, for an explanation of the Emacs mark ring. 2825 2826‘m<a-z>’ 2827 Mark the current file and position with the specified letter. 2828‘m .’ 2829 Set the Emacs mark (*note Emacs Preliminaries::) at point. 2830‘m ^’ 2831 Set the Emacs mark (*note Emacs Preliminaries::) back to where it 2832 was last set with the ‘m.’ command. This is useful when you set 2833 the mark with ‘m.’, but then some other command (such as ‘L’ or 2834 ‘G’) changes it in a way that you didn’t like. 2835‘m <’ 2836 Set the Emacs mark at beginning of buffer. 2837‘m >’ 2838 Set the Emacs mark at end of buffer. 2839‘m ,’ 2840 Jump to the Emacs mark. 2841‘:mark <char>’ 2842 Mark position with text marker named <char>. This is an Ex 2843 command. 2844‘:k <char>’ 2845 Same as ‘:mark’. 2846‘``’ 2847 Exchange point and mark. 2848‘''’ 2849 Exchange point and mark and go to the first CHAR on line. 2850‘'<a-z>’ 2851 Go to specified Viper mark. 2852‘`<a-z>’ 2853 Go to specified Viper mark and go to the first CHAR on line. 2854 2855 2856File: viper.info, Node: Appending Text, Next: Editing in Insert State, Prev: Marking, Up: Text Handling 2857 28584.2.3 Appending Text 2859-------------------- 2860 2861*Note Options::, to see how to change tab and shiftwidth size. See the 2862GNU Emacs manual, or try ‘C-ha tabs’ (If you have turned Emacs help on). 2863Check out the variable ‘indent-tabs-mode’ to put in just spaces. Also 2864see options for word-wrap. 2865 2866‘<count> a’ 2867 <count> times after the cursor. 2868‘<count> A’ 2869 <count> times at the end of line. 2870‘<count> i’ 2871 <count> times before the cursor (insert). 2872‘<count> I’ 2873 <count> times before the first CHAR of the line 2874‘<count> o’ 2875 On a new line below the current (open). The count is only useful 2876 on a slow terminal. 2877‘<count> O’ 2878 On a new line above the current. The count is only useful on a 2879 slow terminal. 2880‘<count> ><move>’ 2881 Shift the lines described by <count><move> one shiftwidth to the 2882 right (layout!). 2883‘<count> >>’ 2884 Shift <count> lines one shiftwidth to the right. 2885‘<count> ["<a-z1-9>]p’ 2886 Put the contents of the (default undo) buffer <count> times after 2887 the cursor. The register will be automatically down-cased. 2888‘<count> ["<a-z1-9>]P’ 2889 Put the contents of the (default undo) buffer <count> times before 2890 the cursor. The register will 2891‘[<a-z>’ 2892 Show contents of textmarker. 2893‘]<a-z>’ 2894 Show contents of register. 2895‘<count> .’ 2896 Repeat previous command <count> times. For destructive commands as 2897 well as undo. 2898‘f1 1 and f1 2’ 2899 While ‘.’ repeats the last destructive command, these two macros 2900 repeat the second-last and the third-last destructive commands. 2901 *Note Vi Macros::, for more information on Vi macros. 2902‘C-c M-p and C-c M-n’ 2903 In Vi state, these commands help peruse the history of Vi’s 2904 destructive commands. Successive typing of ‘C-c M-p’ causes Viper 2905 to search the history in the direction of older commands, while 2906 hitting ‘C-c M-n’ does so in reverse order. Each command in the 2907 history is displayed in the minibuffer. The displayed command can 2908 then be executed by typing a period. 2909 2910 Since typing the above sequences of keys may be tedious, the 2911 functions doing the perusing can be bound to unused keyboard keys 2912 in the Viper customization file. *Note Viper Specials::, for 2913 details. 2914 2915 2916File: viper.info, Node: Editing in Insert State, Next: Deleting Text, Prev: Appending Text, Up: Text Handling 2917 29184.2.4 Editing in Insert State 2919----------------------------- 2920 2921Minibuffer can be edited similarly to Insert state, and you can switch 2922between Insert/Replace/Vi states at will. Some users prefer plain Emacs 2923feel in the minibuffer. To this end, set ‘viper-vi-style-in-minibuffer’ 2924to ‘nil’. 2925 2926‘C-v’ 2927 Deprive the next char of its special meaning (quoting). 2928‘C-h’ 2929 One char back. 2930‘C-w’ 2931 One word back. 2932‘C-u’ 2933 Back to the begin of the change on the current line. 2934 2935 2936File: viper.info, Node: Deleting Text, Next: Changing Text, Prev: Editing in Insert State, Up: Text Handling 2937 29384.2.5 Deleting Text 2939------------------- 2940 2941There is one difference in text deletion that you should be aware of. 2942This difference comes from Emacs and was adopted in Viper because we 2943find it very useful. In Vi, if you delete a line, say, and then another 2944line, these two deletions are separated and are put back separately if 2945you use the ‘p’ command. In Emacs (and Viper), successive series of 2946deletions that are _not interrupted_ by other commands are lumped 2947together, so the deleted text gets accumulated and can be put back as 2948one chunk. If you want to break a sequence of deletions so that the 2949newly deleted text could be put back separately from the previously 2950deleted text, you should perform a non-deleting action, e.g., move the 2951cursor one character in any direction. 2952 2953‘<count> x’ 2954 Delete <count> chars under and after the cursor. 2955‘<count> X’ 2956 Delete <count> chars before the cursor. 2957‘<count> d<move>’ 2958 Delete from point to endpoint of <count><move>. 2959‘<count> dd’ 2960 Delete <count> lines. 2961‘D’ 2962 The rest of the line. 2963‘<count> <<move>’ 2964 Shift the lines described by <count><move> one shiftwidth to the 2965 left (layout!). 2966‘<count> <<’ 2967 Shift <count> lines one shiftwidth to the left. 2968 2969 2970File: viper.info, Node: Changing Text, Next: Search and Replace, Prev: Deleting Text, Up: Text Handling 2971 29724.2.6 Changing Text 2973------------------- 2974 2975‘<count> r<char>’ 2976 Replace <count> chars by <char>; no <esc>. 2977‘<count> R’ 2978 Overwrite the rest of the line, appending change COUNT − 1 times. 2979‘<count> s’ 2980 Substitute <count> chars. 2981‘<count> S’ 2982 Change <count> lines. 2983‘<count> c<move>’ 2984 Change from begin to endpoint of <count><move>. 2985‘<count> cc’ 2986 Change <count> lines. 2987‘<count> C’ 2988 The rest of the line and <count> − 1 next lines. 2989‘<count> =<move>’ 2990 Reindent the region described by move. 2991‘<count> ~’ 2992 Switch lower and upper cases. 2993‘<count> J’ 2994 Join <count> lines (default 2). 2995‘:[x,y]s/<pat>/<repl>/<f>’ 2996 Substitute (on lines x through y) the pattern <pat> (default the 2997 last pattern) with <repl>. Useful flags <f> are ‘g’ for ‘global’ 2998 (i.e., change every non-overlapping occurrence of <pat>) and ‘c’ 2999 for ‘confirm’ (type ‘y’ to confirm a particular substitution, else 3000 ‘n’ ). Instead of ‘/’ any punctuation CHAR unequal to <space> 3001 <tab> and <lf> can be used as delimiter. 3002 3003 In Emacs, ‘\&’ stands for the last matched expression, so 3004 ‘s/[ab]+/\&\&/’ will double the string matched by ‘[ab]’. Viper 3005 doesn’t treat ‘&’ specially, unlike Vi: use ‘\&’ instead. 3006 3007 Viper does not parse search patterns and does not expand special 3008 symbols found there (e.g., ‘~’ is not expanded to the result of the 3009 previous substitution). 3010 3011 Note: _The newline character (inserted as ‘C-qC-j’) can be used in 3012 <repl>_. 3013‘:[x,y]copy [z]’ 3014 Copy text between ‘x’ and ‘y’ to the position after ‘z’. 3015‘:[x,y]t [z]’ 3016 Same as ‘:copy’. 3017‘:[x,y]move [z]’ 3018 Move text between ‘x’ and ‘y’ to the position after ‘z’. 3019‘&’ 3020 Repeat latest Ex substitute command, e.g., ‘:s/wrong/right’. 3021‘:x,yp’ 3022‘:g/Pat/p’ 3023‘:v/Pat/p’ 3024 The above commands display certain buffer lines in a temporary 3025 buffer. The first form above displays the buffer lines between ‘x’ 3026 and ‘y’. The second displays the lines of the buffer, which match 3027 a given pattern. The third form displays the lines that do _not_ 3028 match the given pattern. 3029‘#c<move>’ 3030 Change upper-case characters in the region to lower-case. 3031‘#C<move>’ 3032 Change lower-case characters in the region to upper-case. 3033‘#q<move>’ 3034 Insert specified string at the beginning of each line in the region 3035‘C-c M-p and C-c M-n’ 3036 In Insert and Replace states, these keys are bound to commands that 3037 peruse the history of the text previously inserted in other insert 3038 or replace commands. By repeatedly typing ‘C-c M-p’ or ‘C-c M-n’, 3039 you will cause Viper to insert these previously used strings one by 3040 one. When a new string is inserted, the previous one is deleted. 3041 3042 In Vi state, these keys are bound to functions that peruse the 3043 history of destructive Vi commands. *Note Viper Specials::, for 3044 details. 3045 3046 3047File: viper.info, Node: Search and Replace, Next: Yanking, Prev: Changing Text, Up: Text Handling 3048 30494.2.7 Search and Replace 3050------------------------ 3051 3052*Note Groundwork::, for Ex address syntax. *Note Options::, to see how 3053to get literal (non-regular-expression) search and how to stop search 3054from wrapping around. 3055 3056‘C-c /’ 3057 Toggle case-sensitive search. With prefix argument, toggle 3058 vanilla/regular expression search. 3059‘<count> /<string>’ 3060 To the <count>th occurrence of <string>. 3061 3062 Viper does not parse search patterns and does not expand special 3063 symbols found there (e.g., ‘~’ is not expanded to the result of the 3064 previous substitution). 3065 3066 After typing ‘/’ or ‘?’ all the usual Emacs minibuffer commands, 3067 such as ‘M-p’ and ‘M-n’ are available. In addition, typing ‘C-s’ 3068 will insert the last search string used by the Emacs incremental 3069 search command (which is bound to ‘C-s’ everywhere except in this 3070 case). 3071 3072‘<count> ?<string>’ 3073 To the <count>th previous occurrence of <string>. 3074‘<count> g<move>’ 3075 Search for the text described by move. (off by default) 3076‘n’ 3077 Repeat latest ‘/’ ‘?’ (next). 3078‘N’ 3079 Idem in opposite direction. 3080‘%’ 3081 Find the next bracket and go to its match 3082‘:[x,y]g/<string>/<cmd>’ 3083 Search globally [from line x to y] for <string> and execute the Ex 3084 <cmd> on each occurrence. 3085‘:[x,y]v/<string>/<cmd>’ 3086 Execute <cmd> on the lines that don’t match. 3087‘#g<move>’ 3088 Execute the last keyboard macro for each line in the region. *Note 3089 Macros and Registers::, for more info. 3090‘Q’ 3091 Query Replace. 3092‘:ta <name>’ 3093 Search in the tags file where <name> is defined (file, line), and 3094 go to it. 3095‘:[x,y]s/<pat>/<repl>/<f>’ 3096 Substitute (on lines x through y) the pattern <pat> (default the 3097 last pattern) with <repl>. Useful flags <f> are ‘g’ for ‘global’ 3098 (i.e., change every non-overlapping occurrence of <pat>) and ‘c’ 3099 for ‘confirm’ (type ‘y’ to confirm a particular substitution, else 3100 ‘n’). Instead of ‘/’ any punctuation character other than <space> 3101 <tab> and <lf> can be used as delimiter. 3102 3103 Note: _The newline character (inserted as ‘C-qC-j’) can be used in 3104 <repl>_. 3105‘&’ 3106 Repeat latest Ex substitute command, e.g., ‘:s/wrong/right’. 3107‘:global /<pattern>/<ex-command>’ 3108‘:g /<pattern>/<ex-command>’ 3109 Execute <ex-command> on all lines that match <pattern>. 3110‘:vglobal /<pattern>/<ex-command>’ 3111‘:v /<pattern>/<ex-command>’ 3112 Execute <ex-command> on all lines that do not match <pattern>. 3113 3114 3115File: viper.info, Node: Yanking, Next: Undoing, Prev: Search and Replace, Up: Text Handling 3116 31174.2.8 Yanking 3118------------- 3119 3120‘<count> y<move>’ 3121 Yank from begin to endpoint of <count><move>. 3122‘<count> "<a-z>y<move>’ 3123 Yank from begin to endpoint of <count><move> to register. 3124‘<count> "<A-Z>y<move>’ 3125 Yank from begin to endpoint of <count><move> and append to 3126 register. 3127‘<count> yy’ 3128 <count> lines. 3129‘<count> Y’ 3130 Idem (should be equivalent to ‘y$’ though). 3131‘m<a-z>’ 3132 Mark the cursor position with a letter. 3133‘[<a-z>’ 3134 Show contents of textmarker. 3135‘]<a-z>’ 3136 Show contents of register. 3137‘<count> ["<a-z1-9>]p’ 3138 Put the contents of the (default undo) buffer <count> times after 3139 the cursor. The register will be automatically down-cased. 3140‘<count> ["<a-z1-9>]P’ 3141 Put the contents of the (default undo) buffer <count> times before 3142 the cursor. The register will 3143 3144 3145File: viper.info, Node: Undoing, Prev: Yanking, Up: Text Handling 3146 31474.2.9 Undoing 3148------------- 3149 3150‘u U’ 3151 Undo the latest change. 3152‘.’ 3153 Repeat undo. 3154‘:q!’ 3155 Quit Vi without writing. 3156‘:e!’ 3157 Re-edit a messed-up file. 3158‘:rec’ 3159 Recover file from autosave. Viper also creates backup files that 3160 have a ‘~’ appended to them. 3161 3162 3163File: viper.info, Node: Display, Next: File and Buffer Handling, Prev: Text Handling, Up: Commands 3164 31654.3 Display 3166=========== 3167 3168‘C-g’ 3169 At user level 1, give file name, status, current line number and 3170 relative position. 3171 At user levels 2 and higher, abort the current command. 3172‘C-c g’ 3173 Give file name, status, current line number and relative 3174 position—all user levels. 3175‘C-l’ 3176 Refresh the screen. 3177‘<count> C-e’ 3178 Expose <count> more lines at bottom, cursor stays put (if 3179 possible). 3180‘<count> C-y’ 3181 Expose <count> more lines at top, cursor stays put (if possible). 3182‘<count> C-d’ 3183 Scroll <count> lines downward (default the number of the previous 3184 scroll; initialization: half a page). 3185‘<count> C-u’ 3186 Scroll <count> lines upward (default the number of the previous 3187 scroll; initialization: half a page). 3188‘<count> C-f’ 3189 <count> pages forward. 3190‘<count> C-b’ 3191 <count> pages backward (in older versions ‘C-b’ only works without 3192 count). 3193‘<count> z<cr>’ 3194‘zH’ 3195 Put line <count> at the top of the window (default the current 3196 line). 3197‘<count> z-’ 3198‘zL’ 3199 Put line <count> at the bottom of the window (default the current 3200 line). 3201‘<count> z.’ 3202‘zM’ 3203 Put line <count> in the center of the window (default the current 3204 line). 3205 3206 3207File: viper.info, Node: File and Buffer Handling, Next: Mapping, Prev: Display, Up: Commands 3208 32094.4 File and Buffer Handling 3210============================ 3211 3212In all file handling commands, space should be typed before entering the 3213file name. If you need to type a modifier, such as ‘>>’ or ‘!’, don’t 3214put any space between the command and the modifier. 3215 3216 Note that many Ex commands, e.g., ‘:w’, accept command arguments. 3217The effect is that the command would start acting on the current region. 3218For instance, if the current region spans the lines 11 through 22, then 3219if you type ‘1:w’ you would see ‘:11,22w’ in the minibuffer. 3220 3221‘:q’ 3222 Quit buffer except if modified. 3223‘:q!’ 3224 Quit buffer without checking. In Viper, these two commands are 3225 identical. Confirmation is required if exiting modified buffers 3226 that visit files. 3227‘:suspend’ 3228‘:stop’ 3229 Suspend Viper 3230‘:[x,y] w’ 3231 Write the file. Viper makes sure that a final newline is always 3232 added to any file where this newline is missing. This is done by 3233 setting Emacs variable ‘require-final-newline’ to ‘t’. If you 3234 don’t like this feature, use ‘setq-default’ to set 3235 ‘require-final-newline’ to ‘nil’. This must be done in the Viper 3236 customization file. 3237‘:[x,y] w <name>’ 3238 Write to the file <name>. 3239‘:[x,y] w>> <name>’ 3240 Append the buffer to the file <name>. There should be no space 3241 between ‘w’ and ‘>>’. Type space after the ‘>>’ and see what 3242 happens. 3243‘:w! <name>’ 3244 Overwrite the file <name>. In Viper, ‘:w’ and ‘:w!’ are identical. 3245 Confirmation is required for writing to an existing file (if this 3246 is not the file the buffer is visiting) or to a read-only file. 3247‘:x,y w <name>’ 3248 Write lines x through y to the file <name>. 3249‘:wq’ 3250 Write the file and kill buffer. 3251‘:r <file> [<file> ...]’ 3252 Read file into a buffer, inserting its contents after the current 3253 line. 3254‘:xit’ 3255 Same as ‘:wq’. 3256‘:Write’ 3257‘:W’ 3258 Save all unsaved buffers, asking for confirmation. 3259‘:WWrite’ 3260‘:WW’ 3261 Like ‘W’, but without asking for confirmation. 3262‘ZZ’ 3263 Save current buffer and kill it. If user level is 1, then save all 3264 files and kill Emacs. Killing Emacs is the wrong way to use it, so 3265 you should switch to higher user levels as soon as possible. 3266‘:x [<file>]’ 3267 Save and kill buffer. 3268‘:x! [<file>]’ 3269 ‘:w![<file>]’ and ‘:q’. 3270‘:pre’ 3271 Preserve the file—autosave buffers. 3272‘:rec’ 3273 Recover file from autosave. 3274‘:f [<file>]’ 3275 without the argument, prints file name and character/line 3276 information afout the currently visited file. With an argument, 3277 sets the currently visited filename to ‘file’. 3278‘:cd [<dir>]’ 3279 Set the working directory to <dir> (default home directory). 3280‘:pwd’ 3281 Print present working directory. 3282‘:e [+<cmd>] <files>’ 3283 Edit files. If no filename is given, edit the file visited by the 3284 current buffer. If buffer was modified or the file changed on 3285 disk, ask for confirmation. Unlike Vi, Viper allows ‘:e’ to take 3286 multiple arguments. The first file is edited the same way as in 3287 Vi. The rest are visited in the usual Emacs way. 3288‘:e! [+<cmd>] <files>’ 3289 Re-edit file. If no filename, re-edit current file. In Viper, 3290 unlike Vi, ‘e!’ is identical to ‘:e’. In both cases, the user is 3291 asked to confirm if there is a danger of discarding changes to a 3292 buffer. 3293‘:q!’ 3294 Quit Vi without writing. 3295‘C-^’ 3296 Edit the alternate (normally the previous) file. 3297‘:rew’ 3298 Obsolete 3299‘:args’ 3300 List files not shown anywhere with counts for next 3301‘:n [count] [+<cmd>] [<files>]’ 3302 Edit <count> file, or edit files. The count comes from ‘:args’. 3303‘:N [count] [+<cmd>] [<files>]’ 3304 Like ‘:n’, but the meaning of the variable ‘ex-cycle-other-window’ 3305 is reversed. 3306‘:b’ 3307 Switch to another buffer. If ‘ex-cycle-other-window’ is ‘t’, 3308 switch in another window. Buffer completion is supported. The 3309 variable ‘viper-read-buffer-function’ controls which function is 3310 actually used to read the buffer name. The default is 3311 ‘read-buffer’, but better alternatives are also available in Emacs 3312 (e.g., ‘ido-read-buffer’). 3313‘:B’ 3314 Like ‘:b’, but the meaning of ‘ex-cycle-other-window’ is reversed. 3315‘:<address>r <name>’ 3316 Read the file <name> into the buffer after the line <address>. 3317‘v, V, C-v’ 3318 Edit a file in current or another window, or in another frame. 3319 File name is typed in minibuffer. File completion and history are 3320 supported. 3321 3322 3323File: viper.info, Node: Mapping, Next: Shell Commands, Prev: File and Buffer Handling, Up: Commands 3324 33254.5 Mapping 3326=========== 3327 3328‘:map <string>’ 3329 Start defining a Vi-style keyboard macro. For instance, typing 3330 ‘:map www’ followed by ‘:!wc %’ and then typing ‘C-x )’ will cause 3331 ‘www’ to run wc on current file (Vi replaces ‘%’ with the current 3332 file name). 3333‘C-x )’ 3334 Finish defining a keyboard macro. In Viper, this command completes 3335 the process of defining all keyboard macros, whether they are 3336 Emacs-style or Vi-style. This is a departure from Vi, needed to 3337 allow WYSIWYG mapping of keyboard macros and to permit the use of 3338 function keys and arbitrary Emacs functions in the macros. 3339‘:unmap <string>’ 3340 Deprive <string> of its mappings in Vi state. 3341‘:map! <string>’ 3342 Map a macro for Insert state. 3343‘:unmap! <string>’ 3344 Deprive <string> of its mapping in Insert state (see ‘:unmap’). 3345‘@<a-z>’ 3346 In Vi state, execute the contents of register as a command. 3347‘@@’ 3348 In Vi state, repeat last register command. 3349‘@#’ 3350 In Vi state, begin keyboard macro. End with @<a-z>. This will put 3351 the macro in the proper register. Register will be automatically 3352 down-cased. *Note Macros and Registers::, for more info. 3353‘@!<a-z>’ 3354 In Vi state, yank anonymous macro to register 3355‘*’ 3356 In Vi state, execute anonymous macro (defined by C-x( and C-x )). 3357‘C-x e’ 3358 Like ‘*’, but works in all Viper states. 3359‘#g<move>’ 3360 Execute the last keyboard macro for each line in the region. *Note 3361 Macros and Registers::, for more info. 3362‘[<a-z>’ 3363 Show contents of textmarker. 3364‘]<a-z>’ 3365 Show contents of register. 3366 3367 3368File: viper.info, Node: Shell Commands, Next: Options, Prev: Mapping, Up: Commands 3369 33704.6 Shell Commands 3371================== 3372 3373The symbol ‘%’ is used in Ex shell commands to mean current file. If 3374you want a ‘%’ in your command, it must be escaped as ‘\%’. However if 3375‘%’ is the first character, it stands as the address for the whole file. 3376Similarly, ‘#’ expands to the previous file. The previous file is the 3377first file in ‘:args’ listing. This defaults to the previous file in 3378the VI sense if you have one window. 3379 3380 Symbols ‘%’ and ‘#’ are also used in the Ex commands ‘:e’ and ‘:r 3381<shell-cmd>’. The commands ‘:w’ and the regular ‘:r <file>’ command 3382don’t support these meta symbols, because file history is a better 3383mechanism. 3384 3385‘:sh’ 3386 Execute a subshell in another window 3387‘:[x,y]!<cmd>’ 3388 Execute a shell <cmd> [on lines x through y; % is replace by 3389 current file, \% is changed to % 3390‘:[x,y]!! [<args>]’ 3391 Repeat last shell command [and append <args>]. 3392‘:!<cmd>’ 3393 Just execute command and display result in a buffer. 3394‘:!! <args>’ 3395 Repeat last shell command and append <args> 3396‘<count> !<move><cmd>’ 3397 The shell executes <cmd>, with standard input the lines described 3398 by <count><move>, next the standard output replaces those lines 3399 (think of ‘cb’, ‘sort’, ‘nroff’, etc.). 3400‘<count> !!<cmd>’ 3401 Give <count> lines as standard input to the shell <cmd>, next let 3402 the standard output replace those lines. 3403‘:[x,y] w !<cmd>’ 3404 Let lines x to y be standard input for <cmd> (notice the <sp> 3405 between ‘w’ and ‘!’). 3406‘:<address>r !<cmd>’ 3407 Put the output of <cmd> after the line <address> (default current). 3408‘:<address>r <name>’ 3409 Read the file <name> into the buffer after the line <address> 3410 (default current). 3411‘:make’ 3412 Run the make command in the current directory. 3413 3414 3415File: viper.info, Node: Options, Next: Emacs Related Commands, Prev: Shell Commands, Up: Commands 3416 34174.7 Options 3418=========== 3419 3420‘autoindent’ 3421‘ai’ 3422 autoindent: In append mode after a <cr> the cursor will move 3423 directly below the first character on the previous line. This 3424 setting affects the current buffer only. 3425‘autoindent-global’ 3426‘ai-global’ 3427 Same as ‘autoindent’, but affects all buffers. 3428‘noautoindent’ 3429‘noai’ 3430 Cancel autoindent. 3431‘noautoindent-global’ 3432‘noai-g’ 3433 Cancel autoindent-global. 3434‘ignorecase’ 3435‘ic’ 3436 ignorecase: No distinction between upper and lower cases when 3437 searching. 3438‘noignorecase’ 3439‘noic’ 3440 Cancel ignorecase. 3441‘magic’ 3442‘ma’ 3443 Regular expressions used in searches; nomagic means no regexps. 3444‘nomagic’ 3445‘noma’ 3446 Cancel magic. 3447‘readonly’ 3448‘ro’ 3449 readonly: The file is not to be changed. If the user attempts to 3450 write to this file, confirmation will be requested. 3451‘noreadonly’ 3452‘noro’ 3453 Cancel readonly. 3454‘shell=<string>’ 3455‘sh=<string>’ 3456 shell: The program to be used for shell escapes (default ‘$SHELL’ 3457 (default ‘/bin/sh’)). 3458‘shiftwidth=<count>’ 3459‘sw=<count>’ 3460 shiftwidth: Gives the shiftwidth (default 8 positions). 3461‘showmatch’ 3462‘sm’ 3463 showmatch: Whenever you append a ‘)’, Vi shows its match if it’s on 3464 the same page; also with ‘{’ and ‘}’. If there’s no match, Vi will 3465 beep. 3466‘noshowmatch’ 3467‘nosm’ 3468 Cancel showmatch. 3469‘tabstop=<count>’ 3470‘ts=<count>’ 3471 tabstop: The length of a <ht>; warning: this is only IN the editor, 3472 outside of it <ht>s have their normal length (default 8 positions). 3473 This setting affects the current buffer only. 3474‘tabstop-global’ 3475‘ts-g’ 3476 Same as ‘tabstop’, but affects all buffers. 3477‘wrapmargin=<count>’ 3478‘wm=<count>’ 3479 wrapmargin: In append mode Vi automatically puts an <lf> whenever 3480 there is an <sp> or <ht> within <wm> columns from the right margin. 3481‘wrapscan’ 3482‘ws’ 3483 wrapscan: When searching, the end is considered ‘stuck’ to the 3484 begin of the file. 3485‘nowrapscan’ 3486‘nows’ 3487 Cancel wrapscan. 3488‘:set <option>’ 3489 Turn <option> on. 3490‘:set no<option>’ 3491 Turn <option> off. 3492‘:set <option>=<value>’ 3493 Set <option> to <value>. 3494 3495 3496File: viper.info, Node: Emacs Related Commands, Next: Mouse-bound Commands, Prev: Options, Up: Commands 3497 34984.8 Emacs Related Commands 3499========================== 3500 3501‘C-\’ 3502 Begin Meta command in Vi or Insert states. Most often used as C-\ 3503 x (M-x). 3504 3505 Note: Emacs binds ‘C-\’ to a function that offers to change the 3506 keyboard input method in the multilingual environment. Viper 3507 overrides this binding. However, it is still possible to switch 3508 the input method by typing ‘\ C-\’ in the Vi command state and ‘C-z 3509 \ C-\’ in the Insert state. Or you can use the MULE menu on the 3510 menubar. 3511‘C-z’ 3512 In Insert and Replace states, prepare Viper to accept the next 3513 command and execute it as if Viper was in Vi state. Then return to 3514 Insert state. 3515 3516 In Vi state, switch to Emacs state; in Emacs state, switch to Vi 3517 state. 3518‘C-c \’ 3519 Switches to Vi state for the duration of a single command. Then 3520 goes back to the original Viper state. Works from Vi, Insert, 3521 Replace, and Emacs states. 3522‘C-x0’ 3523 Close Window 3524‘C-x1’ 3525 Close Other Windows 3526‘C-x2’ 3527 Split Window 3528‘C-xo’ 3529 Move among windows 3530‘C-xC-f’ 3531 Emacs find-file, useful in Insert state 3532‘C-y’ 3533 Put back the last killed text. Similar to Vi’s ‘p’, but also works 3534 in Insert and Replace state. This command doesn’t work in Vi 3535 command state, since this binding is taken for something else. 3536‘M-y’ 3537 Undoes the last ‘C-y’ and puts another kill from the kill ring. 3538 Using this command, you can try may different kills until you find 3539 the one you need. 3540 3541 3542File: viper.info, Node: Mouse-bound Commands, Prev: Emacs Related Commands, Up: Commands 3543 35444.9 Mouse-bound Commands 3545======================== 3546 3547The following two mouse actions are normally bound to special search and 3548insert commands in of Viper: 3549 3550‘S-mouse-1’ 3551 Holding Shift and clicking mouse button 1 will initiate search for 3552 a region under the mouse pointer. This command can take a prefix 3553 argument. Note: Viper sets this binding only if this mouse action 3554 is not already bound to something else. *Note Viper Specials::, 3555 for more information. 3556 3557‘S-mouse-2’ 3558 Holding Shift and clicking button 2 of the mouse will insert a 3559 region surrounding the mouse pointer. This command can also take a 3560 prefix argument. Note: Viper sets this binding only if this mouse 3561 action is not already bound to something else. *Note Viper 3562 Specials::, for more details. 3563 3564 3565File: viper.info, Node: GNU Free Documentation License, Next: Acknowledgments, Prev: Commands, Up: Top 3566 3567Appendix A GNU Free Documentation License 3568***************************************** 3569 3570 Version 1.3, 3 November 2008 3571 3572 Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. 3573 <https://fsf.org/> 3574 3575 Everyone is permitted to copy and distribute verbatim copies 3576 of this license document, but changing it is not allowed. 3577 3578 0. PREAMBLE 3579 3580 The purpose of this License is to make a manual, textbook, or other 3581 functional and useful document “free” in the sense of freedom: to 3582 assure everyone the effective freedom to copy and redistribute it, 3583 with or without modifying it, either commercially or 3584 noncommercially. Secondarily, this License preserves for the 3585 author and publisher a way to get credit for their work, while not 3586 being considered responsible for modifications made by others. 3587 3588 This License is a kind of “copyleft”, which means that derivative 3589 works of the document must themselves be free in the same sense. 3590 It complements the GNU General Public License, which is a copyleft 3591 license designed for free software. 3592 3593 We have designed this License in order to use it for manuals for 3594 free software, because free software needs free documentation: a 3595 free program should come with manuals providing the same freedoms 3596 that the software does. But this License is not limited to 3597 software manuals; it can be used for any textual work, regardless 3598 of subject matter or whether it is published as a printed book. We 3599 recommend this License principally for works whose purpose is 3600 instruction or reference. 3601 3602 1. APPLICABILITY AND DEFINITIONS 3603 3604 This License applies to any manual or other work, in any medium, 3605 that contains a notice placed by the copyright holder saying it can 3606 be distributed under the terms of this License. Such a notice 3607 grants a world-wide, royalty-free license, unlimited in duration, 3608 to use that work under the conditions stated herein. The 3609 “Document”, below, refers to any such manual or work. Any member 3610 of the public is a licensee, and is addressed as “you”. You accept 3611 the license if you copy, modify or distribute the work in a way 3612 requiring permission under copyright law. 3613 3614 A “Modified Version” of the Document means any work containing the 3615 Document or a portion of it, either copied verbatim, or with 3616 modifications and/or translated into another language. 3617 3618 A “Secondary Section” is a named appendix or a front-matter section 3619 of the Document that deals exclusively with the relationship of the 3620 publishers or authors of the Document to the Document’s overall 3621 subject (or to related matters) and contains nothing that could 3622 fall directly within that overall subject. (Thus, if the Document 3623 is in part a textbook of mathematics, a Secondary Section may not 3624 explain any mathematics.) The relationship could be a matter of 3625 historical connection with the subject or with related matters, or 3626 of legal, commercial, philosophical, ethical or political position 3627 regarding them. 3628 3629 The “Invariant Sections” are certain Secondary Sections whose 3630 titles are designated, as being those of Invariant Sections, in the 3631 notice that says that the Document is released under this License. 3632 If a section does not fit the above definition of Secondary then it 3633 is not allowed to be designated as Invariant. The Document may 3634 contain zero Invariant Sections. If the Document does not identify 3635 any Invariant Sections then there are none. 3636 3637 The “Cover Texts” are certain short passages of text that are 3638 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 3639 that says that the Document is released under this License. A 3640 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 3641 be at most 25 words. 3642 3643 A “Transparent” copy of the Document means a machine-readable copy, 3644 represented in a format whose specification is available to the 3645 general public, that is suitable for revising the document 3646 straightforwardly with generic text editors or (for images composed 3647 of pixels) generic paint programs or (for drawings) some widely 3648 available drawing editor, and that is suitable for input to text 3649 formatters or for automatic translation to a variety of formats 3650 suitable for input to text formatters. A copy made in an otherwise 3651 Transparent file format whose markup, or absence of markup, has 3652 been arranged to thwart or discourage subsequent modification by 3653 readers is not Transparent. An image format is not Transparent if 3654 used for any substantial amount of text. A copy that is not 3655 “Transparent” is called “Opaque”. 3656 3657 Examples of suitable formats for Transparent copies include plain 3658 ASCII without markup, Texinfo input format, LaTeX input format, 3659 SGML or XML using a publicly available DTD, and standard-conforming 3660 simple HTML, PostScript or PDF designed for human modification. 3661 Examples of transparent image formats include PNG, XCF and JPG. 3662 Opaque formats include proprietary formats that can be read and 3663 edited only by proprietary word processors, SGML or XML for which 3664 the DTD and/or processing tools are not generally available, and 3665 the machine-generated HTML, PostScript or PDF produced by some word 3666 processors for output purposes only. 3667 3668 The “Title Page” means, for a printed book, the title page itself, 3669 plus such following pages as are needed to hold, legibly, the 3670 material this License requires to appear in the title page. For 3671 works in formats which do not have any title page as such, “Title 3672 Page” means the text near the most prominent appearance of the 3673 work’s title, preceding the beginning of the body of the text. 3674 3675 The “publisher” means any person or entity that distributes copies 3676 of the Document to the public. 3677 3678 A section “Entitled XYZ” means a named subunit of the Document 3679 whose title either is precisely XYZ or contains XYZ in parentheses 3680 following text that translates XYZ in another language. (Here XYZ 3681 stands for a specific section name mentioned below, such as 3682 “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) 3683 To “Preserve the Title” of such a section when you modify the 3684 Document means that it remains a section “Entitled XYZ” according 3685 to this definition. 3686 3687 The Document may include Warranty Disclaimers next to the notice 3688 which states that this License applies to the Document. These 3689 Warranty Disclaimers are considered to be included by reference in 3690 this License, but only as regards disclaiming warranties: any other 3691 implication that these Warranty Disclaimers may have is void and 3692 has no effect on the meaning of this License. 3693 3694 2. VERBATIM COPYING 3695 3696 You may copy and distribute the Document in any medium, either 3697 commercially or noncommercially, provided that this License, the 3698 copyright notices, and the license notice saying this License 3699 applies to the Document are reproduced in all copies, and that you 3700 add no other conditions whatsoever to those of this License. You 3701 may not use technical measures to obstruct or control the reading 3702 or further copying of the copies you make or distribute. However, 3703 you may accept compensation in exchange for copies. If you 3704 distribute a large enough number of copies you must also follow the 3705 conditions in section 3. 3706 3707 You may also lend copies, under the same conditions stated above, 3708 and you may publicly display copies. 3709 3710 3. COPYING IN QUANTITY 3711 3712 If you publish printed copies (or copies in media that commonly 3713 have printed covers) of the Document, numbering more than 100, and 3714 the Document’s license notice requires Cover Texts, you must 3715 enclose the copies in covers that carry, clearly and legibly, all 3716 these Cover Texts: Front-Cover Texts on the front cover, and 3717 Back-Cover Texts on the back cover. Both covers must also clearly 3718 and legibly identify you as the publisher of these copies. The 3719 front cover must present the full title with all words of the title 3720 equally prominent and visible. You may add other material on the 3721 covers in addition. Copying with changes limited to the covers, as 3722 long as they preserve the title of the Document and satisfy these 3723 conditions, can be treated as verbatim copying in other respects. 3724 3725 If the required texts for either cover are too voluminous to fit 3726 legibly, you should put the first ones listed (as many as fit 3727 reasonably) on the actual cover, and continue the rest onto 3728 adjacent pages. 3729 3730 If you publish or distribute Opaque copies of the Document 3731 numbering more than 100, you must either include a machine-readable 3732 Transparent copy along with each Opaque copy, or state in or with 3733 each Opaque copy a computer-network location from which the general 3734 network-using public has access to download using public-standard 3735 network protocols a complete Transparent copy of the Document, free 3736 of added material. If you use the latter option, you must take 3737 reasonably prudent steps, when you begin distribution of Opaque 3738 copies in quantity, to ensure that this Transparent copy will 3739 remain thus accessible at the stated location until at least one 3740 year after the last time you distribute an Opaque copy (directly or 3741 through your agents or retailers) of that edition to the public. 3742 3743 It is requested, but not required, that you contact the authors of 3744 the Document well before redistributing any large number of copies, 3745 to give them a chance to provide you with an updated version of the 3746 Document. 3747 3748 4. MODIFICATIONS 3749 3750 You may copy and distribute a Modified Version of the Document 3751 under the conditions of sections 2 and 3 above, provided that you 3752 release the Modified Version under precisely this License, with the 3753 Modified Version filling the role of the Document, thus licensing 3754 distribution and modification of the Modified Version to whoever 3755 possesses a copy of it. In addition, you must do these things in 3756 the Modified Version: 3757 3758 A. Use in the Title Page (and on the covers, if any) a title 3759 distinct from that of the Document, and from those of previous 3760 versions (which should, if there were any, be listed in the 3761 History section of the Document). You may use the same title 3762 as a previous version if the original publisher of that 3763 version gives permission. 3764 3765 B. List on the Title Page, as authors, one or more persons or 3766 entities responsible for authorship of the modifications in 3767 the Modified Version, together with at least five of the 3768 principal authors of the Document (all of its principal 3769 authors, if it has fewer than five), unless they release you 3770 from this requirement. 3771 3772 C. State on the Title page the name of the publisher of the 3773 Modified Version, as the publisher. 3774 3775 D. Preserve all the copyright notices of the Document. 3776 3777 E. Add an appropriate copyright notice for your modifications 3778 adjacent to the other copyright notices. 3779 3780 F. Include, immediately after the copyright notices, a license 3781 notice giving the public permission to use the Modified 3782 Version under the terms of this License, in the form shown in 3783 the Addendum below. 3784 3785 G. Preserve in that license notice the full lists of Invariant 3786 Sections and required Cover Texts given in the Document’s 3787 license notice. 3788 3789 H. Include an unaltered copy of this License. 3790 3791 I. Preserve the section Entitled “History”, Preserve its Title, 3792 and add to it an item stating at least the title, year, new 3793 authors, and publisher of the Modified Version as given on the 3794 Title Page. If there is no section Entitled “History” in the 3795 Document, create one stating the title, year, authors, and 3796 publisher of the Document as given on its Title Page, then add 3797 an item describing the Modified Version as stated in the 3798 previous sentence. 3799 3800 J. Preserve the network location, if any, given in the Document 3801 for public access to a Transparent copy of the Document, and 3802 likewise the network locations given in the Document for 3803 previous versions it was based on. These may be placed in the 3804 “History” section. You may omit a network location for a work 3805 that was published at least four years before the Document 3806 itself, or if the original publisher of the version it refers 3807 to gives permission. 3808 3809 K. For any section Entitled “Acknowledgements” or “Dedications”, 3810 Preserve the Title of the section, and preserve in the section 3811 all the substance and tone of each of the contributor 3812 acknowledgements and/or dedications given therein. 3813 3814 L. Preserve all the Invariant Sections of the Document, unaltered 3815 in their text and in their titles. Section numbers or the 3816 equivalent are not considered part of the section titles. 3817 3818 M. Delete any section Entitled “Endorsements”. Such a section 3819 may not be included in the Modified Version. 3820 3821 N. Do not retitle any existing section to be Entitled 3822 “Endorsements” or to conflict in title with any Invariant 3823 Section. 3824 3825 O. Preserve any Warranty Disclaimers. 3826 3827 If the Modified Version includes new front-matter sections or 3828 appendices that qualify as Secondary Sections and contain no 3829 material copied from the Document, you may at your option designate 3830 some or all of these sections as invariant. To do this, add their 3831 titles to the list of Invariant Sections in the Modified Version’s 3832 license notice. These titles must be distinct from any other 3833 section titles. 3834 3835 You may add a section Entitled “Endorsements”, provided it contains 3836 nothing but endorsements of your Modified Version by various 3837 parties—for example, statements of peer review or that the text has 3838 been approved by an organization as the authoritative definition of 3839 a standard. 3840 3841 You may add a passage of up to five words as a Front-Cover Text, 3842 and a passage of up to 25 words as a Back-Cover Text, to the end of 3843 the list of Cover Texts in the Modified Version. Only one passage 3844 of Front-Cover Text and one of Back-Cover Text may be added by (or 3845 through arrangements made by) any one entity. If the Document 3846 already includes a cover text for the same cover, previously added 3847 by you or by arrangement made by the same entity you are acting on 3848 behalf of, you may not add another; but you may replace the old 3849 one, on explicit permission from the previous publisher that added 3850 the old one. 3851 3852 The author(s) and publisher(s) of the Document do not by this 3853 License give permission to use their names for publicity for or to 3854 assert or imply endorsement of any Modified Version. 3855 3856 5. COMBINING DOCUMENTS 3857 3858 You may combine the Document with other documents released under 3859 this License, under the terms defined in section 4 above for 3860 modified versions, provided that you include in the combination all 3861 of the Invariant Sections of all of the original documents, 3862 unmodified, and list them all as Invariant Sections of your 3863 combined work in its license notice, and that you preserve all 3864 their Warranty Disclaimers. 3865 3866 The combined work need only contain one copy of this License, and 3867 multiple identical Invariant Sections may be replaced with a single 3868 copy. If there are multiple Invariant Sections with the same name 3869 but different contents, make the title of each such section unique 3870 by adding at the end of it, in parentheses, the name of the 3871 original author or publisher of that section if known, or else a 3872 unique number. Make the same adjustment to the section titles in 3873 the list of Invariant Sections in the license notice of the 3874 combined work. 3875 3876 In the combination, you must combine any sections Entitled 3877 “History” in the various original documents, forming one section 3878 Entitled “History”; likewise combine any sections Entitled 3879 “Acknowledgements”, and any sections Entitled “Dedications”. You 3880 must delete all sections Entitled “Endorsements.” 3881 3882 6. COLLECTIONS OF DOCUMENTS 3883 3884 You may make a collection consisting of the Document and other 3885 documents released under this License, and replace the individual 3886 copies of this License in the various documents with a single copy 3887 that is included in the collection, provided that you follow the 3888 rules of this License for verbatim copying of each of the documents 3889 in all other respects. 3890 3891 You may extract a single document from such a collection, and 3892 distribute it individually under this License, provided you insert 3893 a copy of this License into the extracted document, and follow this 3894 License in all other respects regarding verbatim copying of that 3895 document. 3896 3897 7. AGGREGATION WITH INDEPENDENT WORKS 3898 3899 A compilation of the Document or its derivatives with other 3900 separate and independent documents or works, in or on a volume of a 3901 storage or distribution medium, is called an “aggregate” if the 3902 copyright resulting from the compilation is not used to limit the 3903 legal rights of the compilation’s users beyond what the individual 3904 works permit. When the Document is included in an aggregate, this 3905 License does not apply to the other works in the aggregate which 3906 are not themselves derivative works of the Document. 3907 3908 If the Cover Text requirement of section 3 is applicable to these 3909 copies of the Document, then if the Document is less than one half 3910 of the entire aggregate, the Document’s Cover Texts may be placed 3911 on covers that bracket the Document within the aggregate, or the 3912 electronic equivalent of covers if the Document is in electronic 3913 form. Otherwise they must appear on printed covers that bracket 3914 the whole aggregate. 3915 3916 8. TRANSLATION 3917 3918 Translation is considered a kind of modification, so you may 3919 distribute translations of the Document under the terms of section 3920 4. Replacing Invariant Sections with translations requires special 3921 permission from their copyright holders, but you may include 3922 translations of some or all Invariant Sections in addition to the 3923 original versions of these Invariant Sections. You may include a 3924 translation of this License, and all the license notices in the 3925 Document, and any Warranty Disclaimers, provided that you also 3926 include the original English version of this License and the 3927 original versions of those notices and disclaimers. In case of a 3928 disagreement between the translation and the original version of 3929 this License or a notice or disclaimer, the original version will 3930 prevail. 3931 3932 If a section in the Document is Entitled “Acknowledgements”, 3933 “Dedications”, or “History”, the requirement (section 4) to 3934 Preserve its Title (section 1) will typically require changing the 3935 actual title. 3936 3937 9. TERMINATION 3938 3939 You may not copy, modify, sublicense, or distribute the Document 3940 except as expressly provided under this License. Any attempt 3941 otherwise to copy, modify, sublicense, or distribute it is void, 3942 and will automatically terminate your rights under this License. 3943 3944 However, if you cease all violation of this License, then your 3945 license from a particular copyright holder is reinstated (a) 3946 provisionally, unless and until the copyright holder explicitly and 3947 finally terminates your license, and (b) permanently, if the 3948 copyright holder fails to notify you of the violation by some 3949 reasonable means prior to 60 days after the cessation. 3950 3951 Moreover, your license from a particular copyright holder is 3952 reinstated permanently if the copyright holder notifies you of the 3953 violation by some reasonable means, this is the first time you have 3954 received notice of violation of this License (for any work) from 3955 that copyright holder, and you cure the violation prior to 30 days 3956 after your receipt of the notice. 3957 3958 Termination of your rights under this section does not terminate 3959 the licenses of parties who have received copies or rights from you 3960 under this License. If your rights have been terminated and not 3961 permanently reinstated, receipt of a copy of some or all of the 3962 same material does not give you any rights to use it. 3963 3964 10. FUTURE REVISIONS OF THIS LICENSE 3965 3966 The Free Software Foundation may publish new, revised versions of 3967 the GNU Free Documentation License from time to time. Such new 3968 versions will be similar in spirit to the present version, but may 3969 differ in detail to address new problems or concerns. See 3970 <https://www.gnu.org/licenses/>. 3971 3972 Each version of the License is given a distinguishing version 3973 number. If the Document specifies that a particular numbered 3974 version of this License “or any later version” applies to it, you 3975 have the option of following the terms and conditions either of 3976 that specified version or of any later version that has been 3977 published (not as a draft) by the Free Software Foundation. If the 3978 Document does not specify a version number of this License, you may 3979 choose any version ever published (not as a draft) by the Free 3980 Software Foundation. If the Document specifies that a proxy can 3981 decide which future versions of this License can be used, that 3982 proxy’s public statement of acceptance of a version permanently 3983 authorizes you to choose that version for the Document. 3984 3985 11. RELICENSING 3986 3987 “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any 3988 World Wide Web server that publishes copyrightable works and also 3989 provides prominent facilities for anybody to edit those works. A 3990 public wiki that anybody can edit is an example of such a server. 3991 A “Massive Multiauthor Collaboration” (or “MMC”) contained in the 3992 site means any set of copyrightable works thus published on the MMC 3993 site. 3994 3995 “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 3996 license published by Creative Commons Corporation, a not-for-profit 3997 corporation with a principal place of business in San Francisco, 3998 California, as well as future copyleft versions of that license 3999 published by that same organization. 4000 4001 “Incorporate” means to publish or republish a Document, in whole or 4002 in part, as part of another Document. 4003 4004 An MMC is “eligible for relicensing” if it is licensed under this 4005 License, and if all works that were first published under this 4006 License somewhere other than this MMC, and subsequently 4007 incorporated in whole or in part into the MMC, (1) had no cover 4008 texts or invariant sections, and (2) were thus incorporated prior 4009 to November 1, 2008. 4010 4011 The operator of an MMC Site may republish an MMC contained in the 4012 site under CC-BY-SA on the same site at any time before August 1, 4013 2009, provided the MMC is eligible for relicensing. 4014 4015ADDENDUM: How to use this License for your documents 4016==================================================== 4017 4018To use this License in a document you have written, include a copy of 4019the License in the document and put the following copyright and license 4020notices just after the title page: 4021 4022 Copyright (C) YEAR YOUR NAME. 4023 Permission is granted to copy, distribute and/or modify this document 4024 under the terms of the GNU Free Documentation License, Version 1.3 4025 or any later version published by the Free Software Foundation; 4026 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 4027 Texts. A copy of the license is included in the section entitled ``GNU 4028 Free Documentation License''. 4029 4030 If you have Invariant Sections, Front-Cover Texts and Back-Cover 4031Texts, replace the “with...Texts.” line with this: 4032 4033 with the Invariant Sections being LIST THEIR TITLES, with 4034 the Front-Cover Texts being LIST, and with the Back-Cover Texts 4035 being LIST. 4036 4037 If you have Invariant Sections without Cover Texts, or some other 4038combination of the three, merge those two alternatives to suit the 4039situation. 4040 4041 If your document contains nontrivial examples of program code, we 4042recommend releasing these examples in parallel under your choice of free 4043software license, such as the GNU General Public License, to permit 4044their use in free software. 4045 4046 4047File: viper.info, Node: Acknowledgments, Next: Key Index, Prev: GNU Free Documentation License, Up: Top 4048 4049Acknowledgments 4050*************** 4051 4052Viper, formerly known as VIP-19, was written by Michael Kifer. Viper is 4053based on the original VIP package by Masahiko Sato and on its 4054enhancement, VIP 4.4, by Aamod Sane. This manual is an adaptation of 4055the manual for VIP 4.4, which, in turn, was based on Sato’s manual for 4056VIP 3.5. 4057 4058 Many contributors on the Net pointed out bugs and suggested a number 4059of useful features. Scott Bronson and Samuel Padgett contributed 4060patches that were incorporated in this code. Here is a hopefully 4061complete list of contributors: 4062 4063 aaronl@vitelus.com (Aaron Lehmann), 4064 ahg@panix.com (Al Gelders), 4065 amade@diagram.fr (Paul-Bernard Amade), 4066 ascott@fws214.intel.com (Andy Scott), 4067 bronson@trestle.com (Scott Bronson), 4068 cook@biostat.wisc.edu (Tom Cook), 4069 csdayton@midway.uchicago.edu (Soren Dayton), 4070 dave@hellgate.utah.edu, 4071 dm@scs.cs.nyu.edu (David Mazieres), 4072 dominik@strw.LeidenUniv.nl (Carsten Dominik), 4073 dwallach@cs.princeton.edu (Dan Wallach), 4074 dwight@toolucky.llnl.gov (Dwight Shih), 4075 dxc@xprt.net (David X Callaway), 4076 edmonds@edmonds.home.cs.ubc.ca (Brian Edmonds), 4077 gin@mo.msk.ru (Golubev I.N.), 4078 gviswana@cs.wisc.edu (Guhan Viswanathan), 4079 gvr@halcyon.com (George V. Reilly), 4080 hatazaki@bach.convex.com (Takao Hatazaki), 4081 hpz@ibmhpz.aug.ipp-garching.mpg.de (Hans-Peter Zehrfeld), 4082 irie@t.email.ne.jp (Irie Tetsuya), 4083 jackr@dblues.engr.sgi.com (Jack Repenning), 4084 jamesm@bga.com (D.J. Miller II), 4085 jjm@hplb.hpl.hp.com (Jean-Jacques Moreau), 4086 jl@cse.ogi.edu (John Launchbury), 4087 jobrien@hchp.org (John O'Brien), 4088 johnw@borland.com (John Wiegley), 4089 kanze@gabi-soft.fr (James Kanze), 4090 kin@isi.com (Kin Cho), 4091 kwzh@gnu.org (Karl Heuer), 4092 lindstro@biostat.wisc.edu (Mary Lindstrom), 4093 lektu@terra.es (Juanma Barranquero), 4094 lennart.borgman.073@student.lu.se (Lennart Borgman), 4095 minakaji@osaka.email.ne.jp (Mikio Nakajima), 4096 Mark.Bordas@East.Sun.COM (Mark Bordas), 4097 meyering@comco.com (Jim Meyering), 4098 martin@xemacs.org (Martin Buchholz), 4099 mbutler@redfernnetworks.com (Malcolm Butler), 4100 mveiga@dit.upm.es (Marcelino Veiga Tuimil), 4101 paulk@summit.esg.apertus.com (Paul Keusemann), 4102 pfister@cs.stonybrook.edu (Hanspeter Pfister), 4103 phil_brooks@MENTORG.COM (Phil Brooks), 4104 pogrell@informatik.hu-berlin.de (Lutz Pogrell), 4105 pradyut@cs.uchicago.edu (Pradyut Shah), 4106 roderick@argon.org (Roderick Schertler), 4107 rxga@ulysses.att.com, 4108 sawdey@lcse.umn.edu (Aaron Sawdey), 4109 simonb@prl.philips.co.uk (Simon Blanchard), 4110 spadgett1@nc.rr.com (Samuel Padgett), 4111 stephen@farrell.org (Stephen Farrell), 4112 storm@cua.dk (Kim F. Storm), 4113 sudish@MindSpring.COM (Sudish Joseph), 4114 schwab@issan.informatik.uni-dortmund.de (Andreas Schwab) 4115 terra@diku.dk (Morten Welinder), 4116 thanh@informatics.muni.cz (Han The Thanh), 4117 toma@convex.convex.com, 4118 vrenjak@sun1.racal.com (Milan Vrenjak), 4119 whicken@dragon.parasoft.com (Wendell Hicken), 4120 zapman@cc.gatech.edu (Jason Zapman II), 4121 4122 4123File: viper.info, Node: Key Index, Next: Function Index, Prev: Acknowledgments, Up: Top 4124 4125Key Index 4126********* 4127 4128[index] 4129* Menu: 4130 4131* "<a-z1-9>p: Appending Text. (line 59) 4132* "<a-z1-9>P: Appending Text. (line 59) 4133* "<a-z1-9>p <1>: Yanking. (line 29) 4134* "<a-z1-9>P <1>: Yanking. (line 29) 4135* "<A-Z>y<move>: Yanking. (line 29) 4136* "<a-z>y<move>: Yanking. (line 29) 4137* #: New Commands. (line 35) 4138* #c<move>: New Commands. (line 41) 4139* #C<move>: New Commands. (line 44) 4140* #C<move> <1>: Changing Text. (line 76) 4141* #c<move> <1>: Changing Text. (line 76) 4142* #g<move>: New Commands. (line 48) 4143* #g<move> <1>: Search and Replace. (line 67) 4144* #g<move> <2>: Mapping. (line 44) 4145* #q<move>: New Commands. (line 51) 4146* #q<move> <1>: Changing Text. (line 76) 4147* #s<move>: New Commands. (line 55) 4148* $: Move Commands. (line 124) 4149* %: Move Commands. (line 124) 4150* % <1>: Search and Replace. (line 67) 4151* &: Changing Text. (line 76) 4152* & <1>: Search and Replace. (line 67) 4153* '': Move Commands. (line 124) 4154* '' <1>: Marking. (line 38) 4155* '<a-z>: Move Commands. (line 124) 4156* '<a-z> <1>: Marking. (line 37) 4157* (: Move Commands. (line 124) 4158* ): Move Commands. (line 124) 4159* *: New Commands. (line 59) 4160* * <1>: Mapping. (line 44) 4161* +: Move Commands. (line 124) 4162* ,: Move Commands. (line 124) 4163* -: Move Commands. (line 124) 4164* .: Appending Text. (line 59) 4165* . <1>: Undoing. (line 17) 4166* /<cr>: Move Commands. (line 124) 4167* /<string>: Move Commands. (line 124) 4168* /<string> <1>: Search and Replace. (line 66) 4169* 0: Move Commands. (line 124) 4170* ;: Move Commands. (line 124) 4171* <<: Deleting Text. (line 33) 4172* <<move>: Deleting Text. (line 33) 4173* <a-z>: Groundwork. (line 34) 4174* <address>: Groundwork. (line 34) 4175* <args>: Groundwork. (line 70) 4176* <cmd>: Groundwork. (line 70) 4177* <move>: Groundwork. (line 34) 4178* =<move>: Changing Text. (line 76) 4179* ><move>: Appending Text. (line 59) 4180* >>: Appending Text. (line 59) 4181* ?<cr>: Move Commands. (line 124) 4182* ?<string>: Move Commands. (line 124) 4183* ?<string> <1>: Search and Replace. (line 67) 4184* @!: New Commands. (line 75) 4185* @!<a-z>: Mapping. (line 44) 4186* @#: New Commands. (line 75) 4187* @# <1>: Mapping. (line 44) 4188* @<a-z>: New Commands. (line 75) 4189* @<a-z> <1>: Mapping. (line 44) 4190* @@: Mapping. (line 44) 4191* [<a-z>: New Commands. (line 71) 4192* [<a-z> <1>: Move Commands. (line 124) 4193* [<a-z> <2>: Appending Text. (line 59) 4194* [<a-z> <3>: Yanking. (line 29) 4195* [<a-z> <4>: Mapping. (line 44) 4196* [[: Move Commands. (line 124) 4197* []: New Commands. (line 79) 4198* [] <1>: Move Commands. (line 124) 4199* \: New Commands. (line 18) 4200* \&: Changing Text. (line 76) 4201* ]<a-z>: New Commands. (line 69) 4202* ]<a-z> <1>: Move Commands. (line 124) 4203* ]<a-z> <2>: Appending Text. (line 59) 4204* ]<a-z> <3>: Yanking. (line 29) 4205* ]<a-z> <4>: Mapping. (line 44) 4206* ]]: Move Commands. (line 124) 4207* ^: Move Commands. (line 124) 4208* `<a-z>: Move Commands. (line 124) 4209* `<a-z> <1>: Marking. (line 38) 4210* ``: Move Commands. (line 124) 4211* `` <1>: Marking. (line 38) 4212* {: Move Commands. (line 124) 4213* |: Move Commands. (line 124) 4214* }: Move Commands. (line 124) 4215* ~: Changing Text. (line 76) 4216* A: Appending Text. (line 59) 4217* a: Appending Text. (line 58) 4218* B: Move Commands. (line 124) 4219* b: Move Commands. (line 124) 4220* C: Changing Text. (line 76) 4221* C-b: Display. (line 43) 4222* C-c: Vi State. (line 19) 4223* C-c <1>: New Commands. (line 9) 4224* C-c /: Vi State. (line 72) 4225* C-c / <1>: New Commands. (line 92) 4226* C-c / <2>: Move Commands. (line 124) 4227* C-c C-g: New Commands. (line 88) 4228* C-c M-n: New Commands. (line 111) 4229* C-c M-n <1>: Appending Text. (line 59) 4230* C-c M-n <2>: Changing Text. (line 76) 4231* C-c M-p: New Commands. (line 111) 4232* C-c M-p <1>: Appending Text. (line 59) 4233* C-c M-p <2>: Changing Text. (line 76) 4234* C-c\: Emacs Related Commands. 4235 (line 44) 4236* C-d: Display. (line 43) 4237* C-e: Display. (line 43) 4238* C-f: Display. (line 43) 4239* C-g: Vi State. (line 24) 4240* C-g <1>: New Commands. (line 85) 4241* C-g <2>: Display. (line 42) 4242* C-h: Move Commands. (line 124) 4243* C-l: Display. (line 43) 4244* C-n: Move Commands. (line 124) 4245* C-p: Move Commands. (line 124) 4246* C-s: New Commands. (line 105) 4247* C-u: Editing in Insert State. 4248 (line 20) 4249* C-u <1>: Display. (line 43) 4250* C-v: New Commands. (line 29) 4251* C-v <1>: Editing in Insert State. 4252 (line 19) 4253* C-w: Editing in Insert State. 4254 (line 20) 4255* C-x: Vi State. (line 11) 4256* C-x <1>: New Commands. (line 9) 4257* C-x 0: Emacs Related Commands. 4258 (line 45) 4259* C-x 1: Emacs Related Commands. 4260 (line 45) 4261* C-x 2: Emacs Related Commands. 4262 (line 45) 4263* C-x C-f: Emacs Related Commands. 4264 (line 45) 4265* C-x o: Emacs Related Commands. 4266 (line 45) 4267* C-y: Display. (line 43) 4268* C-y <1>: Emacs Related Commands. 4269 (line 45) 4270* C-z: States in Viper. (line 6) 4271* C-z <1>: Emacs State. (line 6) 4272* C-z <2>: Emacs Related Commands. 4273 (line 45) 4274* C-\: Vi State. (line 33) 4275* C-\ <1>: Emacs Related Commands. 4276 (line 45) 4277* C-]: Vi State. (line 24) 4278* C-] <1>: New Commands. (line 85) 4279* C-^: File and Buffer Handling. 4280 (line 115) 4281* c<move>: Changing Text. (line 76) 4282* cc: Changing Text. (line 76) 4283* CR: Move Commands. (line 124) 4284* D: Deleting Text. (line 33) 4285* d<move>: Deleting Text. (line 33) 4286* dd: Deleting Text. (line 33) 4287* E: Move Commands. (line 124) 4288* e: Move Commands. (line 124) 4289* ESC: States in Viper. (line 6) 4290* F<char>: Move Commands. (line 124) 4291* f<char>: Move Commands. (line 124) 4292* G: Move Commands. (line 124) 4293* g<move>: Search and Replace. (line 67) 4294* H: Move Commands. (line 124) 4295* h: Move Commands. (line 124) 4296* i: States in Viper. (line 6) 4297* i <1>: Appending Text. (line 59) 4298* j: Move Commands. (line 124) 4299* J: Changing Text. (line 76) 4300* k: Move Commands. (line 124) 4301* L: Move Commands. (line 124) 4302* l: Move Commands. (line 124) 4303* LF: Move Commands. (line 124) 4304* M: Move Commands. (line 124) 4305* m,: Marking. (line 38) 4306* M-n: New Commands. (line 101) 4307* M-p: New Commands. (line 101) 4308* M-y: Emacs Related Commands. 4309 (line 45) 4310* m.: Marking. (line 38) 4311* m<: Marking. (line 38) 4312* m<a-z>: Move Commands. (line 124) 4313* m<a-z> <1>: Marking. (line 38) 4314* m<a-z> <2>: Yanking. (line 29) 4315* m>: Marking. (line 38) 4316* META button1up: Mouse-bound Commands. 4317 (line 22) 4318* META button2up: Mouse-bound Commands. 4319 (line 21) 4320* META SHIFT button1up: Viper Specials. (line 300) 4321* META SHIFT button2up: Viper Specials. (line 300) 4322* m^: Marking. (line 38) 4323* N: Move Commands. (line 124) 4324* n: Move Commands. (line 124) 4325* N <1>: Search and Replace. (line 67) 4326* n <1>: Search and Replace. (line 67) 4327* O: Appending Text. (line 59) 4328* o: Appending Text. (line 59) 4329* P: Appending Text. (line 59) 4330* p: Appending Text. (line 59) 4331* P <1>: Yanking. (line 29) 4332* p <1>: Yanking. (line 29) 4333* Q: New Commands. (line 21) 4334* Q <1>: Search and Replace. (line 67) 4335* R: Changing Text. (line 76) 4336* r<char>: Changing Text. (line 75) 4337* S: Changing Text. (line 76) 4338* s: Changing Text. (line 76) 4339* S-mouse-1: Viper Specials. (line 300) 4340* S-mouse-1 <1>: Mouse-bound Commands. 4341 (line 22) 4342* S-mouse-2: Viper Specials. (line 300) 4343* S-mouse-2 <1>: Mouse-bound Commands. 4344 (line 22) 4345* SPC: Move Commands. (line 124) 4346* T<char>: Move Commands. (line 124) 4347* t<char>: Move Commands. (line 124) 4348* u: Vi State. (line 54) 4349* U: Undoing. (line 17) 4350* u <1>: Undoing. (line 16) 4351* v: New Commands. (line 29) 4352* V: New Commands. (line 29) 4353* v <1>: File and Buffer Handling. 4354 (line 115) 4355* V <1>: File and Buffer Handling. 4356 (line 115) 4357* W: Move Commands. (line 124) 4358* w: Move Commands. (line 124) 4359* X: Deleting Text. (line 33) 4360* x: Deleting Text. (line 32) 4361* Y: Yanking. (line 29) 4362* y<move>: Yanking. (line 29) 4363* yank: Yanking. (line 29) 4364* yy: Yanking. (line 29) 4365* z-: Display. (line 43) 4366* z.: Display. (line 43) 4367* z<cr>: Display. (line 43) 4368* z<cr> <1>: Display. (line 43) 4369* zH: Display. (line 43) 4370* zL: Display. (line 43) 4371* zM: Display. (line 43) 4372* ZZ: File and Buffer Handling. 4373 (line 115) 4374 4375 4376File: viper.info, Node: Function Index, Next: Variable Index, Prev: Key Index, Up: Top 4377 4378Function Index 4379************** 4380 4381[index] 4382* Menu: 4383 4384* !!<cmd>: Shell Commands. (line 46) 4385* !<cmd>: Shell Commands. (line 46) 4386* !<move><cmd>: Shell Commands. (line 46) 4387* add-hook: Packages that Change Keymaps. 4388 (line 106) 4389* Ex !! <args>: Shell Commands. (line 46) 4390* Ex !<cmd>: Shell Commands. (line 46) 4391* Ex <address>r !<cmd>: Shell Commands. (line 46) 4392* Ex <address>r <name>: Shell Commands. (line 46) 4393* Ex args: New Commands. (line 129) 4394* Ex args <1>: File and Buffer Handling. 4395 (line 115) 4396* Ex cd [<dir>]: File and Buffer Handling. 4397 (line 115) 4398* Ex copy [z]: Changing Text. (line 76) 4399* Ex e [<files>]: File and Buffer Handling. 4400 (line 115) 4401* Ex e!: Undoing. (line 17) 4402* Ex e! [<files>]: File and Buffer Handling. 4403 (line 115) 4404* Ex edit [<files>]: File and Buffer Handling. 4405 (line 115) 4406* Ex edit! [<files>]: File and Buffer Handling. 4407 (line 115) 4408* Ex f: File and Buffer Handling. 4409 (line 115) 4410* Ex g: Search and Replace. (line 67) 4411* Ex global: Search and Replace. (line 67) 4412* Ex k: Marking. (line 38) 4413* Ex make: Shell Commands. (line 45) 4414* Ex map: Key Bindings. (line 128) 4415* Ex map <char> <seq>: Mapping. (line 44) 4416* Ex map! <char> <seq>: Mapping. (line 43) 4417* Ex mark: Marking. (line 38) 4418* Ex move [z]: Changing Text. (line 76) 4419* Ex n: New Commands. (line 129) 4420* Ex n [<count> | <file>]: File and Buffer Handling. 4421 (line 115) 4422* Ex pre: New Commands. (line 129) 4423* Ex pre <1>: File and Buffer Handling. 4424 (line 115) 4425* Ex PreviousRelatedFile: New Commands. (line 134) 4426* Ex PreviousRelatedFile <1>: Viper Specials. (line 198) 4427* Ex pwd: New Commands. (line 129) 4428* Ex pwd <1>: File and Buffer Handling. 4429 (line 114) 4430* Ex q: File and Buffer Handling. 4431 (line 115) 4432* Ex q!: Undoing. (line 17) 4433* Ex q! <1>: File and Buffer Handling. 4434 (line 115) 4435* Ex quit: File and Buffer Handling. 4436 (line 115) 4437* Ex quit!: File and Buffer Handling. 4438 (line 115) 4439* Ex r: File and Buffer Handling. 4440 (line 115) 4441* Ex read: File and Buffer Handling. 4442 (line 115) 4443* Ex rec: Undoing. (line 17) 4444* Ex rec <1>: File and Buffer Handling. 4445 (line 115) 4446* Ex RelatedFile: New Commands. (line 134) 4447* Ex RelatedFile <1>: Viper Specials. (line 198) 4448* Ex rew: File and Buffer Handling. 4449 (line 115) 4450* Ex s/<pat>/<repl>/<f>: Changing Text. (line 76) 4451* Ex set: Rudimentary Changes. (line 6) 4452* Ex set <option>: Options. (line 80) 4453* Ex set <option>=<value>: Options. (line 80) 4454* Ex set ai: Options. (line 80) 4455* Ex set autoindent: Options. (line 79) 4456* Ex set ic: Options. (line 80) 4457* Ex set ignorecase: Options. (line 80) 4458* Ex set magic: Options. (line 80) 4459* Ex set no<option>: Options. (line 80) 4460* Ex set readonly: Options. (line 80) 4461* Ex set ro: Options. (line 80) 4462* Ex set sh=<string>: Options. (line 80) 4463* Ex set shell=<string>: Options. (line 80) 4464* Ex set shiftwidth=<count>: Options. (line 80) 4465* Ex set showmatch: Options. (line 80) 4466* Ex set sm: Options. (line 80) 4467* Ex set sw=<count>: Options. (line 80) 4468* Ex set tab-stop-local=<count>: Options. (line 80) 4469* Ex set tabstop=<count>: Options. (line 80) 4470* Ex set ts=<count>: Options. (line 80) 4471* Ex set wm=<count>: Options. (line 80) 4472* Ex set wrapmargin=<count>: Options. (line 80) 4473* Ex set wrapscan: Options. (line 80) 4474* Ex set ws: Options. (line 80) 4475* Ex sh: Shell Commands. (line 46) 4476* Ex stop: File and Buffer Handling. 4477 (line 115) 4478* Ex substitute/<pat>/<repl>/<f>: Changing Text. (line 76) 4479* Ex substitute/<pat>/<repl>/<f> <1>: Search and Replace. (line 67) 4480* Ex suspend: File and Buffer Handling. 4481 (line 115) 4482* Ex t [z]: Changing Text. (line 76) 4483* Ex tag <name>: Search and Replace. (line 67) 4484* Ex unmap <char>: Mapping. (line 44) 4485* Ex unmap! <char>: Mapping. (line 44) 4486* Ex v: Search and Replace. (line 67) 4487* Ex vglobal: Search and Replace. (line 67) 4488* Ex W: File and Buffer Handling. 4489 (line 115) 4490* Ex w !<cmd>: Shell Commands. (line 46) 4491* Ex w <file>: File and Buffer Handling. 4492 (line 115) 4493* Ex w >> <file>: File and Buffer Handling. 4494 (line 115) 4495* Ex w! <file>: File and Buffer Handling. 4496 (line 115) 4497* Ex wq: File and Buffer Handling. 4498 (line 115) 4499* Ex Write: File and Buffer Handling. 4500 (line 115) 4501* Ex write <file>: File and Buffer Handling. 4502 (line 115) 4503* Ex write >> <file>: File and Buffer Handling. 4504 (line 115) 4505* Ex write! <file>: File and Buffer Handling. 4506 (line 115) 4507* Ex WW: File and Buffer Handling. 4508 (line 115) 4509* Ex WWrite: File and Buffer Handling. 4510 (line 115) 4511* Ex WWrite <1>: File and Buffer Handling. 4512 (line 115) 4513* Ex x: File and Buffer Handling. 4514 (line 115) 4515* Ex x!: File and Buffer Handling. 4516 (line 115) 4517* Ex x,y w !<cmd>: Shell Commands. (line 46) 4518* Ex yank: Yanking. (line 28) 4519* remove-hook: Packages that Change Keymaps. 4520 (line 107) 4521* toggle-viper-mode: States in Viper. (line 6) 4522* toggle-viper-mode <1>: Viper Specials. (line 183) 4523* viper-add-local-keys: Key Bindings. (line 187) 4524* viper-buffer-search-enable: Viper Specials. (line 21) 4525* viper-describe-kbd-macros: Vi Macros. (line 251) 4526* viper-glob-function: Rudimentary Changes. (line 157) 4527* viper-go-away: States in Viper. (line 6) 4528* viper-go-away <1>: Viper Specials. (line 179) 4529* viper-harness-minor-mode: Packages that Change Keymaps. 4530 (line 107) 4531* viper-mode: Packages that Change Keymaps. 4532 (line 107) 4533* viper-modify-major-mode: Key Bindings. (line 84) 4534* viper-mouse-click-insert-word: Viper Specials. (line 300) 4535* viper-mouse-click-search-word: Viper Specials. (line 300) 4536* viper-set-emacs-state-searchstyle-macros: Viper Specials. (line 73) 4537* viper-set-expert-level: Viper Specials. (line 82) 4538* viper-set-hooks: Packages that Change Keymaps. 4539 (line 107) 4540* viper-set-parsing-style-toggling-macro: Move Commands. (line 121) 4541* viper-set-searchstyle-toggling-macros: Viper Specials. (line 44) 4542* viper-set-syntax-preference: Movement and Markers. 4543 (line 50) 4544* viper-set-syntax-preference <1>: Groundwork. (line 137) 4545* viper-unrecord-kbd-macro: Vi Macros. (line 126) 4546* viper-zap-local-keys: Key Bindings. (line 186) 4547 4548 4549File: viper.info, Node: Variable Index, Next: Package Index, Prev: Function Index, Up: Top 4550 4551Variable Index 4552************** 4553 4554[index] 4555* Menu: 4556 4557* buffer-read-only: Rudimentary Changes. (line 293) 4558* ex-cycle-other-window: Rudimentary Changes. (line 293) 4559* ex-cycle-through-non-files: Rudimentary Changes. (line 293) 4560* input-decode-map: Key Bindings. (line 187) 4561* local-function-key-map: Key Bindings. (line 187) 4562* viper-allow-multiline-replace-regions: Rudimentary Changes. (line 293) 4563* viper-always: Rudimentary Changes. (line 293) 4564* viper-always <1>: Packages that Change Keymaps. 4565 (line 107) 4566* viper-auto-indent: Rudimentary Changes. (line 293) 4567* viper-buffer-search-char: Rudimentary Changes. (line 293) 4568* viper-buffer-search-char <1>: Viper Specials. (line 21) 4569* viper-case-fold-search: Rudimentary Changes. (line 293) 4570* viper-command-ring-size: Viper Specials. (line 131) 4571* viper-custom-file-name: Rudimentary Changes. (line 293) 4572* viper-delete-backwards-in-replace: Rudimentary Changes. (line 293) 4573* viper-dired-modifier-map: Viper Specials. (line 65) 4574* viper-electric-mode: Rudimentary Changes. (line 293) 4575* viper-emacs-global-user-map: Key Bindings. (line 187) 4576* viper-emacs-state-cursor-color: Rudimentary Changes. (line 232) 4577* viper-emacs-state-hook: Rudimentary Changes. (line 292) 4578* viper-emacs-state-mode-list: Packages that Change Keymaps. 4579 (line 67) 4580* viper-ESC-moves-cursor-back: Rudimentary Changes. (line 293) 4581* viper-ex-style-editing: Rudimentary Changes. (line 293) 4582* viper-ex-style-motion: Rudimentary Changes. (line 293) 4583* viper-fast-keyseq-timeout: Rudimentary Changes. (line 293) 4584* viper-insert-global-user-map: Key Bindings. (line 187) 4585* viper-insert-state-cursor-color: Rudimentary Changes. (line 229) 4586* viper-insert-state-hook: Rudimentary Changes. (line 293) 4587* viper-insert-state-mode-list: Packages that Change Keymaps. 4588 (line 67) 4589* viper-insertion-ring-size: Viper Specials. (line 102) 4590* viper-keep-point-on-repeat: Rudimentary Changes. (line 293) 4591* viper-keep-point-on-undo: Rudimentary Changes. (line 293) 4592* viper-major-mode-modifier-list: Key Bindings. (line 117) 4593* viper-mouse-insert-key: Viper Specials. (line 221) 4594* viper-mouse-insert-key <1>: Viper Specials. (line 272) 4595* viper-multiclick-timeout: Viper Specials. (line 300) 4596* viper-no-multiple-ESC: Rudimentary Changes. (line 293) 4597* viper-parse-sexp-ignore-comments: Move Commands. (line 123) 4598* viper-re-query-replace: Rudimentary Changes. (line 293) 4599* viper-re-search: Rudimentary Changes. (line 293) 4600* viper-read-buffer-function: File and Buffer Handling. 4601 (line 106) 4602* viper-replace-overlay-cursor-color: Rudimentary Changes. (line 225) 4603* viper-replace-overlay-face: Rudimentary Changes. (line 293) 4604* viper-replace-region-end-symbol: Rudimentary Changes. (line 293) 4605* viper-replace-region-start-symbol: Rudimentary Changes. (line 293) 4606* viper-replace-state-hook: Rudimentary Changes. (line 293) 4607* viper-search-face: Improved Search. (line 42) 4608* viper-search-face <1>: Rudimentary Changes. (line 293) 4609* viper-search-scroll-threshold: Rudimentary Changes. (line 293) 4610* viper-search-wrap-around: Rudimentary Changes. (line 293) 4611* viper-shift-width: Rudimentary Changes. (line 293) 4612* viper-slash-and-colon-map: Viper Specials. (line 65) 4613* viper-smart-suffix-list: Viper Specials. (line 84) 4614* viper-spell-function: New Commands. (line 57) 4615* viper-spell-function <1>: Rudimentary Changes. (line 293) 4616* viper-surrounding-word-function: Rudimentary Changes. (line 293) 4617* viper-syntax-preference: Movement and Markers. 4618 (line 18) 4619* viper-syntax-preference <1>: Groundwork. (line 137) 4620* viper-tags-file-name: Rudimentary Changes. (line 293) 4621* viper-toggle-key: Rudimentary Changes. (line 293) 4622* viper-vi-global-user-map: Key Bindings. (line 187) 4623* viper-vi-state-hook: Rudimentary Changes. (line 293) 4624* viper-vi-state-mode-list: Packages that Change Keymaps. 4625 (line 67) 4626* viper-vi-style-in-minibuffer: Rudimentary Changes. (line 293) 4627* viper-want-ctl-h-help: Rudimentary Changes. (line 293) 4628* viper-want-emacs-keys-in-insert: Rudimentary Changes. (line 293) 4629* viper-want-emacs-keys-in-insert <1>: Packages that Change Keymaps. 4630 (line 107) 4631* viper-want-emacs-keys-in-vi: Rudimentary Changes. (line 293) 4632* viper-want-emacs-keys-in-vi <1>: Packages that Change Keymaps. 4633 (line 107) 4634 4635 4636File: viper.info, Node: Package Index, Next: Concept Index, Prev: Variable Index, Up: Top 4637 4638Package Index 4639************* 4640 4641[index] 4642* Menu: 4643 4644* ange-ftp.el: Useful Packages. (line 34) 4645* desktop.el: Useful Packages. (line 45) 4646* dired.el: Useful Packages. (line 39) 4647* ediff.el: Useful Packages. (line 50) 4648* font-lock.el: Useful Packages. (line 42) 4649* ispell.el: Useful Packages. (line 48) 4650* vc.el: Useful Packages. (line 37) 4651 4652 4653File: viper.info, Node: Concept Index, Prev: Package Index, Up: Top 4654 4655Concept Index 4656************* 4657 4658[index] 4659* Menu: 4660 4661* # (Previous file): Groundwork. (line 66) 4662* # (Previous file) <1>: Shell Commands. (line 9) 4663* % (Current file): Groundwork. (line 62) 4664* % (Current file) <1>: Shell Commands. (line 6) 4665* % (Ex address): Groundwork. (line 53) 4666* % (Ex address) <1>: Shell Commands. (line 7) 4667* .emacs: Customization. (line 11) 4668* .viper: Customization. (line 8) 4669* <a-z>: Groundwork. (line 34) 4670* <address>: Groundwork. (line 34) 4671* <args>: Groundwork. (line 70) 4672* <cmd>: Groundwork. (line 70) 4673* <cr>: Groundwork. (line 85) 4674* <esc>: Groundwork. (line 85) 4675* <ht>: Groundwork. (line 85) 4676* <lf>: Groundwork. (line 85) 4677* <move>: Groundwork. (line 34) 4678* <sp>: Groundwork. (line 85) 4679* abbrevs: Abbreviation Facilities. 4680 (line 6) 4681* absolute file names: Multiple Files in Viper. 4682 (line 43) 4683* appending: Appending Text. (line 11) 4684* auto fill: Options. (line 65) 4685* auto save: Undo and Backups. (line 12) 4686* autoindent: Options. (line 8) 4687* backup files: Undo and Backups. (line 12) 4688* backup files <1>: Undoing. (line 6) 4689* buffer: Emacs Preliminaries. (line 6) 4690* buffer (modified): Emacs Preliminaries. (line 46) 4691* buffer information: Emacs Preliminaries. (line 46) 4692* buffer search: Improved Search. (line 6) 4693* C-c and Viper: Packages that Change Keymaps. 4694 (line 6) 4695* case and searching: Options. (line 22) 4696* case-insensitive search: Vi State. (line 72) 4697* case-insensitive search <1>: New Commands. (line 98) 4698* case-insensitive search <2>: Move Commands. (line 108) 4699* case-sensitive search: Vi State. (line 72) 4700* case-sensitive search <1>: New Commands. (line 98) 4701* case-sensitive search <2>: Move Commands. (line 108) 4702* changing case: New Commands. (line 41) 4703* changing case <1>: Changing Text. (line 6) 4704* changing tab width: Options. (line 57) 4705* char: Groundwork. (line 86) 4706* CHAR: Groundwork. (line 86) 4707* column movement: Move Commands. (line 6) 4708* Command history: New Commands. (line 111) 4709* command line: Emacs Preliminaries. (line 46) 4710* Command ring: New Commands. (line 111) 4711* compiling: Useful Packages. (line 17) 4712* completion: Completion. (line 6) 4713* Control keys: Emacs Preliminaries. (line 79) 4714* customization: Customization. (line 6) 4715* cut and paste: Yanking. (line 6) 4716* describing regions: Basics. (line 21) 4717* desktop: Useful Packages. (line 45) 4718* Destructive command history: Viper Specials. (line 131) 4719* Destructive command ring: Viper Specials. (line 131) 4720* dired: Useful Packages. (line 39) 4721* dynamic abbrevs: Abbreviation Facilities. 4722 (line 11) 4723* ediff: Useful Packages. (line 50) 4724* Emacs state: States in Viper. (line 6) 4725* Emacs state <1>: Emacs State. (line 6) 4726* email: Useful Packages. (line 24) 4727* end (of buffer): Emacs Preliminaries. (line 6) 4728* end (of line): Emacs Preliminaries. (line 6) 4729* Ex addresses: Groundwork. (line 37) 4730* Ex commands: States in Viper. (line 6) 4731* Ex commands <1>: Vi State. (line 75) 4732* Ex commands <2>: Groundwork. (line 155) 4733* Ex customize: Customization. (line 17) 4734* Ex style motion: Movement and Markers. 4735 (line 6) 4736* expanding (region): Basics. (line 21) 4737* font-lock: Useful Packages. (line 42) 4738* global keymap: Emacs Preliminaries. (line 61) 4739* headings: Viper Specials. (line 78) 4740* headings <1>: Move Commands. (line 6) 4741* history: History. (line 6) 4742* incremental search: Improved Search. (line 23) 4743* initialization: Customization. (line 8) 4744* Insert state: States in Viper. (line 6) 4745* Insert state <1>: Insert State. (line 6) 4746* Insert state <2>: Editing in Insert State. 4747 (line 11) 4748* inserting: Appending Text. (line 11) 4749* Insertion history: New Commands. (line 111) 4750* Insertion ring: New Commands. (line 111) 4751* Insertion ring <1>: Viper Specials. (line 102) 4752* interactive shell: Useful Packages. (line 21) 4753* ispell: Useful Packages. (line 48) 4754* joining lines: Changing Text. (line 6) 4755* key bindings: Key Bindings. (line 6) 4756* key bindings <1>: Mapping. (line 6) 4757* key mapping: Mapping. (line 6) 4758* keyboard macros: Macros and Registers. 4759 (line 6) 4760* keyboard macros <1>: New Commands. (line 75) 4761* keymap: Emacs Preliminaries. (line 61) 4762* keymaps: Key Bindings. (line 6) 4763* last keyboard macro: Macros and Registers. 4764 (line 24) 4765* layout: Options. (line 46) 4766* line commands: Basics. (line 16) 4767* line commands <1>: Groundwork. (line 16) 4768* line editor motion: Movement and Markers. 4769 (line 6) 4770* literal searching: Options. (line 29) 4771* local keymap: Emacs Preliminaries. (line 61) 4772* looking at: Emacs Preliminaries. (line 6) 4773* macros: Macros and Registers. 4774 (line 6) 4775* mail: Useful Packages. (line 24) 4776* major mode: Emacs Preliminaries. (line 61) 4777* make: Useful Packages. (line 17) 4778* managing multiple files: Multiple Files in Viper. 4779 (line 6) 4780* mark: Emacs Preliminaries. (line 6) 4781* markers: Multiple Files in Viper. 4782 (line 11) 4783* markers <1>: Undo and Backups. (line 17) 4784* markers <2>: Move Commands. (line 6) 4785* marking: Marking. (line 10) 4786* matching parens: Move Commands. (line 6) 4787* matching parens <1>: Options. (line 49) 4788* Meta key: Emacs Preliminaries. (line 79) 4789* Meta key <1>: Vi State. (line 33) 4790* Meta key <2>: Insert State. (line 36) 4791* Minibuffer: Emacs Preliminaries. (line 46) 4792* Minibuffer <1>: The Minibuffer. (line 6) 4793* Minibuffer <2>: History. (line 6) 4794* minor mode: Emacs Preliminaries. (line 61) 4795* mode: Emacs Preliminaries. (line 61) 4796* mode line: Emacs Preliminaries. (line 46) 4797* mode line <1>: States in Viper. (line 54) 4798* mouse: Viper Specials. (line 220) 4799* mouse search: Improved Search. (line 33) 4800* mouse-insert: Viper Specials. (line 271) 4801* mouse-search: Viper Specials. (line 220) 4802* movement commands: Basics. (line 21) 4803* movement commands <1>: Move Commands. (line 6) 4804* movements: Groundwork. (line 34) 4805* Multifile documents and programs: Viper Specials. (line 185) 4806* multiple files: Multiple Files in Viper. 4807 (line 6) 4808* multiple files <1>: File and Buffer Handling. 4809 (line 6) 4810* multiple undo: Vi State. (line 57) 4811* paragraphs: Viper Specials. (line 78) 4812* paragraphs <1>: Move Commands. (line 6) 4813* paren matching: Move Commands. (line 6) 4814* paren matching <1>: Options. (line 49) 4815* paste: Appending Text. (line 11) 4816* paste <1>: Yanking. (line 6) 4817* point: Emacs Preliminaries. (line 6) 4818* point commands: Basics. (line 11) 4819* point commands <1>: Groundwork. (line 11) 4820* put: Appending Text. (line 11) 4821* query replace: Improved Search. (line 30) 4822* query replace <1>: New Commands. (line 21) 4823* quoting regions: Changing Text. (line 6) 4824* r and R region specifiers: Basics. (line 35) 4825* r and R region specifiers <1>: Groundwork. (line 25) 4826* RCS: Useful Packages. (line 37) 4827* readonly files: Options. (line 35) 4828* region: Emacs Preliminaries. (line 6) 4829* region <1>: Basics. (line 21) 4830* region specification: Basics. (line 21) 4831* register execution: Macros and Registers. 4832 (line 6) 4833* register execution <1>: New Commands. (line 75) 4834* registers: Multiple Files in Viper. 4835 (line 25) 4836* registers <1>: Undo and Backups. (line 17) 4837* registers <2>: Macros and Registers. 4838 (line 6) 4839* regular expressions: Vi State. (line 72) 4840* Replace state: States in Viper. (line 6) 4841* Replace state <1>: Replace State. (line 6) 4842* scrolling: Display. (line 6) 4843* searching: Move Commands. (line 6) 4844* searching <1>: Options. (line 69) 4845* sections: Viper Specials. (line 78) 4846* sections <1>: Move Commands. (line 6) 4847* sentences: Viper Specials. (line 78) 4848* sentences <1>: Move Commands. (line 6) 4849* setting variables: Rudimentary Changes. (line 6) 4850* shell: Useful Packages. (line 21) 4851* shell <1>: Options. (line 42) 4852* shell commands: Shell Commands. (line 18) 4853* shifting text: Deleting Text. (line 18) 4854* shifting text <1>: Options. (line 46) 4855* substitution: Changing Text. (line 6) 4856* syntax table: Movement and Markers. 4857 (line 18) 4858* syntax table <1>: Groundwork. (line 137) 4859* tabbing: Options. (line 57) 4860* text: Emacs Preliminaries. (line 6) 4861* text processing: Search and Replace. (line 37) 4862* textmarkers: Multiple Files in Viper. 4863 (line 11) 4864* textmarkers <1>: Undo and Backups. (line 17) 4865* textmarkers <2>: Movement and Markers. 4866 (line 58) 4867* textmarkers <3>: Move Commands. (line 6) 4868* transparent ftp: Useful Packages. (line 34) 4869* undo: Vi State. (line 57) 4870* undo <1>: Undo and Backups. (line 6) 4871* undo <2>: Undoing. (line 6) 4872* vanilla search: Vi State. (line 72) 4873* vanilla search <1>: New Commands. (line 98) 4874* vanilla search <2>: Move Commands. (line 108) 4875* variables for customization: Rudimentary Changes. (line 6) 4876* version maintenance: Useful Packages. (line 37) 4877* Vi macros: Vi Macros. (line 6) 4878* Vi options: Options. (line 6) 4879* Vi state: States in Viper. (line 6) 4880* Vi state <1>: Vi State. (line 6) 4881* viewing registers and markers: Undo and Backups. (line 17) 4882* viewing registers and markers <1>: Macros and Registers. 4883 (line 21) 4884* Viper and C-c: Packages that Change Keymaps. 4885 (line 6) 4886* Viper as minor mode: Emacs Preliminaries. (line 79) 4887* window: Emacs Preliminaries. (line 46) 4888* word search: Improved Search. (line 6) 4889* word wrap: Options. (line 65) 4890* words: Groundwork. (line 86) 4891* WORDS: Groundwork. (line 86) 4892 4893 4894 4895Tag Table: 4896Node: Top853 4897Node: Overview3992 4898Node: Emacs Preliminaries5612 4899Node: Loading Viper11143 4900Node: States in Viper13438 4901Node: Emacs State18602 4902Node: Vi State20090 4903Node: Insert State27305 4904Node: Replace State30305 4905Node: The Minibuffer31990 4906Node: Multiple Files in Viper33966 4907Node: Unimplemented Features37580 4908Node: Improvements over Vi38344 4909Node: Basics39435 4910Node: Undo and Backups42114 4911Node: History43338 4912Node: Macros and Registers44994 4913Node: Completion46801 4914Node: Improved Search47256 4915Node: Abbreviation Facilities49727 4916Node: Movement and Markers50746 4917Node: New Commands53949 4918Node: Useful Packages60399 4919Node: Customization62532 4920Node: Rudimentary Changes64419 4921Node: Key Bindings79965 4922Node: Packages that Change Keymaps90140 4923Node: Viper Specials96201 4924Node: Vi Macros114452 4925Node: Commands128313 4926Node: Groundwork129206 4927Node: Text Handling136095 4928Node: Move Commands136772 4929Node: Marking140701 4930Node: Appending Text142019 4931Node: Editing in Insert State144433 4932Node: Deleting Text145047 4933Node: Changing Text146413 4934Node: Search and Replace149587 4935Node: Yanking152280 4936Node: Undoing153234 4937Node: Display153602 4938Node: File and Buffer Handling154969 4939Node: Mapping159761 4940Node: Shell Commands161526 4941Node: Options163471 4942Node: Emacs Related Commands165849 4943Node: Mouse-bound Commands167514 4944Node: GNU Free Documentation License168422 4945Node: Acknowledgments193779 4946Node: Key Index196985 4947Node: Function Index214697 4948Node: Variable Index226519 4949Node: Package Index232263 4950Node: Concept Index232922 4951 4952End Tag Table 4953 4954 4955Local Variables: 4956coding: utf-8 4957End: 4958