Skip to content

Instantly share code, notes, and snippets.

@KushalP
Created October 12, 2010 17:42
Show Gist options
  • Select an option

  • Save KushalP/622590 to your computer and use it in GitHub Desktop.

Select an option

Save KushalP/622590 to your computer and use it in GitHub Desktop.
filetype on
filetype indent on
filetype plugin on " use the file type plugins
" general things
set nocompatible
syntax on " syntax highlighting
set noerrorbells " don't make noise
set nowrap " don't want it to wrap lines!
set ai " auto indenting
set history=100 " keep 100 lines of history
set ruler " show the cursor position
set hlsearch " highlight the last searched term
" clean up our tab usage
set expandtab " Insert spaces instead of tabs
set softtabstop=4
set tabstop=4
set shiftwidth=4
set listchars=tab:<-,trail:~ " Display trailing spaces using ~ and tabs withs ->
set autoindent
set smartindent
" 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
" make Python syntax highlight more things
let python_highlight_numbers = 1
let python_highlight_builtins = 1
let python_highlight_exceptions = 1
" in Ruby and Scala, we use spaces (two) instead of tabs
au BufRead,BufNewFile *.rb,*.scala set et sw=2 sts=2 ts=8
" in Python, we use spaces (four) instead of tabs
au BufRead,BufNewFile *.py set et
" 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
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