Created
August 31, 2011 04:17
-
-
Save metatoaster/1182815 to your computer and use it in GitHub Desktop.
Simple vimrc with copypasta from various places
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment