From 75a0479ac3a232eddc964d498951048228c917f1 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Thu, 4 Jul 2013 02:07:41 -0700 Subject: [PATCH] refactor and disable resCur --- vimrc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/vimrc b/vimrc index bd54d7c..a564e95 100644 --- a/vimrc +++ b/vimrc @@ -81,9 +81,9 @@ set nolinebreak set tabstop=8 shiftwidth=8 smarttab " 8 space tabs -function! TabFour() +fu! TabFour() setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4 -endfunction +endf if has('autocmd') augroup tabs " 4 spaces as tabs for various languages @@ -92,12 +92,17 @@ if has('autocmd') au BufRead,BufNewFile *.json call TabFour() augroup END - " attempt to preserve cursor position - " FIXME: waits for input after running - autocmd BufReadPost * - \ if line("'\"") > 1 && line("'\"") <= line("$") | - \ exe "normal! g`\"" | - \ endif + " FIXME: this requires input upon starting vim, annoying + fu! ResCur() " attempt to preserve cursor position + if line("'\"") > 1 && line("'\"") <= line("$") + normal! g`" + return 1 + endif + endf + augroup resCur + au! + "au BufWinEnter * call ResCur() + augroup END endif set backspace=eol,start,indent " make backspace useful