Skip to content

Instantly share code, notes, and snippets.

@johnmarc
Created January 24, 2012 17:52
Show Gist options
  • Save johnmarc/1671506 to your computer and use it in GitHub Desktop.
Save johnmarc/1671506 to your computer and use it in GitHub Desktop.
"display line numbers
set number
"set autoindent
set ai
"etsy style tabs (aka no tabs, 4 spaces, some people use 2 here for ruby)
set shiftwidth=4
set tabstop=4
set expandtab
set softtabstop=4
"histoy 500 (some prefer 1000 or more)
set history=500
"case insensitve search by default
set ignorecase
"vi is dead as dead
set nocompatible
"dannel's ruler
set ruler
set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%)
"blinking is better than beeping when you listen to tunes all day
set visualbell
"syntax highlighting
syntax on
"if you're in a screen, set the title to the file name, and stuff... (forget what)
let &titlestring = expand("%:t")
if &term == "screen"
set t_ts=
set t_fs=
endif
if &term == "screen" || &term == "xterm"
set title
endif
"Allow F4 to toggle the Tag list (use tagsup to generate)
let Tlist_WinWidth = 50
map <F4> :TlistToggle<cr>
"hilight end of line whitespace in yellow when not in insert mode
highlight ExtraWhitespace ctermbg=yellow guibg=yellow
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
"display a warning if fileformat isnt unix
set statusline+=%#warningmsg#
set statusline+=%{&ff!='unix'?'['.&ff.']':''}
set statusline+=%*
"display a warning if file encoding isnt utf-8
set statusline+=%#warningmsg#
set statusline+=%{(&fenc!='utf-8'&&&fenc!='')?'['.&fenc.']':''}
set statusline+=%*
"remove trailing whitespace on save
autocmd BufWritePre *.php :%s/\s\+$//e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment