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