Issue a warning if the viminfo file can't be read

Also add a typical solution to the FAQ.

Closes #89.
This commit is contained in:
Marco Hinz 2014-08-20 18:53:13 +02:00
parent cbc2b29575
commit ec869a589e
2 changed files with 69 additions and 41 deletions

View file

@ -85,6 +85,12 @@ function! startify#insane_in_the_membrane() abort
let cnt = 1 let cnt = 1
endif endif
if empty(v:oldfiles)
echohl WarningMsg
echomsg "startify: Can't read viminfo file. Read :help startify-faq"
echohl None
endif
for item in s:lists for item in s:lists
if type(item) == 1 if type(item) == 1
let cnt = s:show_{item}(cnt) let cnt = s:show_{item}(cnt)

View file

@ -507,6 +507,69 @@ Example: (my terminal emulator supports 256 colors)
============================================================================== ==============================================================================
FAQ *startify-faq* FAQ *startify-faq*
I don't want the start screen to use cursorline!~
Startify sets its own filetype "startify". Thus one could set buffer-local
options like this:
>
autocmd FileType startify setlocal nocursorline
<
------------------------------------------------------------------------------
Recent files aren't shown!~
Perhaps the problem is that the viminfo file..
- doesn't exist
- is invalid
- is empty
- can't be read (check permissions)
I suggest the following steps:
1) Create a new directory:
>
$ mkdir -p ~/.vim/files/info
<
2) Put this into your vimrc:
>
set viminfo='100,n$HOME/.vim/files/info/viminfo
<
See |'viminfo'| for information about the second step and what it does
exactly.
------------------------------------------------------------------------------
Last recently used files don't seem to get updated at :Startify!~
Vim loads the list from viminfo only once, at startup.
------------------------------------------------------------------------------
I have broken colors when using sessions!~
Nothing this plugin could do about. Try playing around with 'sessionoptions'.
NOTE: Startify removes 'options' from the session options automatically,
because it's the source of many problems.
Some people swear it works for them with these settings:
>
set sessionoptions=blank,curdir,folds,help,tabpages,winpos
<
------------------------------------------------------------------------------
How to disable common but unimportant files?~
Use the skiplist. Personally I use:
>
let g:startify_skiplist = [
\ 'COMMIT_EDITMSG',
\ $VIMRUNTIME .'/doc',
\ 'bundle/.*/doc',
\ '\.DS_Store'
\ ]
<
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
CtrlP or NERDTree open a split in Startify!~ CtrlP or NERDTree open a split in Startify!~
@ -541,47 +604,6 @@ Do you have NERDTree installed by any chance? If so, try this:
> >
let NERDTreeHijackNetrw = 0 let NERDTreeHijackNetrw = 0
< <
------------------------------------------------------------------------------
I don't want the start screen to use cursorline!~
Startify sets its own filetype "startify". Thus one could set buffer-local
options like this:
>
autocmd FileType startify setlocal nocursorline
<
------------------------------------------------------------------------------
Last recently used files don't seem to get updated at :Startify!~
Vim loads the list from viminfo only once, at startup.
------------------------------------------------------------------------------
I have broken colors when using sessions!~
Nothing this plugin could do about. Try playing around with 'sessionoptions'.
NOTE: Startify removes 'options' from the session options automatically,
because it's the source of many problems.
Some people swear it works for them with these settings:
>
set sessionoptions=blank,curdir,folds,help,tabpages,winpos
<
------------------------------------------------------------------------------
How to disable common but unimportant files?~
Use the skiplist. Personally I use:
>
let g:startify_skiplist = [
\ 'COMMIT_EDITMSG',
\ $VIMRUNTIME .'/doc',
\ 'bundle/.*/doc',
\ '\.DS_Store'
\ ]
<
============================================================================== ==============================================================================
EXAMPLE *startify-example* EXAMPLE *startify-example*