" Author: Florian "Bluewind" Pritz set nocompatible set encoding=utf-8 " unicode encoding if &term =~# '^\(screen\|rxvt*\)$' "tty blinks otherwise set t_Co=256 endif set nobackup set noexpandtab set smarttab set tabstop=4 set shiftwidth=4 set softtabstop=4 set ruler " show me where the cursor is set rulerformat=%l/%L(%p%%),%c " a better ruler set showmatch " show matching brackets "set cindent set number " show line numbers set showmode " show mode at bottom of screen set hlsearch " highlight all search results set incsearch " increment search set ignorecase " case-insensitive search set smartcase " upper-case sensitive search set nowrapscan " stop searching at EOF set laststatus=2 set mouse=a set nopaste set foldmethod=marker "set smartindent set scrolloff=3 set showcmd set display=uhex "set list "set listchars=tab:>\ ,eol:$ set listchars=trail:·,precedes:«,extends:»,tab:▸\ ,eol:↲ set hidden set display+=lastline if exists("+undofile") set undofile if isdirectory($HOME . '/.vim/undo') == 0 :silent !mkdir -p ~/.vim/undo > /dev/null 2>&1 endif set undodir=~/.vim/undo// set undodir+=. endif set splitbelow set splitright set wildmenu set wildmode=full set wildignore=*.o,*.a,*.class,*.mo,*.la,*.swp,*.jpg,*.png,*.xpm,*.gif,*.pyc,*~,.git,.svn,.hg, set completeopt-=preview set complete+=k " enable dictionary completion set completeopt=menuone,menu,longest let mapleader = "," let g:sudo_no_gui = 1 let g:ycm_extra_conf_globlist = ['~/.ycm_extra_conf.py'] filetype off set rtp+=~/.vim/bundle/vundle call vundle#begin() Plugin 'scrooloose/syntastic' Plugin 'Valloric/YouCompleteMe' Plugin 'SirVer/ultisnips' Plugin 'honza/vim-snippets' Plugin 'tpope/vim-unimpaired' Plugin 'tpope/vim-fugitive' Plugin 'tpope/vim-repeat' Plugin 'SudoEdit' Plugin 'rking/ag.vim' Plugin 'scrooloose/nerdtree' Plugin 'majutsushi/tagbar' Plugin 'adoy/vim-php-refactoring-toolbox' Plugin 'shawncplus/phpcomplete.vim' call vundle#end() "aliases cnorea w!! w !sudo tee "%" > /dev/null cnorea qpd %!perl -pe 's/\=([0-9A-Fa-f]{2})/chr(hex($1))/ge; s/\=\n//;' function! Filebin(start, end) let range = expand(a:start) . "," . expand(a:end) silent exe expand(range) . "w !fb -n " . expand("%:t") . " -e " . expand(&ft) redraw! endfunction com! -nargs=0 -range=% Fb :call Filebin(, ) syntax on filetype plugin indent on autocmd FileType text setlocal textwidth=78 autocmd BufReadPost * \ if line("'\"") > 1 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif command! DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis \ | wincmd p | diffthis set runtimepath+=/usr/share/vim let python_highlight_all = 1 " common save shortcuts inoremap :wa nnoremap :w inoremap :q nnoremap :q inoremap :bd nnoremap :bd " movement mappings nnoremap l nnoremap h nnoremap k nnoremap j set = set = " unsupported options "set = "set = nnoremap  K nnoremap  J nnoremap L nnoremap H nnoremap K nnoremap J nnoremap gk nnoremap gj nnoremap j gj nnoremap k gk "au VimEnter * :NERDTreeToggle nmap :TagbarToggle noremap :NERDTreeToggle inoremap :NERDTreeToggle noremap :FufFile inoremap :FufFile "noremap :FuzzyFinderBuffer "inoremap :FuzzyFinderBuffer let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsExpandTrigger="" let g:UltiSnipsListSnippets="" let g:UltiSnipsUsePythonVersion=2 let g:UltiSnipsEditSplit="vertical" let g:tagbar_left=1 let g:tagbar_autofocus=1 let g:tagbar_autoclose=1 "let g:syntastic_always_populate_loc_list = 1 "let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 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 autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType php set foldmethod=syntax autocmd FileType php set foldlevelstart=2 foldnestmax=2 autocmd FileType php let g:php_folding=1 autocmd FileType python set foldmethod=indent autocmd FileType python set foldlevelstart=2 foldnestmax=2 autocmd FileType python set ts=4 sw=4 softtabstop=4 et autocmd FileType make setlocal noexpandtab autocmd BufRead,BufNewFile PKGBUILD let is_bash=1 | set ft=sh let g:jellybeans_background_color_256 = 'none' let g:jellybeans_overrides = { \ 'SpecialKey': { 'guifg': 'b0b0b0', 'guibg': '000000'} \} colorscheme jellybeans " Toggle dark/light default colour theme for shitty terms "map :let &background = ( &background == "dark" ? "light" : "dark" ) " Compile and run keymappings au FileType php map :!php % au FileType python map :!python % au FileType perl map :!perl % au FileType ruby map :!ruby % au FileType lua map :!lua % au FileType html,xhtml map :!firefox % au FileType tex map :!texi2pdf -c % " Get the commit responsible for the current line nmap :call BlameCurrentLine() " Get the current line number & file name, view the git commit that inserted it fun! BlameCurrentLine() let lnum = line(".") let file = @% exec "!gitBlameFromLineNo " lnum file endfun map ggg?G``" apply rot13 for people snooping over shoulder, good fun highlight ExtraWhitespace ctermbg=red guibg=red autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin=ALL if !has("gui_running") if &term == "screen" set =Oc set =Od imap :bn imap :bp endif else set guifont=Dejavu\ Sans\ Mono\ 10 "set guioptions-=m set guioptions-=T set lines=80 columns=125 endif