Skip to content

Instantly share code, notes, and snippets.

@bevancollins
Forked from jeresig/.vimrc
Last active December 28, 2018 01:52
Show Gist options
  • Save bevancollins/1108296 to your computer and use it in GitHub Desktop.
Save bevancollins/1108296 to your computer and use it in GitHub Desktop.
VIM Config
" install pathogen plugin (https://github.com/tpope/vim-pathogen)
" cd %USERPROFILE%; mkdir vimfiles; cd vimfiles; mkdir bundle; cd bundle
" git clone git://github.com/scrooloose/nerdtree.git
" git clone git://github.com/dantler/vim-alternate.git
" git clone git://github.com/ervandew/supertab.git
" git clone git://github.com/vim-scripts/Wombat.git
" Pathogen
call pathogen#infect()
call pathogen#helptags()
set background=dark
set expandtab
set hlsearch
set incsearch
set nocompatible
set nohls
set ruler
set shiftwidth=2
set showmatch
set smartindent
set smartindent
set tabstop=2
set vb t_vb=
set guioptions=er
syntax on
" https://github.com/chriskempson/tomorrow-theme
colorscheme Tomorrow-Night-Blue
nmap <C-T> :tabnew<CR>
set gfn=Consolas:h10
" Tell vim to remember certain things when we exit
" '10 : marks will be remembered for up to 10 previously edited files
" "100 : will save up to 100 lines for each register
" :20 : up to 20 lines of command-line history will be remembered
" % : saves and restores the buffer list
" n... : where to save the viminfo files
set viminfo='10,\"100,:20,%,n~/.viminfo
" when we reload, tell vim to restore the cursor to the saved position
augroup JumpCursorOnEdit
au!
autocmd BufReadPost *
\ if expand("<afile>:p:h") !=? $TEMP |
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ let JumpCursorOnEdit_foo = line("'\"") |
\ let b:doopenfold = 1 |
\ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
\ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
\ let b:doopenfold = 2 |
\ endif |
\ exe JumpCursorOnEdit_foo |
\ endif |
\ endif
" Need to postpone using "zv" until after reading the modelines.
autocmd BufWinEnter *
\ if exists("b:doopenfold") |
\ exe "normal zv" |
\ if(b:doopenfold > 1) |
\ exe "+".1 |
\ endif |
\ unlet b:doopenfold |
\ endif
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment