Skip to content

Instantly share code, notes, and snippets.

@metatoaster
Last active October 11, 2015 04:57
Show Gist options
  • Save metatoaster/3806419 to your computer and use it in GitHub Desktop.
Save metatoaster/3806419 to your computer and use it in GitHub Desktop.
.vimrc
set viminfo='20,\"500
set ai sw=2 expandtab
set title
set hidden
set nocompatible
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
syntax on
" From Bram:
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
" DF - Also do not do this if the file resides in the $TEMP directory,
" chances are it is a different file with the same name.
" This comes from the $VIMRUNTIME/vimrc_example.vim file
autocmd BufReadPost *
\ if expand("<afile>:p:h") !=? $TEMP |
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ let b:doopenfold = 1 |
\ endif |
\ endif
" Need to postpone using "zv" until after reading the modelines.
autocmd BufWinEnter *
\ if exists("b:doopenfold") |
\ unlet b:doopenfold |
\ exe "normal zv" |
\ endif
execute pathogen#infect()
imap jk <Esc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment