/etc/vim/vimrc: syntax on fix; update in debian/preinst
[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: Fre Feb 09 14:32:09 CET 2007 [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', but only if debian.vim is available,
24 " so let's make sure we run in nocompatible mode:
25 set nocompatible
26 " Setting 'compatible' changes numerous
27 " options, so any other options should be set AFTER setting 'compatible'.
28 "set compatible
29
30 set backspace=indent,eol,start  " more powerful backspacing
31
32 " Now we set some defaults for the editor
33 set autoindent          " always set autoindenting on
34 " set linebreak         " Don't wrap words by default
35 set textwidth=0         " Don't wrap lines by default
36 set nobackup            " Don't keep a backup file
37 set backupcopy=no       " grml: Overwrite files/links with w!
38 " set backupcopy=yes    " Keep a backup file
39 set viminfo='20,\"50    " read/write a .viminfo file, don't store more than
40                         " 50 lines of registers
41 set history=50          " keep 50 lines of command line history
42 set ruler               " show the cursor position all the time
43
44 " Suffixes that get lower priority when doing tab completion for filenames.
45 " These are files we are not likely to want to edit or read.
46 set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
47
48 " Make p in Visual mode replace the selected text with the "" register.
49 vnoremap p <Esc>:let current_reg = @"<CR>gvdi<C-R>=current_reg<CR><Esc>
50
51 " Vim5 and later versions support syntax highlighting.
52 " Just load the main syntax file when Vim was compiled with "+syntax".
53   if has("syntax")
54      syntax on
55   fi
56
57 " Debian uses compressed helpfiles. We must inform vim that the main
58 " helpfiles is compressed. Other helpfiles are stated in the tags-file.
59 " set helpfile=$VIMRUNTIME/doc/help.txt.gz
60
61 " If using a dark background within the editing area and syntax highlighting
62 " turn on this option as well
63 set background=dark
64
65 " begin of grml specials:
66 "  set list listchars=tab:»·
67 "  set listchars=eol:$,precedes:«,extends:»,tab:··,trail:·
68 " end of grml specials
69
70 " Uncomment the following to have Vim jump to the last position when
71 " reopening a file
72 "if has("autocmd")
73 "  au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
74 "    \| exe "normal g'\"" | endif
75 "endif
76
77 " Uncomment the following to have Vim load indentation rules according to the
78 " detected filetype. Per default Debian Vim only load filetype specific
79 " plugins.
80 "if has("autocmd")
81 "  filetype indent on
82 "endif
83
84 " The following are commented out as they cause vim to behave a lot
85 " differently from regular Vi. They are highly recommended though.
86   set showcmd           " Show (partial) command in status line.
87   set showmatch         " Show matching brackets.
88 "set ignorecase         " Do case insensitive matching
89 "set smartcase          " Do smart case matching
90 "set incsearch          " Incremental search
91 "set autowrite          " Automatically save before commands like :next and :make
92 " When switching between different buffers you can't use undo without 'set hidden':
93  set hidden             " Hide buffers when they are abandoned
94 "set mouse=a            " Enable mouse usage (all modes) in terminals
95
96 " Source a global configuration file if available
97 " XXX Deprecated by Debian but as grml's package grml-etc provides this file
98 " it is still valid
99 if filereadable("/etc/vim/vimrc.local")
100   source /etc/vim/vimrc.local
101 endif
102 " EOF