Skip to content

Instantly share code, notes, and snippets.

@leopd
Created September 4, 2013 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leopd/6441419 to your computer and use it in GitHub Desktop.
Save leopd/6441419 to your computer and use it in GitHub Desktop.
My .vimrc file
" turn off compatibility with the old vi
set nocompatible
set ts=4
set et
" turn syntax highlighting on by default
syntax on
" set auto-indenting on for programming
set ai
" Number of spaces that a pre-existing tab is equal to.
" For the amount of space used for a new tab use shiftwidth.
au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=8
" What to use for an indent.
" This will affect Ctrl-T and 'autoindent'.
" Python: 4 spaces
" C: tabs (pre-existing files) or 4 spaces (new files)
au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
" ignore case when searching
set ic
" use < and > keys
set shiftwidth=4
set smarttab
set softtabstop=4
set expandtab
" turn on the "visual bell" - which is much quieter than the "audio blink"
set vb
" highlight words when searching for them. it's distracting.
"set hlsearch
" automatically show matching brackets. works like it does in bbedit.
"set showmatch
" do NOT put a carriage return at the end of the last line! if you are programming
" for the web the default will cause http headers to be sent. that's bad.
"set binary noeol
" This resets noexpandtab!
" make that backspace key work the way it should
"set backspace=indent,eol,start
"highlight BadPyWhitespace ctermbg=red guibg=red
"au BufRead,BufNewFile *.py match BadPyWhitespace /^\t\+/
"match BadPyWhitespace /^\t\+/
"match BadPyWhitespace /\s\+$/
" This doesn't work!
"au BufRead,BufNewFile *.py highlight BadPyWhitespace ctermbg=red guibg=red
"au BufRead,BufNewFile *.py match BadPyWhitespace /^\t\+/
"au BufRead,BufNewFile *.py match BadPyWhitespace /\s\+$/
"let python_highlight_space_errors = 1
"let python_highlight_tabs = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment