Short Tip: Simple .vimrc lines

shell.png
Once in a while there is the need for vim on machines which are usually under control of someone else. In such cases it is handy to have the most important lines for vimrc right at the hand:


set laststatus=2        " grey status bar at the bottom
syn on                  " syntax highlighting
filetype indent on      " activates indenting for files
set ai                  " auto indenting
set nu                  " line numbers
set ic                  " case insensitive search
colorscheme desert      " colorscheme desert

Once again, the idea of these short lines is to have the basic functionality in vim – if there is the time to set up a properly vimrc with tens of lines, I could also copy mine over. But if you just need to do some quick things these lines are useful.

If anyone has other really helpful lines please leave a comment (and explain the lines with a few words, just as above) – but in case such “helpful” lines take more than one line it s already too much. For postinbg source code in the comment section, please read How do I post source code?.

7 Responses to “Short Tip: Simple .vimrc lines”

  1. Constantin Says:

    :set scs “smartcase: Ignore case only if search string has no Uppercase chars.
    :set bg=dark “works well with white-on-black scheme

  2. Peter Palm Says:
    
    set hlsearch " highlight what you search for
    set incsearch " type-ahead-find
    
  3. fengshaun Says:

    set smartindent
    set shiftwidth=4
    set tabstop=4
    :set guifont=monospace\ 10

  4. Anonymous Says:

    Last [sourcecode] tag should be changed to [slash sourcecode].

    Thanx for the info dude.

  5. liquidat Says:

    Of course, thanks.

    And also thanks for the other comments, I especially like the smartcase and incsearch settings.

  6. Peter Palm Says:

    nvi supports incsearch as well, so in case you ever need to edit a file on a machine without vim (god forbid), you can put the following in your .exrc:

    
    set searchincr
    
  7. liquidat Says:

    Guys, you could have told me that the title was originally “Short ti*m*p”! :D


Comments are closed.