mhinz / vim-startify

:link: The fancy start screen for Vim.
MIT License
5.32k stars 187 forks source link

Long quotes without boxes seem to get cut off rather than wrapped #314

Closed alok closed 6 years ago

alok commented 6 years ago

The one about lion taming by Glyn Williams, for example.

https://www.dropbox.com/s/teobuz9h2p7pw91/Screenshot%202018-04-25%2018.03.45.png?dl=0

mhinz commented 6 years ago

Startify doesn't force a value for 'wrap', because that's really a matter of taste.

If you want it done only for the Startify buffer, use this:

autocmd User Startified setlocal wrap
mhinz commented 6 years ago

Another possibility would be doing something similar to what startify#fortune#boxed() does:

function! Yay()
  let textwidth = &textwidth ? &textwidth : 50
  let wrapped_lines = []
  for line in startify#fortune#quote()
    let wrapped_lines += split(line, '\%'.textwidth.'c.\{-}\zs\s', 1)
  endfor
  return map(wrapped_lines, '"   ". v:val')
endfunction

let g:startify_custom_header = 'Yay()'
alok commented 6 years ago

I went with the first.