I want to write a vim function that includes pasting from the clipboard (if that matters on Windows)
I think it should be something like
function MyPastingFunc() "+p "paste from clipboard "do more stuff endfunction
Of course, "+ p is just a comment in the .vim file. How can I do this work?
You are looking for a command :normal:
:normal
function MyPastingFunc() "paste from clipboard normal! "+p "do more stuff endfunction
!used to prevent vim from matching user accounts that may be part of "+p.
!
"+p
If you always want to jump to a new line, you can use a command :put, for example:
:put
:put + will paste after the current line :put! + will paste before the current line :123 put + will paste after line 123
N.B. . , .
feedkeys, :
function MyPastingFunc() call feedkeys("\"+p") "paste from clipboard "do more stuff endfunction
Source: https://habr.com/ru/post/1752563/More articles:How does the click () function in jquery work when working with multiple glass divs? - javascriptctypes initializes a c_int array by reading a file - pythonApp Engine - MemcacheService namespaces - javaLinq to SQL Where In Clause Causes The object is not installed in the object instance - c #Position of the first word of a string in javascript - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1752564/security-precautions-to-take-when-running-multiple-sub-sites-on-the-same-main-site&usg=ALkJrhioQhZ3wVwuzQpTPItZGmNrQcmxOwHow to parse and convert an AutoCAD MText object to raw text? - c #How does char * blah = hello work? - c ++The problem with the structures, where to put them and how to refer to them in the headers? - cHow to change the default program (notepad) that opens the selected file when viewing the TFS changeset in Visual Studio 2010? - tfsAll Articles