[vox-tech] missing vim

Michael Wenk vox-tech@lists.lugod.org
Mon, 12 May 2003 20:13:04 -0700


On Monday 12 May 2003 05:07 pm, Jonathan McPherson wrote:
> All,
>
> I've read countless stories on the Internet about people switching from
> vi (or vim) to emacs, but curiously few in the other direction. I use
> vim quite extensively but am considering switching to emacs for some
> heavier text editing tasks (LaTeX, Python, C/C++, etc).
>
> However, emacs feels very awkward to me because I'm used to being able
> to get around very quickly in vim.
>
> Can anyone tell me how to do the following things with emacs?
>
> (1) Insert a string at the end of each line. For instance:
>     x = 1         x = 1;
>     y = 42     -> y = 42;
>     z = "bob"     z = "bob";
>
>     In vim, I can do the above with <C-V>jj$A;

assume M is meta key(escape for me, YMMV) 

M-x query-replace-regexp 
Enter your regexp, for example $ 
then your replace strings "crap" 
then either hit y at each line, or hit ! to do then all. 

>
> (2) Insert a string at the beginning of each line.

Same, just use ^ as the regexp.  :) 

> (3) Move the cursor by screen lines instead of virtual lines. I
>     primarily want this because LaTeX paragraphs can get quite long, and
>     if I want to access text in the middle of the paragraph, it is
>     easier to spot the text and move to it than to guess with
>     word/sentence movement commands. In vim: g<movement command>

Hmm, I use M g to goto particular lines. Not sure about how to do this. 

> (4) Allow the cursor to stray all the way to the end of each line on the
>     screen regardless of how much text is actually on the line. (This is
>     much more useful than it sounds.) In vim: set ve=all

ctrl e goes to end of line.  

> (5) Display line numbers next to each line. In vim: set nu
>
> (6) Send the cursor to the top, middle, or bottom of the screen. In vim:
>     H, M, L
>
> (7) Folding -- automatically collapse sections of the code based on some
>     criteria. In vim: set fdm=indent
>
> (8) Out of curiousity, do most people experienced with emacs use
>     ^N/^P/^B/^F or just the arrow keys?

It depends... I used to use emacs primarily.  I went from emacs to using 
either vi or ed.  Now I don't use emacs much(if at all),  You could always 
enable vim mode(viper?)  I did that once, but what really started getting me 
about emacs vs vi was two things.  It was difficult to force emacs to use 
tabs for indents, and emacs required being run from a particular termtype.  I 
couldn't just waltz in the machine room and on a vt320 and run it well.  
Also, if termcaps or terminfos get messed or confused, it can be odd.  Ive 
also noticed that ed works well in these cases.  

Mike


-- 
wenk@praxis.homedns.org
Mike Wenk