" 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 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 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 hidden set display+=lastline if exists("+undofile") set undofile endif set wildmenu set wildmode=full set wildignore=*.o,*.a,*.class,*.mo,*.la,*.swp,*.jpg,*.png,*.xpm,*.gif,*.pyc,*~,.git,.svn,.hg, let mapleader = "," "call pathogen#infect() filetype off set rtp+=~/.vim/bundle/vundle/ call vundle#rc() Bundle 'scrooloose/syntastic' Bundle 'Valloric/YouCompleteMe' Bundle 'SirVer/ultisnips' filetype plugin indent on "aliases cnorea w!! w !sudo tee "%" > /dev/null "cnorea fb w !fb cnorea qpd %!perl -pe 's/\=([0-9A-Fa-f]{2})/chr(hex($1))/ge; s/\=\n//;' syntax on filetype plugin indent on autocmd FileType text setlocal textwidth=78 autocmd BufReadPost * \ if line("'\"") > 1 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif if !exists(":DiffOrig") command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis \ | wincmd p | diffthis endif set runtimepath+=/usr/share/vim let python_highlight_all = 1 " common save shortcuts inoremap :wa nnoremap :w inoremap :q nnoremap :q " movement mappings nnoremap l nnoremap h nnoremap j nnoremap k nnoremap gk nnoremap gj nnoremap j gj nnoremap k gk "au VimEnter * :NERDTreeToggle noremap :NERDTreeToggle inoremap :NERDTreeToggle noremap :FufFile inoremap :FufFile "noremap :FuzzyFinderBuffer "inoremap :FuzzyFinderBuffer noremap :nohl inoremap :nohla let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" nmap ,s :set spell! autocmd FileType make setlocal noexpandtab au FileType python set ts=4 sw=4 softtabstop=4 et autocmd BufRead,BufNewFile PKGBUILD let is_bash=1 | set ft=sh "colorscheme gardener "colorscheme desert256 "colorscheme candycode let g:jellybeans_background_color_256 = 'none' let g:jellybeans_overrides = { \ 'SpecialKey': { 'guifg': 'b0b0b0', 'guibg': 'none'} \} colorscheme jellybeans "colorscheme inkpot "colorscheme mustang "colorscheme wombat256 "colorscheme xoria256 " 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 % " MiniBufExplorer "let g:miniBufExplMapWindowNavVim = 1 "let g:miniBufExplMapWindowNavArrows = 1 "let g:miniBufExplMapCTabSwitchBufs = 1 "let g:miniBufExplModSelTarget = 1 "set tags+=$HOME/.vim/tags/python.ctags " 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