Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!pasteur!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!hansm From: hansm@cwi.nl (Hans Mulder) Newsgroups: comp.editors Subject: Re: vi question Message-ID: <336@piring.cwi.nl> Date: 24 May 88 15:53:26 GMT References: <549@bnlux0.bnl.gov> Organization: CWI, Amsterdam Lines: 43 In article <549@bnlux0.bnl.gov> como@bnlux0.bnl.gov (Andrew Como) writes: > >What is the command to go to the end of the file. G > " " " " " " " " beginning of the file. 1G In general, type nG to go to line n. >Is there a mechanism to re-define keys. Type :map! ^V then hit the key, type a space, and then the definition. End it with an . (the ^V represents a control-V) >Is there a mechanism to bind a command to a key Type :map ^V then hit the key, type a space, and then the definition. End it with an . The difference between :map! type bindings and :map type bindings is that the former are used in insert mode, and the latter in command mode. In both cases it is possible to switch mode within such a definition. Keep in mind that vi does not automagically switch back. The definition is just a sequence of keystrokes which would be legal in that mode, except that some "special" characters like backspace and escape must be quoted with a ^V. To obtain a literal ^V, you need to type four of them. You can list the current :map! or :map bindings by typing :map! and :map respectively. If you want to keep such bindings across vi sessions, put the :map! commands in a file named .exrc in your home directory. -- Hans Mulder hansm@cwi.nl mcvax!hansm