Re: external page: vi - vim / avoid dangerous mappings!
On 06-Mar-02 at 00:53, Sven Guckes's inspired musing was thus : danger, will robinson! you just might mistype 'X' with 'Z' and then all your changes are lost. Not if you have a French AZERTY or german ZSDF keyboard... -- |-Simon White |-Internet Services Manager |-MTDS S.A. / \ |-tel +212.3.767.4861# GIMPS current unit progress: 28.10% # |-fax +212.3.767.4863# (http://www.mersenne.org/prime.htm) # |-14, rue 16 novembre\ / |-Rabat, Kingdom of Morocco
Re: external page: vi
Well, I switched to vi (vim, actually) as the For page a vi junkie, this is really much better (And, for a person who doesn't really understand how to use mutt right) I though I would pass along some helpful points in case anyone else wants to do this To start vi, I use the following set pager command in Muttrc: set pager=vi -c /^$/ -c / This moves the cursor to the start of the body of the email Thus, you skip all the header stuff I won't embarrass myself by telling how long it took me to figure this out Also, set prompt_after=no is handy To make it easier to read the mail, these three items in vimrc help map Z :q! --fast quit without saving anything map z z --- fast shift email to top of screen First command given after email comes up in vi I wish I could get this to happen automatically map g !}fmt ---wrap those long lines around If there are any vi newbies who want to try this, remember that to enter ^M you need to type, while in the insert mode: control-v [enter] Joel
Re: external page: vi - vim / avoid dangerous mappings!
* Joel Hammer [EMAIL PROTECTED] [020305 22:13]: Well, I switched to vi (vim, actually) as the . as the ?? For page a vi junkie, this is really much better. (And, for a person who doesn't really understand how to use mutt right.) ;-) I though I would pass along some helpful points in case anyone else wants to do this. To start vi, I use the following set pager command in Muttrc: set pager=vi -c /^$/ -c / This moves the cursor to the start of the body of the email. Thus, you skip all the header stuff. I won't embarrass myself by telling how long it took me to figure this out. if you'd looked at my setup file then you'd see this and some more examples on how to use vim as the editor and some other startup examples. (see signature) Also, set prompt_after=no is handy. that one is included, too. *grin* To make it easier to read the mail, these three items in .vimrc help. map Z :q! --fast quit without saving anything. danger, will robinson! you just might mistype 'X' with 'Z' and then all your changes are lost. you had better leave out the CR which sends of this command. then you can still back out from a typo with ESC. besides, ZZ is the vanilla vi to exit quickly. dunno why almost no description mentions that one. map z z --- fast shift email to top of screen. First command given after email comes up in vi. well, why not add this to the startup, too, then? ;-) again - you had better not map away a single key. after all, you are then missing the commands zz and zb to redisplay the current line the middle and at the bottom of the windows, respectively. I wish I could get this to happen automatically. map g !}fmt ---wrap those long lines around. automatic reformatting can easily be done. however, it is not always a good idea. trust me on this one. besides, this won't work for the windows version. (then again, what does work with windows at all?) better use the builtin text formating with gq. you might enjoy using CTRL-J for adjusting paragraphs: Formatting the current paragraph according to the current 'textwidth' with ^J (control-j): imap C-J C-Ogqap too dangerous for my editing ;-) nmap C-J gqap vmap C-J gq NOTE: This might require adjusting of the 'comments' variable. If there are any vi newbies who want to try this, remember that to enter ^M you need to type, while in the insert mode: control-v [enter] see also: :help c_CTRL-V Sven -- Sven [EMAIL PROTECTED] Sample Setup with lots of comments: MUTT http://www.math.fu-berlin.de/~guckes/setup/muttrc WOOF!,, MUTT http://www.math.fu-berlin.de/~guckes/setup/muttrc.forall(__/'. MUTT http://www.math.fu-berlin.de/~guckes/setup/mutt.personal/| |\
Re: external page: vi
On Tue, Mar 05, 2002 at 05:13:27PM -0500, Joel Hammer wrote: map z z --- fast shift email to top of screen. First command given after email comes up in vi. I wish I could get this to happen automatically. Joel Well, I'm pretty much a vi newbie myself but someone showed me a command called normal which lets you specify characters to pass arbitrarily to vi. I'm not sure exactly what you're trying to do there, since you seem to be mapping a key back to itself (map z to z) but that's probably just because I don't know enough about vim rc syntax. Anyway, try something like this: normal z^M ...or whatever you would normally physically type to vi to get it to do whatever. Oh yeah, and yes vi=vim in this email. :) 5.8 specifically, and yes I plan to upgrade soon. -- John Buttery (Web page temporarily unavailable) msg25070/pgp0.pgp Description: PGP signature
Re: external page: vi
It is different I think I like it because I am a vi junkie and I hate some of the single key responses in the mutt pager (like skipping to the next email when I just wanted to move down one line) It is disorienting to switch from vi to the mutt pager all the time and back I've also got fmt and par I had the same problem, as I am really using vi-syntax extensivly (even changed the bash-command to vi-syntax) So I use the following key-binding to navigate mutt mostly with just one hand (using hjkl) # Bindings # Generic bind generic l select-entry bind generic right select-entry # Index bind index l display-message bind index h change-folder bind index right display-message bind index left change-folder bind index H display-toggle-weed macro index , 'change-folder!^M' # Pager bind pager j next-line bind pager k previous-line bind pager h exit bind pager l view-attachments bind pager down next-line bind pager up previous-line bind pager left exit bind pager right view-attachments bind pager H display-toggle-weed macro pager , 'change-folder!^M' # Attach bind attach l view-attach bind attach right view-attach bind attach h exit bind attach left exit bind attach H display-toggle-weed # Compose bind compose l view-attach bind compose right view-attach As you can see, you can use hjkl or leftdownupright -- cu --== Jerri ==-- Homepage: http://wwwjerride/ ICQ: 54160208 msg24962/pgp0.pgp Description: PGP signature
Re: external page: vi
* Joel Hammer [EMAIL PROTECTED] [2002-03-03 20:46]: Is is possible and advantageous to use vi as an external pager? set pager=vi -- http://kldp.org/~eunjea/
Re: external page: vi
On Sun, Mar 03, 2002 at 08:46:41PM -0500, Joel Hammer [EMAIL PROTECTED] wrote: Is is possible Yes. and advantageous No. to use vi as an external pager? Hope this helps. :-) To be a little bit more specific, you lose all of the mutt highlighting, quote-hiding, pager_index_lines, as well as the ability to do things from the pager with a single keystroke. In return for this, you don't get any real advantage that I can think of. On the other hand, if it would make you happy, go for it. -Daniel -- Daniel E. Eisenbud [EMAIL PROTECTED] We should go forth on the shortest walk perchance, in the spirit of undying adventure, never to return,--prepared to send back our embalmed hearts only as relics to our desolate kingdoms. --Henry David Thoreau, Walking
Re: external page: vi
I made pager=vi in Muttrc. It is different. I think I like it because I am a vi junkie and I hate some of the single key responses in the mutt pager (like skipping to the next email when I just wanted to move down one line.) It is disorienting to switch from vi to the mutt pager all the time and back. I've also got fmt and par going to reformat messy emails quickly. I guess I will try it and see if it makes things more pleasant. Thanks for the help. Joel On Sun, Mar 03, 2002 at 09:10:04PM -0500, Daniel Eisenbud wrote: On Sun, Mar 03, 2002 at 08:46:41PM -0500, Joel Hammer [EMAIL PROTECTED] wrote: Is is possible Yes. and advantageous No. to use vi as an external pager? Hope this helps. :-) To be a little bit more specific, you lose all of the mutt highlighting, quote-hiding, pager_index_lines, as well as the ability to do things from the pager with a single keystroke. In return for this, you don't get any real advantage that I can think of. On the other hand, if it would make you happy, go for it. -Daniel -- Daniel E. Eisenbud [EMAIL PROTECTED] We should go forth on the shortest walk perchance, in the spirit of undying adventure, never to return,--prepared to send back our embalmed hearts only as relics to our desolate kingdoms. --Henry David Thoreau, Walking
Re: external page: vi
On Sun, Mar 03, 2002 at 09:43:04PM -0500, Joel Hammer [EMAIL PROTECTED] wrote: It is different. I think I like it because I am a vi junkie and I hate some of the single key responses in the mutt pager (like skipping to the next email when I just wanted to move down one line.) It is disorienting to switch from vi to the mutt pager all the time and back. I've also got fmt and par going to reformat messy emails quickly. Note that if your issue with the mutt pager is its keybindings, they are thoroughly configurable. You might consider using the mutt pager with keybindings that make you happy, and a macro that pipes problematic messages through fmt and par and into vi or less. But again, if it makes you happier to use vi, don't let me get in your way. :-) There's a reason that mutt has a $pager variable. -Daniel I guess I will try it and see if it makes things more pleasant. Thanks for the help. Joel On Sun, Mar 03, 2002 at 09:10:04PM -0500, Daniel Eisenbud wrote: On Sun, Mar 03, 2002 at 08:46:41PM -0500, Joel Hammer [EMAIL PROTECTED] wrote: Is is possible Yes. and advantageous No. to use vi as an external pager? Hope this helps. :-) To be a little bit more specific, you lose all of the mutt highlighting, quote-hiding, pager_index_lines, as well as the ability to do things from the pager with a single keystroke. In return for this, you don't get any real advantage that I can think of. On the other hand, if it would make you happy, go for it. -Daniel -- Daniel E. Eisenbud [EMAIL PROTECTED] We should go forth on the shortest walk perchance, in the spirit of undying adventure, never to return,--prepared to send back our embalmed hearts only as relics to our desolate kingdoms. --Henry David Thoreau, Walking -- Daniel E. Eisenbud [EMAIL PROTECTED] We should go forth on the shortest walk perchance, in the spirit of undying adventure, never to return,--prepared to send back our embalmed hearts only as relics to our desolate kingdoms. --Henry David Thoreau, Walking
Re: external page: vi
I suppose I could learn more about mutt and make the pager easier for me to use, but, I am trying to do the unix thing, and just learn to use a few basic tools well and solve diverse problems with them (The man with a hammer syndrome) I am working hard to improve my vi and sed skills right now It is amazing how complicated and powerful these supposedly simple tools really are Joel Note that if your issue with the mutt pager is its keybindings, they are thoroughly configurable You might consider using the mutt pager with keybindings that make you happy, and a macro that pipes problematic messages through fmt and par and into vi or less
Re: external page: vi
On Sun, Mar 03, 2002 at 09:43:04PM -0500, Joel Hammer wrote: I made pager=vi in Muttrc. It is different. I think I like it because I am a vi junkie and I hate some of the single key responses in the mutt pager (like skipping to the next email when I just wanted to move down one line.) It is disorienting to switch from vi to the mutt pager all the time and back. I've also got fmt and par going to reformat messy emails quickly. In addition to what Daniel said about the keybindings, you can configure mutt to solve some of the other problems with the pager as well. For example, to avoid skipping to the next message when you just wanted to move down a line, set pager_stop=yes I guess I will try it and see if it makes things more pleasant. You may want to set prompt_after=no so that when you exit vi, mutt returns to the index menu immediately instead of first prompting you for a command. HTH, Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Spokane, Washington, USA http://www.spocom.com/users/gjohnson/mutt/ |