From 0ba8d75539ebb419fc4ce09253425069f2f8a2e2 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Tue, 13 Jun 2017 00:12:46 +0200 Subject: Improved buffer restore behaviour --- vimrc-full | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'vimrc-full') diff --git a/vimrc-full b/vimrc-full index c72b4ac..225fc4a 100644 --- a/vimrc-full +++ b/vimrc-full @@ -59,7 +59,8 @@ set redrawtime=100 | " The time in milliseconds for redrawing the dis set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge set scrolloff=999 | " keeps cursor centered set splitbelow | " open new windows below the current one (i find that more intuitive) -set shiftround | " indent/unindent snaps to multiple of shiftwidth +set shiftround | " indent/unindent snaps to multiple of shiftwidths +set shortmess+=I | " don't give the intro message when starting Vim |:intro|. set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always @@ -603,7 +604,7 @@ if has("autocmd") augroup END endif - autocmd BufNewFile set nobuflisted + " autocmd BufNewFile set nobuflisted " use the shada/viminfo file to return the cursor to where it was... function! ReturnCursor() if line("'\"") > 1 && line("'\"") <= line("$") @@ -758,6 +759,11 @@ if version >= 702 " clean up (see: http://vim.wikia.com/wiki/VimTip396) autocmd BufWinLeave * call clearmatches() endif + +" avoids openin an empty buffer when restoring bufferlist from viminfo... +if argc() == 0 + autocmd VimEnter * nested :bun +endif " au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main " Enable omni completion. " autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS -- cgit v1.2.3