Skip to content

feature request: paste global buffer directly at splash screen  #557

@ke-ss

Description

@ke-ss

When I open NeoVim without the vim-startify plugin installed, I can paste directly from the global clipboard, onto the neoVim splash screen, creating a new file buffer by pressing keys ctrl+shift+v
I can instantly see what I have pasted.

Vim Startify does not yet support this, and the additinal stap of pressing key e for edit seems an unnecessary extra step.
It's not much extra to do, but I never remember.

Can we replicate this functionality with the vim-startify plugin.

I tried to code this myself, and think it is a very simple mod, but don't know much coding or vimscript, so did not get far.

I think it is as simple as modifying the file
../vim-startify/autoload/startify.vim
with something like the following additions

13 "  " added below 4 lines 6/1/2025
     "    if g:startify_enable_special
     "      call append('$', [s:leftpad .'[p]  paste clipboard', ''])
     "    endif
     "    call s:register(line('$')-1, 'p', 'special', 'enew', '')
129 "   " added below function 6/1/2025
       "   " Function to paste clipboard content into an empty buffer
       "   function! s:paste_clipboard() abort
       "     " Close the Startify splash screen
       "     call s:close()
       "   
       "     " Paste clipboard content into the current (now empty) buffer
       "     if has('clipboard')
       "       silent! execute 'normal! p'
       "       
       "       silent! execute 'normal! "+p'
       "   
       "     else
       "       echo "Clipboard support is not available"
       "     endif
       "   endfunction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions