set nocompatible " be iMproved
filetype on " required!
filetype plugin on
" Make backspace behave in a sane manner.
set backspace=indent,eol,start
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" Switch syntax highlighting on
syntax on
" Set to auto read when a file is changed from the outside
set autoread
let mapleader = ","
" in normal mode F3 will save the file
nmap <F3> :w<CR>
" in insert mode F3 will exit insert, save, enters insert again
imap <F3> <ESC>:w<CR>i
" Enable file type detection and do language-dependent indenting.
filetype plugin indent on
map <F2> :NERDTreeToggle<CR>
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" Be smart when using tabs ;)
set smarttab
set number
set tabstop=2
set shiftwidth=2
set expandtab
""""""""""""""""""""""""""""""
" => Visual mode related
""""""""""""""""""""""""""""""
" Visual mode pressing * or # searches for the current selection
" Super useful! From an idea by Michael Naumann
vnoremap <silent> * :call VisualSelection('f')<CR>
vnoremap <silent> # :call VisualSelection('b')<CR>
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
Bundle 'scrooloose/nerdtree'
Bundle 'ervandew/supertab'
Bundle 'Raimondi/delimitMate'
" Bundle 'msanders/snipmate.vim'
" Bundle 'xuhdev/SingleCompile'
Bundle 'Valloric/YouCompleteMe'
Bundle 'mhinz/vim-startify'
Bundle 'SirVer/ultisnips'
Bundle 'honza/vim-snippets'
" Bundle 'Rip-Rip/clang_complete'
"nmap <F9> :SCCompile<cr>
"nmap <F10> :SCCompileRun<cr>
colors molokai
set t_Co=256
let g:Powerline_symbols = 'fancy'
set laststatus=2
set noshowmode
if has('gui_running')
set guifont=Terminus
endif
" YouCompleteMe and UltiSnips compatibility, with the helper of supertab
" (via http://stackoverflow.com/a/22253548/1626737)
let g:SuperTabDefaultCompletionType = '<C-n>'
let g:UltiSnipsExpandTrigger = '<tab>'
let g:UltiSnipsJumpForwardTrigger = '<tab>'
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
let g:ycm_key_list_select_completion = ['<C-j>', '<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-k>', '<C-p>', '<Up>']
let g:UltiSnipsSnippetsDir = '~/.vim/ultisnips'
let g:UltiSnipsSnippetDirectories = ['ultisnips']