" 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 'Shougo/neocomplete.vim' Bundle 'SirVer/ultisnips' Bundle 'tpope/vim-unimpaired' Bundle 'tpope/vim-fugitive' Bundle 'tpope/vim-repeat' filetype plugin indent on "aliases cnorea w!! w !sudo tee "%" > /dev/null cnorea qpd %!perl -pe 's/\=([0-9A-Fa-f]{2})/chr(hex($1))/ge; s/\=\n//;' com -range=% Fb :exec ",w !fb -e " . &filetype . " -n " . expand("%:t") 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="" let g:acp_enableAtStartup = 0 let g:neocomplcache_enable_at_startup = 1 " Use smartcase. let g:neocomplcache_enable_smart_case = 1 " Set minimum syntax keyword length. let g:neocomplcache_min_syntax_length = 2 " : close popup and save indent. "inoremap =my_cr_function() "function! s:my_cr_function() "return neocomplcache#smart_close_popup() . "\" "" For no inserting key. ""return pumvisible() ? neocomplcache#close_popup() : "\" "endfunction " : completion. inoremap pumvisible() ? "\" : "\" " , : close popup and delete backword char. inoremap neocomplcache#smart_close_popup()."\" "inoremap neocomplcache#smart_close_popup()."\" inoremap neocomplcache#close_popup() inoremap neocomplcache#cancel_popup() " Close popup by . "inoremap pumvisible() ? neocomplcache#close_popup() : "\" " Enable heavy omni completion. if !exists('g:neocomplcache_omni_patterns') let g:neocomplcache_omni_patterns = {} endif let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::' let g:neocomplcache_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' let g:neocomplcache_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' " For perlomni.vim setting. " https://github.com/c9s/perlomni.vim let g:neocomplcache_omni_patterns.perl = '\h\w*->\h\w*\|\h\w*::' 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 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': '000000'} \} 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