edkolev / promptline.vim

Generate a fast shell prompt with powerline symbols and airline colors
MIT License
623 stars 54 forks source link

Slices are not working #39

Closed radimsuckr closed 9 years ago

radimsuckr commented 9 years ago

Hello, I keep getting this error:

Error detected while processing /home/grelek/.dotfiles/nvim/nvimrc:
line  158:
E117: Unknown function: promptline#slices#user
E15: Invalid expression: {'a': [ promptline#slices#user(), promptline#slices#host({'only_if_ssh': 1}) ],'b': [ promptline#slices#cwd() ],'c': [ promptline#slices#vcs_branch(), promptline#slices#git_status() ],'warn': [ promptline#slices#last_exit_code() ],'options': {'left_sections': [ 'a', 'c' ],'left_only_sections': [ 'a', 'c' ]}}

And when I delete promptline#slices#user(), error yells that promptline#slices#host... is unknown function and so on.

I'm using zsh, neovim, vim-plug and airline and this configuration:

let g:promptline_powerline_symbols=1
let g:promptline_theme='airline'
let g:promptline_preset={
    \'a': [ promptline#slices#user(), promptline#slices#host({'only_if_ssh': 1}) ],
    \'b': [ promptline#slices#cwd() ],
    \'c': [ promptline#slices#vcs_branch(), promptline#slices#git_status() ],
    \'warn': [ promptline#slices#last_exit_code() ],
    \'options': {
        \'left_sections': [ 'a', 'c' ],
        \'left_only_sections': [ 'a', 'c' ]}}

It looks like slices are completely missing since promptline can run this PromptlineSnapshot! ~/.shell_prompt.sh airline full.

It's pretty annoying and sad as this plugin looks great.

radimsuckr commented 9 years ago

I've done this but I have no idea why does it work. Can anybody explain it to me?

bryanbecker commented 9 years ago

I think when you execute PromptlineSnapshot! ~/.shell_prompt.sh airline full you are overriding your config and using the preset "full"... try the command without full or without airline full

radimsuckr commented 9 years ago

I know that full overrides my preset. I just wrote that generating with PromptlineSnapshot! ~/.shell_prompt.sh airline full works and my own preset doesn't work. :)

I solved this issue already. It looks like plugins settings shouldn't be done in vim-plug block. When put outside, everything is ok.