Skip to content

Instantly share code, notes, and snippets.

@KushalP
Created April 2, 2010 19:34
Show Gist options
  • Save KushalP/353589 to your computer and use it in GitHub Desktop.
Save KushalP/353589 to your computer and use it in GitHub Desktop.
set ai " auto indenting
set history=100 " keep 100 lines of history
set ruler " show the cursor position
syntax on " syntax highlighting
set hlsearch " highlight the last searched term
filetype plugin on " use the file type plugins
" clean up our tab usage
set softtabstop=4
set tabstop=4
set shiftwidth=4
" set our line number rules
set number
set numberwidth=7
highlight LineNr term=bold cterm=NONE ctermfg=LightGrey ctermbg=None gui=NONE guifg=LightGrey guibg=None
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif
" Automatically remove whitespace at the end of each line
autocmd BufWritePre * :%s/\s\+$//
augroup myfiletypes
" Clear old autocmds in group
autocmd!
" autoindent with two spaces, always expand tabs
autocmd FileType ruby,eruby,yaml set ai sw=2 sts=2 et
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment