Re: Mutt + Vim tricks (replace Nano)
On Sun, Oct 26, 2003 at 08:24:31PM -0800, Bill Moseley wrote: On Sun, Oct 26, 2003 at 06:27:11PM -0600, Will Trillich wrote: Lately, I do more email than anything else so I figured that using vim for email would be a good way to learn. quite! And it's really got me curious because I'm sure I'm not using it efficiently yet -- everyone else can't be pressing this many keystrokes for simpler operations, I figure. ;) i bet even folks like Bram Moolenaar go a few hours now and then without using every single vim feature. (that's the name on the version six manual, so it seems reasonable to presume that bram is a qualified vim expert.) quite. i've learned to have a blank line going before i paste in some goodies, to make it easier to delete if i've got autoindent on (or paste off): type type type newline newline paste whoops! icky formatting -- esc d { { Whew. And it's really esc d shift { { i See why I miss ^U for undo? I imagined vim users had keys mapped to do all those common tasks. but we've got 'u' for undo. yes, vim undoes the single last thingie, which was lots of typing (some of which may have come from a clipboard somewhere, but vim doesn't know about that). and as colin said, the 'whoops' above isn't the slickest way to do it -- it's just something that happens even to a seasoned veteran. (at least veterans seasoned the way i am. :) which is what the 'pastetoggle' feature is designed to help. Now is the time I'd like that short-cut to cut all text from here to my signature line. esc V (down, down, down) x. Now, I'm sure I'm doing that the hard way. when you're learning, it's sticky to try and remember things like ESC } d 2 } but once you've got a handle on the commands you use frequently, they become firmware in your brain and you just cruise onward, without even realizing all the keys you're pressing. now and then i'm in insert mode without knowing it, and i've inserted a stream of ten or fifteen vim commands, and to look at them on screen, i'm often surprised at how cryptic and obscure they are. it always takes me longer to decode a string of vim commands (lemme see -- right brace, delete, left brace, hmm...) than it does to issue them when that's what i'm after. Can you describe your email editing sessions with vim? many keystrokes, few minutes. of course, it pays to spend time and be sure you're saying what you mean to say, so my email sessions always take a good long time. if you like, i could record a quick session and send you the results as a vim macro. eek! Seems like a simple use of an editor: - I prune text (dd is one extra keystroke, esc shift v, down, down, down, is also too many strokes) [^K in nano] dd is two keystrokes indeed. but the first one means 'delete something' and what follows specifies exactly that. dG d]] d3w d5B dd the last one is a shortcut for d1d, so we saved you a keystroke and you didn't even notice. :) - I edit paragraphs and re-justify them as I type [^J] :imap F10 XQXESCgqip?XQXCR3s - I move text/paragraphs up/down. [^K^K^K move and ^U to paste] heavens! why use two keystrokes when one will do? :) :map F11 }{d}{P :map F12 }{d}}P note -- every d rotates cut text among your 0 - 9 registers. just so you know. (try :reg to see more.) - I paste in text and code examples that I don't want wrapped (and often want indented). pastetoggle to the rescue! - I trim left over text down to my sig. CRd/^-- CR Isn't that what everyone does when writing mail? unfortunately, no. some people leave the whole previous email in there as a convenient means of abusing bandwidth. (made worse by answering above the questions, totally backwards.) :) -- I use Debian/GNU Linux version 3.0; Linux boss 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i586 unknown DEBIAN NEWBIE TIP #38 from Alvin Oga [EMAIL PROTECTED] : Curious about your NETWORK TRAFFIC? There's a whole bunch of ways to monitor it: iptraf, showtraf, netwatch, tcpview, statnet, or even tcpdump | grep 'what you want to see' lsof -i | grep 'LISTEN' For network statistics try mrtg. See the ethernet section over at http://www.Linux-Sec.net/ Also see http://newbieDoc.sourceForge.net/ ... -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Mon, 27 Oct 2003 at 04:24 GMT, Bill Moseley penned: See why I miss ^U for undo? I imagined vim users had keys mapped to do all those common tasks. I can't speak for others, but me, I'd rather type 4 or 5 characters near the home row than have to use alt or control. Much easier to extend the pinky for esc than to move it for those two, too. Also, a great thing about vi/vim is that the keystrokes you learn become building blocks to bigger and better things. Okay, so first you learn d, then you learn dd. Then you learn y, and then you learn that yy also acts on the whole line. You learn that dw deletes a word, and now you konw that yw copies a word. Then maybe someone shows you c5w, and now you know that you can apply the same with the other commands ... I found that with vim, the initial learning curve was steep, but once I got going, I picked up whole classes of behaviors just by learning one more keystroke. This is the power of vi. -- monique Unless you need to share ultra-sensitive super-spy stuff with me, please don't email me directly. I will most likely see your post before I read your mail, anyway. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Sun, Oct 26, 2003 at 08:24:31PM -0800, Bill Moseley wrote: On Sun, Oct 26, 2003 at 06:27:11PM -0600, Will Trillich wrote: quite. i've learned to have a blank line going before i paste in some goodies, to make it easier to delete if i've got autoindent on (or paste off): type type type newline newline paste whoops! icky formatting -- esc d { { Whew. And it's really esc d shift { { i See why I miss ^U for undo? Undo is 'u' in command mode. Redo is Ctrl-R. I imagined vim users had keys mapped to do all those common tasks. What Monique said about the home row and about composing operations. Also, I don't even think about operations I carry out in vi. My hindbrain has worked out what to do and got my fingers to do it long before I'm consciously aware of it. I don't think d{{, I think delete last paragraph, then go back another paragraph; and I certainly don't think about the Esc to return to command mode and the i to enter insert mode on either side of that. I probably operate vim far more quickly than most people operate their simpler editors, but the difference is that when I need to do something more complicated than the simple editor provides a single keystroke for, it's very likely just an obvious extension to the vim command I know already: perhaps just adding a number prefix or changing a motion character. You complain about gqap versus ^J, but what happens if you have some more intricate formatting and need to justify just the current line? gqq. All the way to the end of the file? gqG. The next five paragraphs? {gq5}. Simpler editors really do seem crude and limiting to me these days, even if they do provide some single- or double-keypress facilities for actions their programmers thought were common. So yes, real vi users do use those key sequences you regard as prohibitively long; they also do editing that goes beyond the trivial in half the time it'd take others to do it and without much thought, and the key sequences they use to do this are logical extensions of the ones they use for trivial editing. Now is the time I'd like that short-cut to cut all text from here to my signature line. esc V (down, down, down) x. Now, I'm sure I'm doing that the hard way. Easy enough to map a macro which sets a mark, searches for ^-- $, sets another mark, returns to the first mark, and deletes everything up to the second mark. Write it once and map it to a key sequence you prefer. Also, see below. Can you describe your email editing sessions with vim? Seems like a simple use of an editor: - I prune text (dd is one extra keystroke, esc shift v, down, down, down, is also too many strokes) [^K in nano] I think ooh, I want to delete about 10 lines here and type 10dd. Or, to delete a large chunk of text, I might hit v, search for the start of what I want to keep, move to the end of the previous line, and hit d. - I edit paragraphs and re-justify them as I type [^J] gq} often and reflexively, and usually draw a visual area over the whole thing and hit gq just before I quit. - I move text/paragraphs up/down. [^K^K^K move and ^U to paste] v}}}d to delete; p to paste. Season to taste. - I paste in text and code examples that I don't want wrapped (and often want indented). Will does this the hard way. :) I have 'set pastetoggle=F11' in ~/.vimrc. So I hit F11, paste, hit F11 again. To indent, let's say ':set sw=2' (for two spaces) if that isn't set already, select what I've just pasted, and hit . - I trim left over text down to my sig. See above. You could also ensure a blank line above your signature (which my mailer inserts by default) and delete the remaining quoted text as a single paragraph. For example, when writing this mail, I zapped the remaining text I'd quoted from you with a simple d} after I'd finished typing my last paragraph. Of course, I don't think about any of this. My fingers pretty much do it for me. Cheers, -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Sat, Oct 25, 2003 at 09:43:44PM -0700, Bill Moseley wrote: On Sat, Oct 25, 2003 at 10:58:43PM -0500, Will Trillich wrote: | Control-W to toggle wrap mode (which would be toggle | paste mode in Vim) another approach could be :set pastetoggle=F9 and use F9 whether in insert mode or not... Oh, that's perfect. Thanks. Any reason not to map that to ^W so I don't have to remember which editor I'm using? one reason is, because we say so. a bad reason, but a reason, nonetheless. another, better, reason, is that ^W is already used for something else. i tried your mappings for a while last night (i've been using vi since about 1987, so there wasn't much hope) and darn near went mad. ^W kill word (:help ^W) ^K keymap/digraph («·» for example) (:help digraph) ^J newline (standard-issue character ten) ^U kill the line (also works from your friendly neighborhood shell's command line -- and in most Xwindow dialogs) note that these are for insert mode -- in command mode, ^W does window/pane stuff: ^W s -- split the window ^W ^W -- rotate to another pane see :help ^W ^K doesn't have any function in command mode (as far as i can tell) ^J moves down a line (as does plain old j -- see hjkl for all four movement features, from wy back when) ^U scrolls up 1/2 screen when you nose around vim's :help files, you'll see that vim has mucho muscle to do lots of heavy lifting. it's overkill for a thank-you to gramma, it's just the ticket when crafting email or serious coding projects. not that there's anything wrong with bluefish or emacs. i've invested all these years, why not reap the rewards? :) | Control-K to kill a line. I find nano nice for 95% of what I'm doing in mail, type, re-justify (^J) and delete lines (^K). But that other 5% that vim gives me is really nice. So I'm really trying to use vim as if it was nano. Still, I feel like I'm using a lot more keystrokes using vim than nano. I need to learn a lot more. to kill a line, vi (vim) uses dd, so :imap C-K ESCdd curious -- what features does vim have that's got you interested in exploring vim: the-modal-editor-from-purgatory? Here's something that bugs me. I often type something like this text and then below I want to paste in some text. So, I move down a line, then middle click the mouse to paste in. But then I forgot to turn on paste mode, so I hit Esc and u to undo, but it then undoes not only what I just pasted but all the text I just typed. quite. i've learned to have a blank line going before i paste in some goodies, to make it easier to delete if i've got autoindent on (or paste off): type type type newline newline paste whoops! icky formatting -- esc d { { I guess I need to learn to undo just the current paragraph. I suppose vim (not gvim) has no idea when I'm typing vs pasting with the middle button. very astute. the Xwindow system knows how it sent the information to your xterm session, but your vim process only knows it's got a lot of incoming text to handle. even with paste set, it only knows not to autoindent, and so forth - no actual cognizance of where its input comes from. might wanna consider creating custom keystrokes for your own shortcuts and macros, but go ahead and utilize the features vim has 'out of the box' without redefining everything. I could not agree more. I just need to become efficient enough with vim to feel like it's not more work than using another editor. With nano when I add some text to a paragraph and need to re-justify I just hit ^J. In Vim I'm hitting Esc+g+q+a+p and then I forget to move back into insert mode and start typing. Hard to believe that's how others are using vim. there are hefty editors out there that don't subscribe to the modal paradigm used by editors such as vi (vim). a friend of mine who's a hardware geek uses vi hither and yon, and thinks it's probably powerful, but klutzy. when he sees me use it, his jaw drops and he says wow, if you know your way around vi, you can get a lot done in a hurry. sheesh! and then he goes back to using midnight commander (mc). :) vim is difficult to learn. and once you learn it, it's difficult to do without. -- I use Debian/GNU Linux version 3.0; Linux boss 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i586 unknown DEBIAN NEWBIE TIP #120 from Oliver Elphick [EMAIL PROTECTED] : So you want to ENTER UMLAUTS ON AN ENGLISH KEYBOARD -- here's how, in Vim: control-k u (control-K, then 'U', then ''). Simple! To see all of vim's currently-defined digraphs, try :dig Also see http://newbieDoc.sourceForge.net/ ... -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Sun, Oct 26, 2003 at 12:24:34PM -0700, Monique Y. Herman wrote: On Sun, 26 Oct 2003 at 04:43 GMT, Bill Moseley penned: just need to become efficient enough with vim to feel like it's not more work than using another editor. I love vim, but for the most basic tasks, it *is* more work than using a simpler editor, like pico or dosedit. The thing is, as soon as you add even the teensiest wrinkle to what you want to do, the full-featured editor wins, hands-down. i'm surprised emacs fanatics aren't taking this as a thrown gauntlet. not disappointed, only surprised. :) -- I use Debian/GNU Linux version 3.0; Linux boss 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i586 unknown DEBIAN NEWBIE TIP #40 from Will Trillich [EMAIL PROTECTED] : Why are ROOT LOGINS EVIL? The main problem is this: if you have a handful of trusted people who know the root password, you can't tell -- not just by looking in the logs -- which one logged in as root! But if you have them log in as themselves first, they can su or sudo to get root privileges, and then the logs will reflect who they actually are. To facilitate this, empty out /etc/securetty (see /etc/pam.d/login for info). Also see http://newbieDoc.sourceForge.net/ ... -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Sun, 26 Oct 2003 at 04:43 GMT, Bill Moseley penned: I could not agree more. I just need to become efficient enough with vim to feel like it's not more work than using another editor. With nano when I add some text to a paragraph and need to re-justify I just hit ^J. In Vim I'm hitting Esc+g+q+a+p and then I forget to move back into insert mode and start typing. Hard to believe that's how others are using vim. I love vim, but for the most basic tasks, it *is* more work than using a simpler editor, like pico or dosedit. The thing is, as soon as you add even the teensiest wrinkle to what you want to do, the full-featured editor wins, hands-down. -- monique Unless you need to share ultra-sensitive super-spy stuff with me, please don't email me directly. I will most likely see your post before I read your mail, anyway. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Sun, Oct 26, 2003 at 06:27:11PM -0600, Will Trillich wrote: another, better, reason, is that ^W is already used for something else. i tried your mappings for a while last night (i've been using vi since about 1987, so there wasn't much hope) and darn near went mad. Now you know how I feel. I've been doing this for weeks! ;) curious -- what features does vim have that's got you interested in exploring vim: the-modal-editor-from-purgatory? You mean other than trying to use Emacs first?... Well, it seems like a nice, powerful text-based editor that I could extend as needed. I want to use it for coding (Perl and C). Not perfect reason but there's enough vim devotees that I'm curious, too. Lately, I do more email than anything else so I figured that using vim for email would be a good way to learn. And it's really got me curious because I'm sure I'm not using it efficiently yet -- everyone else can't be pressing this many keystrokes for simpler operations, I figure. ;) quite. i've learned to have a blank line going before i paste in some goodies, to make it easier to delete if i've got autoindent on (or paste off): type type type newline newline paste whoops! icky formatting -- esc d { { Whew. And it's really esc d shift { { i See why I miss ^U for undo? I imagined vim users had keys mapped to do all those common tasks. Now is the time I'd like that short-cut to cut all text from here to my signature line. esc V (down, down, down) x. Now, I'm sure I'm doing that the hard way. Can you describe your email editing sessions with vim? Seems like a simple use of an editor: - I prune text (dd is one extra keystroke, esc shift v, down, down, down, is also too many strokes) [^K in nano] - I edit paragraphs and re-justify them as I type [^J] - I move text/paragraphs up/down. [^K^K^K move and ^U to paste] - I paste in text and code examples that I don't want wrapped (and often want indented). - I trim left over text down to my sig. Isn't that what everyone does when writing mail? Thanks, -- Bill Moseley [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Wed, Oct 01, 2003 at 12:26:23PM -0400, Derrick 'dman' Hudson wrote: On Tue, Sep 30, 2003 at 02:13:58PM -0700, Bill Moseley wrote: | I'm finding with vim as my mail editor I jump in and out of insert mode | for things that are kind of basic. I miss from Nano: | | Control-A/Contrl-E for ^ and $ :map C-a 0 :imap C-a ESC0i or :map C-a ^ :imap C-a ESC^i :map C-e $ :imap C-e ESC$a | Control-J to justify :map C-J gqip :imap C-J ESCgqip{ | Control-W to toggle wrap mode (which would be toggle paste mode in | Vim) another approach could be :set pastetoggle=F9 and use F9 whether in insert mode or not... | Control-K to kill a link. like html? as in all text between and ? (see :help html) | And maybe Control-U to undo ^U is still there. eh? by default, ^U scrolls up half a screen. lower-case u is the default 'undo' for vi (and vim). and ^R is the default re-do. here's the deal -- *nix is customizable. if you work hard enough, you might munge up enough keybindings in vim to fool the casual observer into thinking he's using wordstar. but then you'll also surprise every vi user on the block into not being able to use your editor. and WHEN YOU'RE AWAY FROM HOME, you'd have to have your settings with you everywhere you go, or be rather confusedly lost. might wanna consider creating custom keystrokes for your own shortcuts and macros, but go ahead and utilize the features vim has 'out of the box' without redefining everything. :) just a thought. -- I use Debian/GNU Linux version 3.0; Linux boss 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i586 unknown DEBIAN NEWBIE TIP #60 from Vineet Kumar [EMAIL PROTECTED] : Been hoping to find A FEATURE-PACKED MUTT CONFIG FILE? Try browsing these: Mutt config files: http://www.guckes.net/mutt/ Mutt FAQ by Fefe: http://www.fefe.de/muttfaq/muttrc Also look for some great ~/.vimrc ideas there, too. Also see http://newbieDoc.sourceForge.net/ ... -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Sat, Oct 25, 2003 at 10:58:43PM -0500, Will Trillich wrote: | Control-W to toggle wrap mode (which would be toggle paste mode in | Vim) another approach could be :set pastetoggle=F9 and use F9 whether in insert mode or not... Oh, that's perfect. Thanks. Any reason not to map that to ^W so I don't have to remember which editor I'm using? | Control-K to kill a link. like html? as in all text between and ? (see :help html)a No, that's my bad typing. I meant kill a line. I find nano nice for 95% of what I'm doing in mail, type, re-justify (^J) and delete lines (^K). But that other 5% that vim gives me is really nice. So I'm really trying to use vim as if it was nano. Still, I feel like I'm using a lot more keystrokes using vim than nano. I need to learn a lot more. | And maybe Control-U to undo ^U is still there. eh? by default, ^U scrolls up half a screen. lower-case u is the default 'undo' for vi (and vim). and ^R is the default re-do. That's what my help says, too. But Ctrl+U right now is deleting the current line. Here's something that bugs me. I often type something like this text and then below I want to paste in some text. So, I move down a line, then middle click the mouse to paste in. But then I forgot to turn on paste mode, so I hit Esc and u to undo, but it then undoes not only what I just pasted but all the text I just typed. I guess I need to learn to undo just the current paragraph. I suppose vim (not gvim) has no idea when I'm typing vs pasting with the middle button. *nix is customizable. if you work hard enough, you might munge up enough keybindings in vim to fool the casual observer into thinking he's using wordstar. but then you'll also surprise every vi user on the block into not being able to use your editor. and WHEN YOU'RE AWAY FROM HOME, you'd have to have your settings with you everywhere you go, or be rather confusedly lost. might wanna consider creating custom keystrokes for your own shortcuts and macros, but go ahead and utilize the features vim has 'out of the box' without redefining everything. I could not agree more. I just need to become efficient enough with vim to feel like it's not more work than using another editor. With nano when I add some text to a paragraph and need to re-justify I just hit ^J. In Vim I'm hitting Esc+g+q+a+p and then I forget to move back into insert mode and start typing. Hard to believe that's how others are using vim. :) just a thought. Which I appreciate. I need all the help I can get! ;) -- Bill Moseley [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
At Wed, 1 Oct 2003 15:51:42 + (UTC), Monique Y. Herman wrote: [...] I've tried opera, though not recently ... my preferred choice is still mozilla (love the tabs!) Try w3m. It has the visual equivalent of tabs. You can use your favorite editor (mine's emacs) to fill forms.. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
Hallo! * Monique Y. Herman [EMAIL PROTECTED] wrote: I'm afraid I don't know. I've been using vim long enough that I hit 'escape' reflexively all the time ... including in web forms, which does *not* have desirable results. Try opera. It has the possibility to change the keybindings (down in the .opera/*ini files). Basic bash/jed keystrokes like strg+a,strg+k works very well for me :) Jan -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Wed, 1 Oct 2003 13:45:27 +0200, Jan Schulz [EMAIL PROTECTED] penned: Hallo! * Monique Y. Herman [EMAIL PROTECTED] wrote: I'm afraid I don't know. I've been using vim long enough that I hit 'escape' reflexively all the time ... including in web forms, which does *not* have desirable results. Try opera. It has the possibility to change the keybindings (down in the .opera/*ini files). Basic bash/jed keystrokes like strg+a,strg+k works very well for me :) Jan Okay, now I'm curious -- what is strg? I've tried opera, though not recently ... my preferred choice is still mozilla (love the tabs!) In regard to the first message, there are tons tips on vim.org, many of which do things while in insert mode ... so I would suggest searching through those and using them as an example. It's unfortunate that most of the tips don't explain *how* they work, but a little research usually goes a long way. -- monique -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Tue, Sep 30, 2003 at 02:13:58PM -0700, Bill Moseley wrote: | On Tue, Sep 30, 2003 at 02:58:53PM +, Monique Y. Herman wrote: | On Mon, 29 Sep 2003 22:51:35 -0700, Bill Moseley [EMAIL PROTECTED] penned: | | I just created the following last night. ctrl-j aligns the paragraph to | 78 chars; ctrl-k makes it flow; use ':let my_tw=x' before ctrl-L | to align it to some arbitrary number. | | Ctrl-J/K formats the current paragraph | gggqG would do the whole file | map C-J :let old_tw = twCR:set tw=78CRgqap:let tw=old_twCR | | that seems to work, but only if in normal mode. That's the intended semantics of 'map'. | Is it possible to detect the current mode and if in INSERT then | still work and return in INSERT mode? :help imap An excerpt from the summary section of the vim manual : :map {lhs} {rhs} *:map* :nm[ap] {lhs} {rhs} *:nm* *:nmap* :vm[ap] {lhs} {rhs} *:vm* *:vmap* :om[ap] {lhs} {rhs} *:om* *:omap* :map!{lhs} {rhs} *:map!* :im[ap] {lhs} {rhs} *:im* *:imap* :lm[ap] {lhs} {rhs} *:lm* *:lmap* :cm[ap] {lhs} {rhs} *:cm* *:cmap* Map the key sequence {lhs} to {rhs} for the modes where the map command applies. The result, including {rhs}, is then further scanned for mappings. This allows for nested and recursive use of mappings. Basically the map commands are specific to a given mode so that you can set up different mappings for different modes. | I'm finding with vim as my mail editor I jump in and out of insert mode | for things that are kind of basic. I miss from Nano: | | Control-A/Contrl-E for ^ and $ | | Control-J to justify | | Control-W to toggle wrap mode (which would be toggle paste mode in | Vim) | | Control-K to kill a link. I switch back and for between insert and normal modes easily enough that it doesn't bother me. I also tend to leave certain things, such as rewrapping, until I am done writing in the paragraph. (BTW FWIW, I think edit is a good description of normal mode) | And maybe Control-U to undo ^U is still there. HTH, -D -- If your life is a hard drive, Christ can be your backup. http://dman13.dyndns.org/~dman/ pgp0.pgp Description: PGP signature
Re: Mutt + Vim tricks (replace Nano)
On Wed, Oct 01, 2003 at 03:51:42PM +, Monique Y. Herman wrote: On Wed, 1 Oct 2003 13:45:27 +0200, Jan Schulz [EMAIL PROTECTED] penned: Hallo! * Monique Y. Herman [EMAIL PROTECTED] wrote: I'm afraid I don't know. I've been using vim long enough that I hit 'escape' reflexively all the time ... including in web forms, which does *not* have desirable results. Try opera. It has the possibility to change the keybindings (down in the .opera/*ini files). Basic bash/jed keystrokes like strg+a,strg+k works very well for me :) Okay, now I'm curious -- what is strg? It's an abbreviation for the German Steuerung, the equivalent of Ctrl in English. Cheers, -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Mon, Sep 29, 2003 at 11:34:11AM -0400, Derrick 'dman' Hudson wrote: In my .vimrc I have the following mail-specific settings: augroup Mail au! au FileType mail set tw=70 fo=tcrq2 nomodeline au FileType mail set comments+=n:\| clear the old sig and go back to the beginning of the buffer au BufRead /tmp/mutt* normal :g/^| -- $/,/^$/-1d gg augroup END (note that between the 'd' and the 'gg' on the last line is a literal carriage return) Hum, well, I couldn't get that one (to clear the .sig) to work -- perhaps I didn't understand what you mean by liberal carriage return. But it's late and I just recovered almost 50G of data off a backup, so I may not be thinking just right. I'm using a ~/.vim/ftplugin/mail.vim file (below), I'm also not having much luck understanding :map -- I can get it to work sometime, but not always. For example, I'd like to map ^J to gq} to warp a paragraph -- and it I'd like it to work in editing or command/normal mode. I'd also like to start in insert mode, I think. I might like ^A and ^E for start and end of line as I find it easier to type than ^ and $, at least for my fingers. Seems like for email I don't really need to jump out of Insert mode very often. Another nice feature would be a key to delete from current position to my .sig line. I suppose that should be easy enough to do. BTW -- it was recommended I use :set nowrap for pasting, but I think that's just for displaying wraps on my screen. I think :set tw=0, or better, :set paste is what I needed. Here's my mail.vim setup so far. [EMAIL PROTECTED]:~$ cat .vim/ftplugin/mail.vim Don't allow modlines in mail to effect us setlocal nomodeline This is useful for pasting in indented quotes setlocal autoindent Be smart about formatting comments with gq} setlocal comments=n:,n:\| Set auto wrapping (set tw=0 for pasting in things that should not be wrapped) setlocal tw=70 I like to backspace/back arrow to previous lines setlocal whichwrap=b,s,,,[,] Show tabs and trailing whitespace (need to figure out how to use a different color) setlocal list setlocal listchars=tab:-,trail:+ Go crazy with color syntax on Enable display wrapping setlocal wrap Jump to first blank line (maybe farther would be better) /^$ -- Bill Moseley [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Mon, 29 Sep 2003 22:51:35 -0700, Bill Moseley [EMAIL PROTECTED] penned: For example, I'd like to map ^J to gq} to warp a paragraph -- and it I'd like it to work in editing or command/normal mode. I'd also like to start in insert mode, I think. I might like ^A and ^E for start and end of line as I find it easier to type than ^ and $, at least for my fingers. Seems like for email I don't really need to jump out of Insert mode very often. I just created the following last night. ctrl-j aligns the paragraph to 78 chars; ctrl-k makes it flow; use ':let my_tw=x' before ctrl-L to align it to some arbitrary number. Ctrl-J/K formats the current paragraph gggqG would do the whole file map C-J :let old_tw = twCR:set tw=78CRgqap:let tw=old_twCR map C-K :let old_tw = twCR:set tw=9CRgqap:let tw=old_twCR let my_tw = 30 map C-L :let old_tw = twCR:let tw=my_twCRgqap:let tw=old_twCR -- monique My pointless ramblings: http://www.bounceswoosh.org/phorum/index.php?f=6 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Tue, Sep 30, 2003 at 02:58:53PM +, Monique Y. Herman wrote: On Mon, 29 Sep 2003 22:51:35 -0700, Bill Moseley [EMAIL PROTECTED] penned: I just created the following last night. ctrl-j aligns the paragraph to 78 chars; ctrl-k makes it flow; use ':let my_tw=x' before ctrl-L to align it to some arbitrary number. Ctrl-J/K formats the current paragraph gggqG would do the whole file map C-J :let old_tw = twCR:set tw=78CRgqap:let tw=old_twCR that seems to work, but only if in normal mode. Is it possible to detect the current mode and if in INSERT then still work and return in INSERT mode? I'm finding with vim as my mail editor I jump in and out of insert mode for things that are kind of basic. I miss from Nano: Control-A/Contrl-E for ^ and $ Control-J to justify Control-W to toggle wrap mode (which would be toggle paste mode in Vim) Control-K to kill a link. And maybe Control-U to undo Thanks, -- Bill Moseley [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Tue, 30 Sep 2003 14:13:58 -0700, Bill Moseley [EMAIL PROTECTED] penned: On Tue, Sep 30, 2003 at 02:58:53PM +, Monique Y. Herman wrote: On Mon, 29 Sep 2003 22:51:35 -0700, Bill Moseley [EMAIL PROTECTED] penned: I just created the following last night. ctrl-j aligns the paragraph to 78 chars; ctrl-k makes it flow; use ':let my_tw=x' before ctrl-L to align it to some arbitrary number. Ctrl-J/K formats the current paragraph gggqG would do the whole file map C-J :let old_tw = twCR:set tw=78CRgqap:let tw=old_twCR that seems to work, but only if in normal mode. Is it possible to detect the current mode and if in INSERT then still work and return in INSERT mode? I'm afraid I don't know. I've been using vim long enough that I hit 'escape' reflexively all the time ... including in web forms, which does *not* have desirable results. -- monique -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Mutt + Vim tricks (replace Nano)
On Sat, Sep 27, 2003 at 06:48:22AM -0700, [EMAIL PROTECTED] wrote: | I'm looking for a little quick-start help with Vim (in converting from | Nano). | | Can someone share their vim setup used with email? The features I care | about In my .vimrc I have the following mail-specific settings: augroup Mail au! au FileType mail set tw=70 fo=tcrq2 nomodeline au FileType mail set comments+=n:\| clear the old sig and go back to the beginning of the buffer au BufRead /tmp/mutt* normal :g/^| -- $/,/^$/-1d gg augroup END (note that between the 'd' and the 'gg' on the last line is a literal carriage return) (also note that the | at the start of the pattern is the same as my $indent_string in mutt's configuration, if you use a different $indent_string then adjust the pattern accordingly)) I'll skip over the other specific requests that have already been answered. | - indent pasted text I suppose by this you want to paste a section of text, then have it all indented as is often done when quoting an external source. What I do here is :set paste so the pasted text is unaltered (with auto indenting and such) and paste the text in. Then I select the entire section in visual mode (press v to enter visual mode, then move the cursor to the end of the section you want selected). Then pressing while the section is selected will indent it by one $shiftwidth. (for options controlling the amount of indent, read the help on shiftwidth, softtabstop and expandtab) -D -- He who walks with the wise grows wise, but a companion of fools suffers harm. Proverbs 13:20 http://dman13.dyndns.org/~dman/ pgp0.pgp Description: PGP signature
Re: Mutt + Vim tricks (replace Nano)
* Steve Lamb ([EMAIL PROTECTED]) [030927 12:49]: On Sat, 27 Sep 2003 06:48:22 -0700 [EMAIL PROTECTED] wrote: - Justify text and respect any quote marks. ^J in Nano. operates on a paragraph (command gq}, but mapped to ^J) First off, make sure you're in mail mode. That'll let vim know what format to expect. gq will to go the end of the current paragraph which is defined by a clean line. So in a message that is just quoted it will reformat until the end of the quotes. Deleting the quote on black lines will get the desired result. - Unjustify (which is just undo in vim, I suppose) Erm, unjustify? Example? - Paste in text with options: - wrap/no wrap (sometimes pasting URLs or code that should not wrap) ':set nowrap' before pasting. Or use :set paste . This sets (/unsets) a bunch of options, including disabling mappings and abbreviations, so that text that's entered is entered unadulterated (since pasting, e.g. in an xterm, is really just like keyboard input from vim's POV). Paste it in, then use :set nopaste when you're done. If you find yourself doing this often, you can bind those commands to F-keys (or any other keys) or bind pastetoggle to a key (I guess the modality of such a key wouldn't bother you since you are using vim after all!) - indent pasted text Example? ':set ai' would work I supposed. I never did like ai when pasting text, though. You could also paste and then use the V mark along with to indent a block. - paste in with quote marks. Not sure on that one. Though you could paste, select with V and then :s/\(.*\)/ \1/g :s/^/ / is shorter and faster =) - Spell a selected word or paragraph (although I can spell from Mutt, too) vimspell. Check the vim script repository at http://www.vim.org/ Sounds cool; I'll look that up. Plus, I'm looking for those features you feel you can't live without when working with email. Basically, additional tips for getting the most from Vim as my email editor. Mail mode with syntax highlighting turned on and vimspell are all that I need. My needs seem to vary as I rarely, if ever, paste quoted material into the body of the message or paste material that needs to be indented. Agreed. I haven't used vimspell (yet?) but mail mode with syntax highlighting takes care of me. One of the things that impressed me early on was the ability to use gq on quoted text and vim smartly re-wraps and re-places the s, which takes care of things when other people forget to wrap at a decent column. I also use this in my ~/.vim/ftplugin/mail.vim: source $VIMRUNTIME/ftplugin/mail.vim :/^$ :+ This starts me on the line after the first blank line, which is the first line of the body (I have edit_headers set in mutt). You'll find various vimrc bits like this (for example, auto-trimming away other people's signatures when quoting) in the archives of both debian-user and the vim-users lists. good times, Vineet -- http://www.doorstop.net/ -- http://www.doorstop.net/sprintpcs_sucks pgp0.pgp Description: PGP signature
Re: Mutt + Vim tricks (replace Nano)
On Sat, 27 Sep 2003 06:48:22 -0700 [EMAIL PROTECTED] wrote: - Justify text and respect any quote marks. ^J in Nano. operates on a paragraph (command gq}, but mapped to ^J) First off, make sure you're in mail mode. That'll let vim know what format to expect. gq will to go the end of the current paragraph which is defined by a clean line. So in a message that is just quoted it will reformat until the end of the quotes. Deleting the quote on black lines will get the desired result. - Unjustify (which is just undo in vim, I suppose) Erm, unjustify? Example? - Paste in text with options: - wrap/no wrap (sometimes pasting URLs or code that should not wrap) ':set nowrap' before pasting. - indent pasted text Example? ':set ai' would work I supposed. I never did like ai when pasting text, though. You could also paste and then use the V mark along with to indent a block. - paste in with quote marks. Not sure on that one. Though you could paste, select with V and then :s/\(.*\)/ \1/g - Spell a selected word or paragraph (although I can spell from Mutt, too) vimspell. Check the vim script repository at http://www.vim.org/ Plus, I'm looking for those features you feel you can't live without when working with email. Basically, additional tips for getting the most from Vim as my email editor. Mail mode with syntax highlighting turned on and vimspell are all that I need. My needs seem to vary as I rarely, if ever, paste quoted material into the body of the message or paste material that needs to be indented. -- Steve C. Lamb | I'm your priest, I'm your shrink, I'm your PGP Key: 8B6E99C5 | main connection to the switchboard of souls. ---+- pgp0.pgp Description: PGP signature
Re: Mutt + Vim tricks (replace Nano)
Also Sprach Steve Lamb On Sat, 27 Sep 2003 06:48:22 -0700 [EMAIL PROTECTED] wrote: - Justify text and respect any quote marks. ^J in Nano. operates on a paragraph (command gq}, but mapped to ^J) First off, make sure you're in mail mode. That'll let vim know what format to expect. set comments=n:,n:\| - Paste in text with options: - wrap/no wrap (sometimes pasting URLs or code that should not wrap) ':set nowrap' before pasting. I usually just let it wrap then use J to join lines. - indent pasted text set autoindent Then I usually will paste the text, then manual indent the first line then rejustify the text. - paste in with quote marks. Not sure on that one. Though you could paste, select with V and then :s/\(.*\)/ \1/g set comments as above gets you most of the way there. Plus, I'm looking for those features you feel you can't live without when working with email. Basically, additional tips for getting the most from Vim as my email editor. Mail mode with syntax highlighting turned on and vimspell are all that I need. My needs seem to vary as I rarely, if ever, paste quoted material into the body of the message or paste material that needs to be indented. syntax highlighting is great, syntax on turns it on. I typically wrap it like: if t_Co 2 || has(gui_running) syntax on endif This turns syntax highlighting on only if the terminal supports more than 2 colors, or if its running the gui version (ie, gvim) -- Jeff McAdams He who laughs last, thinks slowest. -- anonymous pgp0.pgp Description: PGP signature