l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2003 May 13 10:22

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] missing vim
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] missing vim

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
vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!