l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
April 21: Google Glass
Next Installfest:
Latest News:
Mar. 18: Google Glass at LUGOD's April meeting
Page last updated:
2001 Dec 30 17:09

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] VIM
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] VIM

On Tue, 25 Sep 2001, Jay Strauss wrote:

> then it takes 3-4 seconds to start.  I don't think this is normal, but oh
> well (if someone has an idea why it's taking a long time, please suggest).

I ran VIM under HP/UX back when I was still at UC Davis.  It took 3-4
seconds to start, too.  I figured it's because the systems are too slow.

> My question is, you guys say great stuff about using vim to edit perl, html,
> xml...but I don't know where to start.

I find the following very useful:

   1. Go to your home directory by typing "cd"
   2. Run VIM and type:


      which creates a file called ".vimrc" in your home directory.  This
      is the file you can edit to set up your Vim defaults.

   3. Edit ".vimrc" by exitting Vim and typing "vim .vimrc".
   4. Add the following lines at the bottom:

         syntax on
         set nocompatible
            (This enables advanced features)
         set tabstop=3
            (I like tabstops to be 3)
         set noexpandtab
            (or "set expandtab", if you want tabs to expand to spaces)
         set ignorecase
            (or "set noignorecase", if you want searches to be case-sensitive)
         set nowrap
            (or "set wrap", if you like lines to wrap)
         set nobackup
            (or "set backup", if you like automatically created backup files)
         set ruler
            (Shows row & column all the time)
         set incsearch
            (Incremental search as you type what you're searching for)
         highlight normal guifg=white guibg=black
            (sets gvim to have white-text-on-black-background)
         set background=dark
            (helps syntax highlighting in choosing nice-contrast colors
            since I use dark backgrounds.)
         syntax on
            (Turns on syntax highlighting using the above as a reference
         set visualbell
            (Turns off the annoying noise and turns on flashing screen on
         set t_vb=
            (Makes the flashing screen to not do anything.  With the "set 
            visualbell" option, this effectively gets rid of any noises
            or flashes when you do something bad)

That's what I like to do... I think I'm missing a few things but you get
the idea.

> I need to get some sort of syntax file(s) (I think) that defines the syntax
> checking, where do I get it, how do I use it?

It should be already installed with the standard runtime files.  If not,
HP/UX probably gutted them out.  You can get the original runtime files
from ftp://ftp.vim.org/.  A close mirror is right there in UCD at
ftp://nuxi.ucdavis.edu/.  The files that ends in "rt" (ie -
"vim57rt.tar.gz", where 57 means version 5.7) are the runtime files.

> Can I display colors if I doing vim from the command line (from an xterm)?

Under color xterm, you can, though you don't get as many colors as you do
under gvim (graphical version of vim that runs under X Window).  However,
HP/UX has a very peculiar way of handling colors so I've never had very
good luck with it.  I did have a color xterm at one point but the resizing
didn't work well and you had to signal xterm that the resizing occurred.  
It's a very painful process.  I'll help you complain to HP, if you'd
like :)

> Lastly when I start vim, I type <esc>:h and get the help screen.  It splits
> the screen, but what key sequence(s) do I use to control the split screens
> (i.e. close one, open one, dictate where to split, move the split...)?  I'm
> trying to read the help but I only get a couple of lines at a time.

When you type ":h", the first thing the help tells you is how to navigate:

   h, j, k, l or the arrow keys to move around
   Ctrl-] to go to a topic
   Ctrl-t to to back

If you have questions about syntax highlighting, type:

   :help syntax

If you have questions about split screens, type:

   :help split


BTW, to control split screens:

   Ctrl-w, j  -  Move one window down
   Ctrl-w, k  -  Move one window up
   Ctrl-w, +  -  Make the window bigger by one line.  Precede by a number
                 to make it bigger by several lines.
   Ctrl-w, -  -  Make the window smaller by one line.  Precede by a number
                 to make it smaller by several lines.
   :split     -  Spawn a new split window.
   :e <filename> - Open <filename> in the current window.


PS: "gvim" has menus with shortcut keys next to the menu item.

Mark K. Kim
PGP key available upon request.

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!