"---------------------------------------------------- " File: .vimrc " Version: 0.1.1 " 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 expandtab set tabstop=2 set shiftwidth=2 set softtabstop=2 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 autoindent set scrolloff=3 set showcmd set display=uhex set list set listchars=tab:▸\ ,eol:$ set hidden "aliases ca w!! w !sudo tee "%" > /dev/null ca fb w !fb ca qpd %!perl -pe 's/\=([0-9A-Fa-f]{2})/chr(hex($1))/ge; s/\=\n//;' let g:qname_hotkey = "" 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 " Comment out a visual block function CommentLines() execute ":s@^@".g:StartComment." @g" "execute ":s@^\\(\\s*\\)@\\1".g:StartComment." @g" execute ":s@$@ ".g:EndComment."@g" endfunction " Uncomment a visual block function UncommentLines() execute ":s@^".g:StartComment." @\@g" "execute ":s@^\\(\\s*\\)".g:StartComment." @\\1@g" execute ":s@ ".g:EndComment."$@@g" endfunction " Set comment characters for common languages autocmd FileType python,sh,bash,zsh,ruby,perl let StartComment="#" | let EndComment="" autocmd FileType html let StartComment="" autocmd FileType php,c,javascript let StartComment="//" | let EndComment="" autocmd FileType cpp let StartComment="/*" | let EndComment="*/" autocmd FileType vim let StartComment="\"" | let EndComment="" vmap :call CommentLines() vmap :call UncommentLines() set runtimepath+=/usr/share/vim "inoremap let python_highlight_all = 1 " common save shortcuts inoremap :wa nnoremap :w inoremap :q nnoremap :q "au VimEnter * :NERDTreeToggle noremap :NERDTreeToggle inoremap :NERDTreeToggle noremap :FuzzyFinderFile inoremap :FuzzyFinderFile "noremap :FuzzyFinderBuffer "inoremap :FuzzyFinderBuffer noremap :nohl inoremap :nohla autocmd FileType make setlocal noexpandtab au FileType python set ts=4 sw=4 softtabstop=4 et "colorscheme gardener "colorscheme desert256 "colorscheme candycode "colorscheme jellybeans "colorscheme inkpot "colorscheme mustang colorscheme wombat256 " 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 map ggg?G``" apply rot13 for people snooping over shoulder, good fun if !has("gui_running") if &term == "screen" set =Oc set =Od imap :bn imap :bp endif else set guifont=Dejavu\ Sans\ Mono\ 7 "set guioptions-=m set guioptions-=T set lines=45 columns=125 endif