Skip to content

Instantly share code, notes, and snippets.

@kohlhofer
Created July 25, 2014 13:47
Show Gist options
  • Save kohlhofer/f3a215251ba3ea96c283 to your computer and use it in GitHub Desktop.
Save kohlhofer/f3a215251ba3ea96c283 to your computer and use it in GitHub Desktop.
set nocompatible " Use Vim settings, rather than Vi settings (much better!).
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vundle plugin management
" https://github.com/gmarik/Vundle.vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'scrooloose/syntastic'
Plugin 'airblade/vim-gitgutter'
" All of your Plugins must be added before the following line
call vundle#end() " required by vundle
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Various defaults
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
filetype plugin indent on
set hidden " Leave buffers even when they're changed
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set history=250 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set expandtab " use soft tabs always
set shiftwidth=2 "
set softtabstop=2 "
set number " show line numbers by default
set nobackup " prevent VIM from leaving little files all over the place
set wildmenu "
set wildmode=longest:full,full
set path=$PWD/** " set root directory for :find to launch directory
colorscheme jellybeans "
set spell "
set ignorecase " Ignoring case is a fun trick
set smartcase " And so is Artificial Intelligence!
set cul " highlight the current line
set title " set window title in terminal
set autoread " watch for file changes
set showmatch " Show matching brackets.
set scrolloff=5 " keep at least 5 lines around the cursor
set laststatus=2 " always show status bar at the bottom
set showmode " display the current mode in the status line
set clipboard=unnamed " integrates with the clipboard on some systems for easier copying and pasting
set report=0 " always report how many lines where changed
set noerrorbells " no more console error beepe
set visualbell " visual beep on error instead
map Q gq " Don't use Ex mode, use Q for formatting
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
" Also don't do it when the mark is in the first line, that is the default
" position when opening a file.
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
augroup END
else
set autoindent " always set auto indenting on
endif " has("autocmd")
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" STATUS LINE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set statusline=\ %t "tail of the filename
set statusline+=%h "help file flag
set statusline+=%q "loaction list flag if applicable
set statusline+=%m "modified flag
set statusline+=%r "read only flag
set statusline+=%= "left/right separator
set statusline+=Col:\ %-3c "cursor column
set statusline+=\ \ Line:\ %3l "cursor line
set statusline+=(%p%%) "percent through file
set statusline+=\ %#warningmsg# "switch to warningmsg color
set statusline+=\ %{SyntasticStatuslineFlag()}
set statusline+=%* "back to normal color
if version >= 700
highlight statusLine ctermfg=black ctermbg=white
au InsertLeave * highlight StatusLine ctermfg=black ctermbg=white
au InsertEnter * highlight StatusLine ctermfg=black ctermbg=yellow
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" PLugin: Syntastic
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
command! -nargs=* -bar -bang -count=0 -complete=dir E Explore <args> "map E: back to Explore and prevent ambiguity with syntastics :Error
let g:syntastic_auto_loc_list=2
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"," proprietary attribute \"ui-"," proprietary attribute \"translate"," proprietary attribute \"uv-","<uv-", "trimming empty <"]
let g:syntastic_enable_signs=1
let g:syntastic_javascript_checkers = ["jshint"]
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
let g:syntastic_loc_list_height = 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment