Commit 231796b5 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Cleaned up vimrc, added Vundle and YouCompleteMe

parent f087929e
vim/.* vim/.*
*.swp
vim/bundle/*
[submodule "vim/bundle/Vundle.vim"]
path = vim/bundle/Vundle.vim
url = https://github.com/gmarik/Vundle.vim.git
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ln -s $DIR/bashrc ~/.bashrc ln -s $DIR/bashrc ~/.bashrc
ln -s $DIR/vimrc ~/.vimrc ln -s $DIR/vimrc_plugins ~/.vimrc
ln -sT $DIR/vim ~/.vim ln -sT $DIR/vim ~/.vim
. ~/.bashrc source ~/.bashrc
vim -c PluginInstall
cd $DIR/vim/bundle/YouCompleteMe && ./install.sh --clang-completer
Subproject commit 0b28e334e65b6628b0a61c412fcb45204a2f2bab
set ruler " -------------
hi SpellBad guisp=#fcaf3e cterm=underline " General setup
set expandtab " -------------
set modeline
set tabstop=4 " a tab is four spaces
set backspace=indent,eol,start
" allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set number " always show line numbers
set shiftwidth=4 " number of spaces to use for autoindenting
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase,
" case-sensitive otherwise
set smarttab " insert tabs on the start of a line according to
" shiftwidth, not tabstop
set hlsearch " highlight search terms
set incsearch " show search matches as you type
set history=1000 " remember more commands and search history filetype plugin indent on
set undolevels=1000 " use many muchos levels of undo syntax enable
set wildignore=*.swp,*.bak,*.pyc,*.class,*.old
set textwidth=79 " Automatically remove all trailing whitespace
set vb t_vb= autocmd BufWritePre * :%s/\s\+$//e
set ls=2 " always display filename " Source completion
" Automatically open and close the popup menu / preview window
"set omnifunc=syntaxcomplete#Complete
"au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
"set completeopt=menuone,menu,longest,preview
" IMPORTANT: Uncomment one of the following lines to force " ------
" using 256 colors (or 88 colors) if your terminal supports it, " Layout
" but does not automatically use 256 colors by default. " ------
" -- run in gnome-terminal: -- " try 256 color mode if envvar is set
" export TERM="xterm-256color"
"
set t_Co=88 set t_Co=88
if $TERM == 'xterm-256color' | set t_Co=256 | endif
if $TERM == 'xterm-256color' " Color scheme
set t_Co=256
endif
" ,rl = run pdflatex (on current file)
map ,rl :!pdflatex -src -shell-escape -interaction=nonstopmode %
" trigger pdflatex (above) on FileWritePost event
":autocmd BufWritePost *.tex :!pdflatex -src -shell-escape -interaction=nonstopmode % | grep -A 4 -i "error"
:autocmd BufNewFile,BufRead *.tex :set spell
"augroup vimrc_autocmds
" autocmd BufEnter * highlight OverLength ctermbg=darkgrey guibg=#592929
" autocmd BufEnter * match OverLength /\%81v.*/
"augroup END
" configure tags - add additional tags here or comment out not-used ones
" cd /usr/include
" ctags -R --sort=yes --fields=+iaS -f ~/.vim/tags/stdc stdio.h stdlib.h \
" pthread.h math.h assert.h errno.h malloc.h strings.h fcntl.h unistd.h
" ctags -R --sort=yes --fields=+iaS -f ~/.vim/tags/gl GL/
"set tags+=~/.vim/tags/stdc
"set tags+=~/.vim/tags/gl
" build tags of your own project with CTRL+F12
"map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
"noremap <F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<cr>
"inoremap <F12> <Esc>:!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<cr>
"" OmniCppComplete
"let OmniCpp_NamespaceSearch = 1
"let OmniCpp_GlobalScopeSearch = 1
"let OmniCpp_ShowAccess = 1
"let OmniCpp_MayCompleteDot = 1
"let OmniCpp_MayCompleteArrow = 1
"let OmniCpp_MayCompleteScope = 1
"let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
"" automatically open and close the popup menu / preview window
"au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
""set completeopt=menuone,menu,longest,preview
"set completeopt=menuone,menu " ,longest,preview
"set nocp
filetype plugin on
"set background=dark "set background=dark
"colorscheme darkspectrum "colorscheme darkspectrum
runtime! plugin/guicolorscheme.vim runtime! plugin/guicolorscheme.vim
GuiColorScheme darkspectrum GuiColorScheme darkspectrum
" Wildmenu set fileformats=unix " obviously...
set wildmenu " use wildmenu set ruler " show cursor location
set wildcharm=<TAB> " autocomplete set modeline " read modelines
set wildignore=*.swp,*.bak,*.pyc,*.class,*.old set number " show line numbers
" ------------------
" Various vim tweaks
" ------------------
set title " change the terminal's title set title " change the terminal's title
set visualbell " don't beep set nocompatible " disable Vi-compatibility
set noerrorbells " don't beep set laststatus=2 " always display filename
set nocp " Disable Vi-compatibility set textwidth=79 " break line at 79 chars
" syntax detection and filetype indention " Tabs are for heathens, we indent with spaces
filetype plugin indent on set expandtab smarttab
syntax enable set shiftwidth=4 tabstop=8 softtabstop=0
set autoindent copyindent
" pathogen set shiftround
execute pathogen#infect() set backspace=indent,eol,start
autocmd BufReadPre *.pdf set ro nowrap
autocmd BufReadPost *.pdf silent %!pdftotext "%" -nopgbrk -layout -q -eol unix -
" C syntax highlighting for CiviC files
au BufNewFile,BufRead *.cvc set filetype=c
" Automatically remove all trailing spaces
autocmd BufWritePre * :%s/\s\+$//e
" ----------------- " Don't give people epilepsy
" Source completion set visualbell t_vb= noerrorbells
" -----------------
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
"set completeopt=menuone,menu
" -------------- " Enable wildmenu for browsing files in :e command
" Source folding set wildmenu
" -------------- set wildcharm=<TAB>
"set foldmethod=indent set wildignore=*.swp,*.bak,*.pyc,*.class,*.o,*.bc
" -------------
" File explorer " File explorer
" -------------
let g:netrw_liststyle=3 " Use tree-mode as default view let g:netrw_liststyle=3 " Use tree-mode as default view
"let g:netrw_browse_split=4 " Open file in previous buffer
let g:netrw_preview=1 " Preview window shown in a vertically split let g:netrw_preview=1 " Preview window shown in a vertically split
" ------------ " ---------
" Key bindings " Searching
" ------------ " ---------
" skip the press and hold 'shift' + press ';' + release 'shift'. set history=1000 undolevels=1000
" Now you can simply use ';' instead of ':'. set wildignore=*.swp,*.bak,*.pyc,*.class,*.old
set hlsearch " highlight search terms
set incsearch " show search matches as you type
set smartcase " clever case sensitivity
" -----------------------
" Key bindings / commands
" -----------------------
" Use ';' instead of ':'
nnoremap ; : nnoremap ; :
" Use Q for formatting the current paragraph (or selection) " Use Q for formatting the current paragraph (or selection)
vmap Q gq vmap Q gq
nmap Q gqap nmap Q gqap
" Unbind Shift + up/down " Solve line jumping with long, wrapped lines (use [jk] for normal behaviour)
vmap <s-up> <up> nnoremap <down> gj
nmap <s-up> <up> nnoremap <up> gk
vmap <s-down> <down>
nmap <s-down> <down>
" If you like long lines with line wrapping enabled, this solves the problem
" that pressing down jumpes your cursor “over” the current line to the next
" line. It changes behaviour so that it jumps to the next row in the editor.
nnoremap j gj
nnoremap k gk
" Easy window navigation " Window navigation with ctrl + [hjkl]
map <C-h> <C-w>h map <C-h> <C-w>h
map <C-j> <C-w>j map <C-j> <C-w>j
map <C-k> <C-w>k map <C-k> <C-w>k
map <C-l> <C-w>l map <C-l> <C-w>l
" It clears the search buffer (and highlighting) when you press ,/ " Shortcuts for common commands
nmap <silent> ,/ :nohlsearch<CR> nmap <silent> ,/ :nohlsearch<CR>
nmap <silent> ,mt :!make check<CR>
nmap <silent> ,mc :!make coverage<CR>
nmap <silent> ,ml :!make clean<CR>
nmap <silent> ,mm :!make<CR> nmap <silent> ,mm :!make<CR>
nmap <silent> ,mM :!make && make<CR> nmap <silent> ,ml :!make clean<CR>
nmap <silent> ,md :!make doc<CR> nmap <silent> ,mt :!make check<CR>
nmap <silent> ,md :!make dist<CR>
nmap <silent> ,mb :!make -B<CR> nmap <silent> ,mb :!make -B<CR>
nmap <silent> ,a :!ant<CR>
" when you forgot to sudo before editing a file that requires root privileges. " Use w!! to save a file as root if opened with insufficient permissions
" This lets you use w!! to do that after you opened the file already:
cmap w!! w !sudo tee % >/dev/null cmap w!! w !sudo tee % >/dev/null
" Status line highlight " ---------------
:hi StatusLine ctermbg=black ctermfg=grey " Syntax / indent
" ---------------
" Syntax highlighting for .less files " Some files only have 2 spaces indent
au BufNewFile,BufRead *.less set filetype=less autocmd FileType sass,html set shiftwidth=2
set fileformats=unix " Tabs in Makefiles are 4 spaces since they are required and thus need not be
" religiously burned
autocmd FileType make set tabstop=4
let mapleader="," " Make pfd's readable
autocmd BufReadPre *.pdf set ro nowrap
autocmd BufReadPost *.pdf silent %!pdftotext "%" -nopgbrk -layout -q -eol unix -
" C syntax highlighting for CiviC files
autocmd BufNewFile,BufRead *.cvc set filetype=c
" Status line highlight
highlight StatusLine ctermbg=black ctermfg=grey
" Syntax highlighting for .less files
autocmd BufNewFile,BufRead *.less set filetype=less
" Pathogen " Highlight and underline badly spelled words when spellcheck is on
execute pathogen#infect() highlight SpellBad guisp=#fcaf3e cterm=underline
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
call vundle#end()
execute pathogen#infect()
source vimrc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment