Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sources.redhat.com/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Mon, 3 Jun 2002 08:52:32 -0500 From: David T-G <davidtg-cygwin AT justpickone DOT org> To: "CygWin Users' List" <cygwin AT cygwin DOT com> Subject: Re: vi Message-ID: <20020603135231.GH1231@justpickone.org> References: <AHENJAAPGAHKCFPLDPOJMEMPCGAA DOT relaxedrob AT optushome DOT com DOT au> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fd5uyaI9j6xoeUBo" Content-Disposition: inline In-Reply-To: <AHENJAAPGAHKCFPLDPOJMEMPCGAA.relaxedrob@optushome.com.au> User-Agent: Mutt/1.3.99i --fd5uyaI9j6xoeUBo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Robert -- =2E..and then Robert Mark Bram said... %=20 % Howdy all! Hiya! %=20 % I am still a great fan of my gui text editor, Ultraedit, but I am trying = to % get to know vi so I can truly compare them. I've heard nice things about UE, but truly there is nothing like vi. Unfortunately, it's probably one of those things that you'll either love or hate; there's no middle ground :-) %=20 % I found this about copy in vi's help system: BTW, you're actually looking at vim, which is a souped-up (ahem, IMproved) version of vi. You can learn much more about it at vim.org and also browse the mailing lists to see some discussion of features. But I digress... %=20 % :[range]co[py] {address} *:co* *:copy* % Copy the lines given by [range] to below the line % given by {address}. %=20 % Does the address refer to a line number here? Is there a way turn line % numbers on? There sure is. Just type one of :set nu :set numbers when in command mode (and "nonu" or "nonumbers" to turn them off). %=20 % Does vi allow for a simple copy/cut and paste? Yes and no... The vim that you're running is the console version, so you'd be using the console windowing support to do so if you wanted to use the mouse. You could compile up your own version of vim and have the GUI version, gvim, as well (I'd like to know why this isn't in the cygwin version but haven't done any reading and thus haven't posed the question, but since it's come up... :-) There is "yanking" in vi, which accomplishes what you want within the vi buffer buanking" in vi, which accomplishes what you want t doesn't put the data on the system clipboard. To yank a line, type 'yy'; to yank ten lines, type '10yy'; to yank ten lines into buffer a type '"a10yy'. To put your yanked lines, go to your destination and type 'p'; to put the lines from buffer a, type '"ap'. Since you're running vim, see lots more with :help yank and have fun :-) I believe that gvim now has support for specified-width copying (like grabbing a block of columns 14 thru 30 on lines 3 thru 10) but haven't played with it enough to know what to set or even if my understanding is accurate. More on the vim list, I'm sure. %=20 % I read the section for wrap too - so I can turn wrapping on and off easil= y, % but it didn't make sense to me. How do I turn this option on and off? Setting a wrapmargin or a textwidth means that really long lines, like I've= specifically made this one, are broken for you as you type. You set them by typing :set wm 8 to back off 8 chars from the right edge of your screen or :set tw 72 to set your width to 72 no matter what size your screen is. As before, you can use the long or short names interchangeably. If you have a paragraph that now looks funny because you had tw set and then you went back and added some text in the middle and now your edges are really messed up, kind of like this demo paragraph, you can use the vim function "gq" (which has lots and lots of options) to reformat your paragraph. If you're running stock vi, you'll have to use something like fmt or par called from a macro; my .exrc has map f !} fmt -c map F !} fmt -c -w 78 in it for just that purpose (in command mode I can hit 'f' to format the paragraph from my cursor down, while 'F' formats it extra-wide to perhaps squeeze up a very short line). All of these options, which you set with a=20 :set command in the editor, can be set in your .exrc or .vimrc file by leaving off the : part and just typing in the setting, as I did for=20 my fmt mappings (which would be ":map ..." interactively). %=20 % Thanks for any help! HTH & HAND & as they say on the other list Happy Vimming %=20 % Rob %=20 % :) % :-} % ;-> :-D --=20 David T-G * It's easier to fight for one's principles (play) davidtg AT justpickone DOT org * than to live up to them. -- fortune cookie (work) davidtgwork AT justpickone DOT org http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! --fd5uyaI9j6xoeUBo Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE8+3SfGb7uCXufRwARAv4tAKCQkqelS525c4fwWtKZoks9wU2m/wCbBVYq XKsPjIXzcODML5OKpqsPiJs= =Y4OR -----END PGP SIGNATURE----- --fd5uyaI9j6xoeUBo--