[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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,

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 waaaay 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> <ESC>dd

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>
	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 <olly@lfix.co.uk>
how, in Vim: control-k u "  (control-K, then 'U', then '"').
Simple! To see all of vim's currently-defined digraphs, try

Also see http://newbieDoc.sourceForge.net/ ...

Reply to: