-" DiffOrig {{{
-" Convenient command to see the difference between the current buffer and the
-" file it was loaded from, thus the changes you made.
-" Only define it when not defined already.
-if !exists(":DiffOrig")
-  command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
-                  \ | wincmd p | diffthis
+" syntax, highlighting and spelling {{{1
+set background=dark             " Dark background, d'uh!
+syntax on
+
+set spelllang=en,de,fr          " list of accepted languages
+set dictionary=spell            " list of dictionary files for keyword completion
+" toggle spell-checking
+map <silent><F10> :set nospell!<CR>:set nospell?<CR>
+
+if has("autocmd")
+    au Filetype *
+        \ if &omnifunc == "" | setl omnifunc=syntaxcomplete#Complete | endif
+endif
+
+" multiple windows {{{1
+set laststatus=2                " 0, 1 or 2; when to use a status line for the last window
+
+set previewheight=20            " default height for the preview window
+
+set splitright                  " a new window is put right of the current one
+
+nmap <C-J> <C-W>j
+nmap <C-K> <C-W>k
+nmap <C-H> <C-W>h
+nmap <C-L> <C-W>l
+
+map <F1> :ls<CR>:b<space>
+
+" using the mouse {{{1
+set mouse=rnv                   " list of flags for using the mouse
+set ttymouse=xterm              " type of mouse
+
+"xterm mouse with middleclick paste
+nnoremap <MiddleMouse> i<MiddleMouse>
+vnoremap <MiddleMouse> s<MiddleMouse>
+
+" messages and info {{{1
+set showcmd                     " Show (partial) command in status line.
+set ruler                       " show the cursor position all the time
+set confirm                     " Ask what to do when closing unsaved documents
+
+" editing text {{{1
+set backspace=indent,eol,start  " allow backspacing over everything in insert mode
+
+set showmatch                   " Show matching brackets.
+
+set nojoinspaces                " don't use two spaces after '.' when joining a line
+set formatoptions+=j            " remove comment leader when joining lines
+
+set nrformats=hex               " number formats recognized for CTRL-A and CTRL-X commands
+
+" whether to use a popup menu for Insert mode completion
+set completeopt=longest,menuone,preview
+
+" Indent if we're at the beginning of a line. Else, do completion.
+function! InsertTabWrapper()
+  let col = col('.') - 1
+  if !col || getline('.')[col - 1] !~ '\k'
+    return "\<Tab>"
+  else
+    return "\<C-N>"