Mercurial > ec-dotfiles
comparison rc/vimrc @ 412:7ceec4404caf
Add restore cursor position for vim.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Thu, 15 Nov 2012 01:03:52 +0700 |
parents | fd0a889066a6 |
children | c0ac21407903 |
comparison
equal
deleted
inserted
replaced
411:70a71c10b9f3 | 412:7ceec4404caf |
---|---|
45 autocmd BufRead,BufNewFile .git/config :set noet ts=8 nolist | 45 autocmd BufRead,BufNewFile .git/config :set noet ts=8 nolist |
46 autocmd BufRead,BufNewFile *.erb :set ft=eruby ts=2 et list | 46 autocmd BufRead,BufNewFile *.erb :set ft=eruby ts=2 et list |
47 autocmd BufRead,BufNewFile *.scss :set ft=scss | 47 autocmd BufRead,BufNewFile *.scss :set ft=scss |
48 autocmd BufRead,BufNewFile *.coffee :set ft=coffee | 48 autocmd BufRead,BufNewFile *.coffee :set ft=coffee |
49 endif | 49 endif |
50 | |
51 "Restore cursor position | |
52 set viminfo='10,\"100,:20,%,n~/.viminfo | |
53 function! ResCur() | |
54 if line("'\"") <= line("$") | |
55 normal! g`" | |
56 return 1 | |
57 endif | |
58 endfunction | |
59 | |
60 augroup resCur | |
61 autocmd! | |
62 autocmd BufWinEnter * call ResCur() | |
63 augroup END |