initial checkin
[grml-etc-core.git] / etc / vim / vimrc
1 " Filename:      /etc/vim/vimrc
2 " Purpose:       configuration file for vim
3 " Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
4 " Bug-Reports:   see http://grml.org/bugs/
5 " License:       This file is licensed under the GPL v2.
6 " Latest change: Son Mai 28 01:26:49 CEST 2006 [mika]
7 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
8
9 " All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
10 " /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime you
11 " can find below.  If you wish to change any of those settings, you should do it
12 " in the file /etc/vim/vimrc.local, since debian.vim will be overwritten
13 " everytime an upgrade of the vim packages is performed and this file
14 " (/etc/vim/vimrc) every time the package grml-etc is upgraded.  It is
15 " recommended to make changes after sourcing debian.vim since it alters the
16 " value of the 'compatible' option.
17
18 " This line should not be removed as it ensures that various options are
19 " properly set to work with the Vim-related packages available in Debian.
20 runtime! debian.vim
21
22 " Uncomment the next line to make Vim more Vi-compatible
23 " NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous
24 " options, so any other options should be set AFTER setting 'compatible'.
25 "set compatible
26
27 set backspace=indent,eol,start  " more powerful backspacing
28
29 " Now we set some defaults for the editor
30 set autoindent          " always set autoindenting on
31 " set linebreak         " Don't wrap words by default
32 set textwidth=0         " Don't wrap lines by default
33 set nobackup            " Don't keep a backup file
34 set backupcopy=no       " grml: Overwrite files/links with w!
35 " set backupcopy=yes    " Keep a backup file
36 set viminfo='20,\"50    " read/write a .viminfo file, don't store more than
37                         " 50 lines of registers
38 set history=50          " keep 50 lines of command line history
39 set ruler               " show the cursor position all the time
40
41 " Suffixes that get lower priority when doing tab completion for filenames.
42 " These are files we are not likely to want to edit or read.
43 set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
44
45 " Make p in Visual mode replace the selected text with the "" register.
46 vnoremap p <Esc>:let current_reg = @"<CR>gvdi<C-R>=current_reg<CR><Esc>
47
48 " Vim5 and later versions support syntax highlighting. Uncommenting the next
49 " line enables syntax highlighting by default.
50 syntax on
51
52 " Debian uses compressed helpfiles. We must inform vim that the main
53 " helpfiles is compressed. Other helpfiles are stated in the tags-file.
54 " set helpfile=$VIMRUNTIME/doc/help.txt.gz
55
56 " If using a dark background within the editing area and syntax highlighting
57 " turn on this option as well
58 set background=dark
59
60 " begin of grml specials:
61 "  set list listchars=tab:»·
62 "  set listchars=eol:$,precedes:«,extends:»,tab:··,trail:·
63 " end of grml specials
64
65 " Uncomment the following to have Vim jump to the last position when
66 " reopening a file
67 "if has("autocmd")
68 "  au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
69 "    \| exe "normal g'\"" | endif
70 "endif
71
72 " Uncomment the following to have Vim load indentation rules according to the
73 " detected filetype. Per default Debian Vim only load filetype specific
74 " plugins.
75 "if has("autocmd")
76 "  filetype indent on
77 "endif
78
79 " The following are commented out as they cause vim to behave a lot
80 " differently from regular Vi. They are highly recommended though.
81   set showcmd           " Show (partial) command in status line.
82   set showmatch         " Show matching brackets.
83 "set ignorecase         " Do case insensitive matching
84 "set smartcase          " Do smart case matching
85 "set incsearch          " Incremental search
86 "set autowrite          " Automatically save before commands like :next and :make
87 " When switching between different buffers you can't use undo without 'set hidden':
88  set hidden             " Hide buffers when they are abandoned
89 "set mouse=a            " Enable mouse usage (all modes) in terminals
90
91 " Source a global configuration file if available
92 " XXX Deprecated by Debian but as grml's package grml-etc provides this file
93 " it is still valid
94 if filereadable("/etc/vim/vimrc.local")
95   source /etc/vim/vimrc.local
96 endif
97 " EOF