" Cursor Position - Modeline and Notes {{{ " vim: set sw=2 ts=2 sts=2 et tw=78 foldmarker={{{,}}} foldlevel=0 foldmethod=marker spell: " " cinaeco/dotfiles Cursor Position from last editing session. " " Taken from spf13-vim. " " }}} " Cursor Autocommands {{{ if has("autocmd") " Restore Position {{{ " http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session " Restore cursor to file position in previous editing session function! ResCur() if line("'\"") <= line("$") normal! g`" return 1 endif endfunction augroup resCur autocmd! autocmd BufWinEnter * call ResCur() augroup END " }}} " Git Commit Exception{{{ " Instead of reverting the cursor to the last position in the buffer, we " set it to the first line when editing a git commit message au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0]) " }}} endif " }}}