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:
2004 Jun 08 16:38

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] serendipity with vim
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] serendipity with vim

Karsten M. Self wrote:
> on Fri, Apr 02, 2004 at 06:16:21AM -0800, Peter Jay Salzman (p@dirac.org) wrote:
> > heh.  at 6:15 in the morning, it blew my mind.  it took a few seconds to
> > register what was going on.
> > 
> > if anybody has any vim tips they'd like to share, i'd love to see a
> > thread of people's favorite vim tricks.
> > 
> > here's another one i learned just recently:
> > 
> > 
> > 1 one
> > 2 two
> > 3 three
> > 4 four
> > 5 five
> > 6 six
> > 7 seven
> > 8 eight
> > 9 nine
> > 
> > use line highlighting (shift v) and highlight lines 4, 5, and 6.
> > type "zf".
> > you've now "folded" lines 2, 3, 4, 5, and 6:
> > 
> > 1 one
> > +--  5 lines: 2----------------------------------------------------
> > 7 seven
> > 8 eight
> > 9 nine
> You'll discover split screens RSN I suppose.

I use both frequently. :) I like folding for zooming around in a file
(z+<motion command> is nice) and just generally keeping my screen tidy.
Splitting screens is obviously best for viewing multiple files or two
parts of a file at the same time.

Here are three other things I have started using lately:

1. I use / and ? extensively for moving around (this is with incsearch
on). This even works for yanking, deleting, or selecting visual regions.
For instance, if I wanted to yank "This even works" from the last
sentence, I would put the cursor on "T", then type y/f<CR>. You can just
keep typing "for yan..." until it matches the right spot. 

2. lmappings. These are mappings that apply for insert mode, text input
after /,?,r, or basically any time you are editing a buffer or talking
about the stuff inside one. While using lmap directly doesn't seem to
work for me (?), keymap files use them somehow. By making my own keymap
file, I think I've found the best way to use Dvorak with vim. Typing
commands in Dvorak is a royal pain, since vim was designed for
qwerty-efficiency (even if qwerty wasn't)[1], and this lets me do
commands in qwerty and typing in Dvorak. 

3. ~.vim/after/syntax/ directory. I wasn't having any fun figuring out
how to customize syntax highlighting and formatting until I found out
that everything in this directory (e.g. ~.vim/after/syntax/c.vim) is
autmatically loaded _after_ the $VIMRUNTIME/* scripts are all run. Yay,
now I have custom foldtext, highlighting, colors, etc.

Tips 4-736: http://www.vim.org/tips/index.php   :-D


[1] I'm not invoking superiority here- I think some people have actually
shown qwerty isn't necessarily that much slower than Dvorak. I just like
the Dvorak idea better. :)

Attachment: signature.asc
Description: Digital signature

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:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.