Skip to content

Instantly share code, notes, and snippets.

@tommybutler
Created October 12, 2013 20:02
Show Gist options
  • Save tommybutler/6954257 to your computer and use it in GitHub Desktop.
Save tommybutler/6954257 to your computer and use it in GitHub Desktop.
My vim settings file
" don't sacrifice functionality and features just to preserve backward compatibility with vi
:set nocompatible
" turn on syntax highlighting
:syntax enable
" if a given file type (perl, ruby, python, c, etc) has its own special auto-indentation rules, use them
:filetype plugin indent on
" turn on auto-indenting (use this if you turn off option ':filetype plugin indent on')
":set ai
" make auto-indenting 'smarter' (use this if you turn off option ':filetype plugin indent on')
":set si
" optimize syntax highlighting for a dark terminal
:set bg=dark
" tabs are 3 spaces wide
:set ts=3
" auto-indentation kicks in 3 spaces
:set sw=3
" run case insensitive searches by default
:set ic
" swap tabs out for spaces
:set expandtab
" place a very helpful 'status-bar' at the bottom of the window
:set ruler
" highlight matched parens, brackets, beginning and end of code blocks
:set showmatch
" show line numbers
:set number
" turn off unbearable search highlighting default
:set nohlsearch
" automatically strip trailing whitespace when a file is saved
:autocmd BufWritePre * :%s/\s\+$//e
" the next two lines use the F5 key to toggle paste mode on/off
:nnoremap <F5> :set invpaste paste?<CR>
:set pastetoggle=<F5>
" special folding rules for perl files
:let perl_fold = 1
" auto-folding behavior is dictated based on file-type, when applicable
:set foldmethod=syntax
" lightly highlight the current line on which the cursor is placed (turn this off if it gets annoying)
:set cursorline
" lightly highlight the current column in which the cursor is placed (turn this off if it gets annoying)
:set cursorcolumn
" tell vim to scan the file for a modeline that contains in-line vim commands and options, just for that file
:set modeline
" the 'modeline' below tells vim that this is a vim command file (duh?)
" vim: set ft=vim :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment