Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 1.27 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
  2. set nocompatible
  3. set autoindent
  4. set tabstop=2
  5. set showmatch
  6. set vb t_vb=
  7. set ruler
  8. set nohls
  9. set incsearch
  10. syntax on
  11.  
  12. " Tell vim to remember certain things when we exit
  13. "  '10 : marks will be remembered for up to 10 previously edited files
  14. "  "100 : will save up to 100 lines for each register
  15. "  :20 : up to 20 lines of command-line history will be remembered
  16. "  % : saves and restores the buffer list
  17. "  n... : where to save the viminfo files
  18. set viminfo='10,\"100,:20,%,n~/.viminfo
  19.  
  20. " when we reload, tell vim to restore the cursor to the saved position
  21. augroup JumpCursorOnEdit
  22.  au!
  23.  autocmd BufReadPost *
  24.  \ if expand("<afile>:p:h") !=? $TEMP |
  25.  \ if line("'\"") > 1 && line("'\"") <= line("$") |
  26.  \ let JumpCursorOnEdit_foo = line("'\"") |
  27.  \ let b:doopenfold = 1 |
  28.  \ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
  29.  \ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
  30.  \ let b:doopenfold = 2 |
  31.  \ endif |
  32.  \ exe JumpCursorOnEdit_foo |
  33.  \ endif |
  34.  \ endif
  35.  " Need to postpone using "zv" until after reading the modelines.
  36.  autocmd BufWinEnter *
  37.  \ if exists("b:doopenfold") |
  38.  \ exe "normal zv" |
  39.  \ if(b:doopenfold > 1) |
  40.  \ exe "+".1 |
  41.  \ endif |
  42.  \ unlet b:doopenfold |
  43.  \ endif
  44. augroup END