Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
242 lines (189 sloc) 6.34 KB
set nocompatible
set background=dark
filetype on
filetype plugin on
filetype indent on
set autowrite
" allow switching between buffers without saving
set hidden
let mapleader = ","
set showcmd
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Vundle Bundle manager. Great stuff.
" If there is a slash in the bundle-name
" it automatically installs from GitHub.
Bundle 'gmarik/vundle'
" very nice file browser
Bundle 'scrooloose/nerdtree'
" some markdown support
Bundle ''
" full path fuzzy search
Bundle 'kien/ctrlp.vim'
" some yaml support
Bundle ''
" git tools
Bundle 'tpope/vim-fugitive'
" zen coding (for HTML)
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" jump around documents
Bundle 'Lokaltog/vim-easymotion'
" prereq for FuzzyFinder
Bundle 'L9'
Bundle 'FuzzyFinder'
" Edit encrypted files
Bundle 'openssl.vim'
" path searching
Bundle 'git://'
" formatting for js
Bundle "pangloss/vim-javascript"
" some autocompletion
" Bundle 'Valloric/YouCompleteMe'
" more js syntax options
Bundle 'maksimr/vim-jsbeautify'
" pretty sweet linting/error checking. Works on save
Bundle ''
" My personal favorite 'everywhere' theme.
Bundle 'd11wtq/tomorrow-theme-vim'
" creates a nice way to traverse buffers in a 'tab like' way.
" Bundle 'fholgado/minibufexpl.vim'
" key combos for 'pairs' of things. Mostly previous/next type stuff
Bundle 'tpope/vim-unimpaired'
Bundle 'wojtekmach/vim-rename'
" so ~/sources/tern/vim/tern.vim
syntax on
" MBA tiny escape button fix
imap <C-c> <esc>
color Tomorrow-Night-Bright
filetype plugin indent on
set tabstop=4
set softtabstop=4
set shiftwidth=4
set textwidth=80
set smarttab
set expandtab
set smartindent
set ruler
set relativenumber
set ttyfast
set autoread
set more
set cursorline!
" Visualize tabs, trailing whitespaces and funny characters
set list
set listchars=nbsp:¬,tab:»·,trail:·
hi User1 ctermfg=196 guifg=#eea040 guibg=#222222
hi User2 ctermfg=75 guifg=#dd3333 guibg=#222222
hi User3 guifg=#ff66ff guibg=#222222
hi User4 ctermfg=239 guifg=#a0ee40 guibg=#222222
hi User5 guifg=#eeee40 guibg=#222222
" Statusline
set statusline= " Override default
" set statusline+=%1*%{fugitive#statusline()[4:-2]}%* " Show fugitive git info
set statusline+=%2*\ %f\ %m\ %r%* " Show filename/path
set statusline+=%3*%=%* " Set right-side status info after this line
set statusline+=%4*%l/%L:%v%* " Set <line number>/<total lines>:<column>
set statusline+=%5*\ %* " Set ending space
" Set 7 lines to the cursor - when moving vertically using j/k
set scrolloff=7
" No annoying sound on errors
set noerrorbells
set novisualbell
set timeoutlen=500
" visual bell color
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" For regular expressions turn magic on
set magic
" Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
set matchtime=2
set laststatus=2
" Starting from vim 7.3 undo can be persisted across sessions
if has("persistent_undo")
set undodir=~/.vim/undodir
set undofile
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Remember info about open buffers on close
set viminfo^=%
" Remap VIM 0 to first non-blank character
map 0 ^
" Automatically re-indent on paste
"nnoremap <leader>p p
"nnoremap <leader>P P
"nnoremap p p'[v']=
"nnoremap P P'[v']=
" Leave insert-mode after 15 seconds of no input.
" Muss in die einzelnen Filetypes, da ich so keine Emails schreiben kann. :)
" au CursorHoldI * stopinsert
" au InsertEnter * let updaterestore=&updatetime | set updatetime=15000
" au InsertLeave * let &updatetime=updaterestore
" Breaking lines with \[enter] without having to go to insert mode (myself).
nmap <leader><cr> i<cr><Esc>
" Will allow you to use :w!! to write to a file using sudo if you forgot to sudo
" vim file (it will prompt for sudo password when writing)
cmap w!! %!sudo tee > /dev/null %
" Save and run current file
map <silent> <F5> <esc>:w<CR><esc>:!./%<CR>
" Toggle copy and pastemode, echoing current status
map <silent> <C-F7> :only<CR>:set invnumber invlist number?<CR>
map <silent> <F7> :set invpaste paste?<CR>i
" Reload changes to .vimrc automatically
autocmd BufWritePost ~/.vimrc source ~/.vimrc
" Stuff taken from
command! Q q
command! W w
" Disable that goddamn 'Entering Ex mode. Type 'visual' to go to Normal mode.'
" that I trigger 40x a day.
map Q <Nop>
let loaded_matchparen = 1
let g:ctrlp_map = '<c-p>'
nmap <silent> <C-D> :NERDTreeToggle<CR>
set wildmode=list:longest
set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
set wildignore+=*vim/backups*
set wildignore+=*sass-cache*
set wildignore+=*DS_Store*
set wildignore+=vendor/rails/**
set wildignore+=vendor/cache/**
set wildignore+=*.gem
set wildignore+=log/**
set wildignore+=tmp/**
set wildignore+=*.png,*.jpg,*.gif
set wildignore+=*node_modules*
set scrolloff=8 "Start scrolling when we're 8 lines away from margins
set sidescrolloff=15
set sidescroll=1
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap <C-n> :bnext<CR>
nnoremap <C-p> :bprevious<CR>