set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" Brilliant Plugins by tpope =========================.
Plugin 'tpope/vim-sensible'                           | " a sane and modern default configuration
Plugin 'tpope/vim-fugitive'                           | " the most complete GIT integration plugin
Plugin 'tpope/vim-surround'                           | " plugin makes cs"' inside a line replace " with '
Plugin 'tpope/vim-repeat'                             | " lets . (dot) repeat plugin macros as well, specifically vim-surround
Plugin 'tpope/vim-vinegar'                            | " Improves :Explore
Plugin 'tpope/vim-characterize'                       | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values)

" Colorschemes =======================================.
Plugin 'tpope/vim-vividchalk'                         | " dark theme
Plugin 'nelstrom/vim-mac-classic-theme'               | " light theme

" AIRLINE ============================================.
Plugin 'vim-airline/vim-airline'                      | " beautification of the mode line
Plugin 'vim-airline/vim-airline-themes'               | " airline themes to match any light and dark terminal using :AirlineTheme
let g:airline_powerline_fonts                 = 1     | "
let g:airline_inactive_collapse               = 1     | "
let g:airline#extensions#tabline#enabled      = 1     | "
let g:airline#extensions#tabline#show_buffers = 1     | "
let g:airline#extensions#tabline#show_tabs    = 1     | "
let g:airline#extensions#tabline#fnamemod     = ':t'  | " let airline just show the filename without its path
let g:airline_theme='papercolor'                      | " specifies which colorscheme should airline uses


" Additional =========================================.
Plugin 'taglist-plus'                                 | " quick code navigator

Plugin 'sheerun/vim-polyglot'                         | " better syntax highlighting/indentation for multiple languages
Plugin 'gregsexton/matchtag'                          | " highlights closing ML tags like braces
Plugin 'loremipsum'                                   | " Sample text generator
" Plugin 'davidhalter/jedi-vim'                         | " best autocompletion for python
Plugin 'klen/python-mode'
Plugin 'tweekmonster/django-plus.vim'                 | " django helper


" Autocompleter ======================================.
Plugin 'Shougo/vimproc.vim'                           | " dependency for other Shougo plugins
Plugin 'Shougo/neocomplete.vim'
Plugin 'Shougo/neosnippet-snippets'
Plugin 'Rip-Rip/clang_complete'

filetype plugin on
set omnifunc=syntaxcomplete#Complete
inoremap <C-Space> <C-x><C-o>
inoremap <C-@> <C-Space>

" keep selection when indenting a selected block:
vnoremap < <gv
vnoremap > >gv


nnoremap <C-Tab> :bn<CR>|         " lets one use CTRL+Tab to switch between tabs
nnoremap <C-S-Tab> :bp<CR>|       " use CTRL+Shift+Tab to switch to preview tab

nnoremap <C-l> :TlistToggle<CR>|  " bind TagList to Hotkey Ctrl+L

" Disabled ===========================================.
"# Plugin 'indenthtml.vim'                               | " works better with mixed html/css/javascript
"# Plugin 'evanmiller/nginx-vim-syntax'

" All of your Plugins must be added before the following line
call vundle#end()             | " required
filetype plugin indent on     | " required
" colorscheme mac_classic       | " finally set which colorscheme to use
" colorscheme vividchalk       | " finally set which colorscheme to use
colorscheme mac_classic

" set term=xtermc             | " required on solaris
set t_Co=256                  | " required on some ssh sessions


syntax on                     | " enable syntax highlighting
set hidden                    | " allow switiching buffers even if the current buffer contains changes (displays +)
set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth)
set encoding=utf-8            | " set up vim's cosole encoding (not file encoding, for which there is fileencoding=)
set ignorecase smartcase      | " search with ignorecase by default, but use case sensitive search when one captical char is contained
set ttimeoutlen=10            | " set esc key timeout in ms-
set linebreak                 | " wrap long lines at char 'breakat', not inside words
set clipboard=unnamedplus     | " makes copy and paste work (autoselectplus might work as well)
set number                    | " toggle line numbers
set relativenumber            | " displays current lines line no as zero point from where relative numbers are getting counted
set list                      | " shows unprinable characters in the current line
set nofoldenable              | " disable code folding. I hate code folding

set spell spelllang=en,de     | " enable spell checker
set splitbelow                | " open new windows below the current one (i find that more intuitive)
set colorcolumn=80            | " show an indicator (different background in column 80)
highlight ColorColumn guibg=#F0F0E0

if (&t_Co > 2)                | " running in a terminal with colorterm support? (here: always true, defined above)
  set hlsearch                | " highlight all search matches
  set cursorline              | " highlight currently selected line
endif

if has("gui_running")
  set guioptions+=eig
  set guioptions-=T           | " toolbar
  set guioptions+=c           | " use console dialogs instead of popups
  set guioptions+=a           | " autoselect: copy&paste using middleclick
endif


if has("autocmd")
  set modeline                | " set variables specific to a file, like indentation by adding a comment
  " automatically reload this file when it gets edited
  autocmd BufWritePost $MYVIMRC source $MYVIMRC
  " automatically remove trailing white spaces on save..
  autocmd BufWritePre * %s/\s\+$//e
  " au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main
  " Enable omni completion.
  " autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
  autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
  autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
endif

let &titlestring = hostname() . "[vim(" . expand("%:t") . ")]"
" set window title for screen(3)
if &term == "screen"
  set t_ts=k
  set t_fs=\
endif
if &term == "screen" || &term == "xterm"
  set title
endif


if has("multi_byte")
  set encoding=utf-8          | " we need default utf-8 encoding to use cool chars as line break and so on (see below)
  scriptencoding utf-8        | " tell vim that we are using utf-8 here
  set showbreak+=›            | " symbol used in the beginning of a wrapped line
  set listchars=eol:↲         | " symbols used when using :set list (which displays non-printable chars)
  set listchars+=trail:·      | " symbols used when using :set list (which displays non-printable chars)
  set listchars+=precedes:«   | " symbols used when using :set list (which displays non-printable chars)
  set listchars+=extends:»    | " symbols used when using :set list (which displays non-printable chars)
  set listchars+=tab:▸\       | " symbols used when using :set list (which displays non-printable chars)
endif



" set title
" set t_ts=^[k
" set t_fs=^[\
" auto BufEnter * :set title | let &titlestring = 'v:' . expand('%')
" auto VimLeave * :set t_ts=^[k^[\
" To ignore plugin indent changes, instead use:
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"