/etc/vim/vimrc: set nocompatible even though it is set via
[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 Nov 19 15:26:34 CET 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', 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. Uncommenting the next
52 " line enables syntax highlighting by default.
53 syntax on
54
55 " Debian uses compressed helpfiles. We must inform vim that the main
56 " helpfiles is compressed. Other helpfiles are stated in the tags-file.
57 " set helpfile=$VIMRUNTIME/doc/help.txt.gz
58
59 " If using a dark background within the editing area and syntax highlighting
60 " turn on this option as well
61 set background=dark
62
63 " begin of grml specials:
64 "  set list listchars=tab:»·
65 "  set listchars=eol:$,precedes:«,extends:»,tab:··,trail:·
66 " end of grml specials
67
68 " Uncomment the following to have Vim jump to the last position when
69 " reopening a file
70 "if has("autocmd")
71 "  au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
72 "    \| exe "normal g'\"" | endif
73 "endif
74
75 " Uncomment the following to have Vim load indentation rules according to the
76 " detected filetype. Per default Debian Vim only load filetype specific
77 " plugins.
78 "if has("autocmd")
79 "  filetype indent on
80 "endif
81
82 " The following are commented out as they cause vim to behave a lot
83 " differently from regular Vi. They are highly recommended though.
84   set showcmd           " Show (partial) command in status line.
85   set showmatch         " Show matching brackets.
86 "set ignorecase         " Do case insensitive matching
87 "set smartcase          " Do smart case matching
88 "set incsearch          " Incremental search
89 "set autowrite          " Automatically save before commands like :next and :make
90 " When switching between different buffers you can't use undo without 'set hidden':
91  set hidden             " Hide buffers when they are abandoned
92 "set mouse=a            " Enable mouse usage (all modes) in terminals
93
94 " Source a global configuration file if available
95 " XXX Deprecated by Debian but as grml's package grml-etc provides this file
96 " it is still valid
97 if filereadable("/etc/vim/vimrc.local")
98   source /etc/vim/vimrc.local
99 endif
100 " EOF