Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ke-ss opened this issue Jan 6, 2025 · 0 comments
Open

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

ke-ss opened this issue Jan 6, 2025 · 0 comments

Comments

@ke-ss
Copy link

ke-ss commented Jan 6, 2025

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

@ke-ss ke-ss changed the title feature request: paste global buffer directly from splash screen feature request: paste global buffer directly at splash screen Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant