mhinz / vim-startify

:link: The fancy start screen for Vim.
MIT License
5.3k stars 186 forks source link

Unknown function: startify#fortune#boxed #399

Closed Th3Whit3Wolf closed 4 years ago

Th3Whit3Wolf commented 4 years ago

I get an error using startify#fortune#boxed

Error detected while processing /home/doc/.config/nvim/config/plugins/ss.vim:
line   35:
E117: Unknown function: startify#fortune#boxed
E116: Invalid arguments for function startify#pad

Here is my config

let s:vegeta = [
\ '                                 ,',
\ '                              ,   ,`|',
\ '                            ,/|.-`   \.',
\ '                         .-`  `       |.',
\ '                   ,  .-`              |',
\ '                  /|,`                 |`',
\ '                 / `                    |  ,',
\ '                /                       ,`/',
\ '             .  |          _              /',
\ '              \`` .-.    ,` `.           |',
\ '               \ /   \ /      \          /',
\ '                \|    V        |        |  ,',
\ '                 (           ) /.--.   ``"/',
\ '                 "b.`. ,` _.ee`` 6)|   ,-`',
\ '                   \"= --""  )   ` /.-`',
\ '                    \ / `---"   ."|`',
\ '                     \"..-    .`  |.',
\ '                      `-__..-`,`   |',
\ '                   __.) ` .-`/    /\._',
\ '              _.--`/----..--------. _.-""-._',
\ '           .-`_)   \.   /     __..-`     _.-`--.',
\ '          / -`/      """""""""         ,`-.   . `.',
\ '         | ` /                        /    `   `. \',
\ '         |   |                        |         | |',
\ '          \ . \                       |     \     |',
\ '         / `  | ,`               . -  \`.    |  / /',
\ '        / /   | |                      `/"--. -  /\',
\ '       | |     \ \                     /     \     |',
\ '       | \      | \                  .-|      |    |'
\ ]

let g:startify_custom_header = 
    \ startify#pad(s:vegeta + startify#fortune#boxed())

let g:startify_session_dir =  $VARPATH.'/session'
let g:startify_files_number = 4

let g:startify_bookmarks = [{'z': '~/.zshrc'}]

let g:startify_lists = [
    \ { 'type' : 'dir',         'header' : ['   My most recently used files in the current directory:']},
    \ { 'type' : 'files',       'header' : ['   My most recently used files:']},
    \ { 'type' : 'sessions',    'header' : ['   These are my sessions:']},
    \ { 'type' : 'bookmarks',   'header' : ['   These are my bookmarks:']},
\ ]

let g:startify_skiplist = [
      \ 'COMMIT_EDITMSG',
      \ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc',
      \ 'bundle/.*/doc',
\ ]

Relevant information Neovim Version: v0.4.3 Plugin Manager: minpac / native

When I replace

let g:startify_custom_header = 
    \ startify#pad(s:vegeta + startify#fortune#boxed())

with

let g:startify_custom_header = s:vegeta 

it works as expected.

mhinz commented 4 years ago

Does the let g:startify_custom_header = ... line come before the call minpac#add('mhinz/vim-startify') line in your vimrc?

That's the only way I can reproduce this. Otherwise your config works for me as-is.

When you put :echomsg join(split(&rtp, ','), "\n") in before the let g:startify_custom_header = ... line and start Vim, you should see a lot of runtime paths which should contain the path to the startify plugin. Otherwise autoload functions won't be found.

Th3Whit3Wolf commented 4 years ago

Vim-startify config is at the end of my config. I'm not sure if that would be a factor with minpac since vim is the one that ends up loading the plugin.

Putting it before that line I don't see vim-startify. Running it during runtime I do. Could this be related to splitting up my packages vim-startify config in different files?

Th3Whit3Wolf commented 4 years ago

It's strange because when I run neovim I get the errors but after pressing enter I get the cowsay quote version of startify with all of my bookmarks, lists, and everything else. So it seems like neovim is loading all of vim-startify minus the startify/fortune.vim

mhinz commented 4 years ago

Yeah, it's most probably a sourcing order issue. As I said, when the path to the vim-startify folder is missing from :echo &rtp, then calling startify#fortune#...() will throw an error.

But you could try this:

Th3Whit3Wolf commented 4 years ago

If there were Yelp Reviews for vim plugin authors you sir, would have 5 stars.

That fixed it. Thank you!

mhinz commented 4 years ago

Hah, thanks. I'm glad it's working now!

zyfyy commented 2 years ago
let g:startify_custom_header = 'startify#pad(split(system("figlet -w 100 VIM2020"), "\n"))'

quote all the function strings just works fine.