[vim/vim] feat: Add way to add clipboard providers (PR #17998)

126 views
Skip to first unread message

Foxe Chen

unread,
Aug 14, 2025, 12:46:11 AMAug 14
to vim/vim, Subscribed

Should fix #12419. Since we already have the clipmethod option now, a new value called provider is added, which uses the value of the option clipfunc to copy/paste.

The first argument of the function would take the type of operation:
'p' for paste
'y' for yank/copy
... maybe more
The second argument is a dictionary containing operation specific key/value pairs.

For the paste operation, the function would return a tuple: (<flags>, <contents>), where could be what motion type to use, if the clipboard is cleared/empty, and maybe more. <contents> is just what to paste. It is up to the function/plugin to determine what encoding to use, and what mime type to use if there are ones, but it should be text.

One use case for this is obviously implementing an OSC 52 plugin (Maybe OSC 5522 too?).

This might change, I'll see as I work on this PR.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/17998

Commit Summary

File Changes

(6 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998@github.com>

Phạm Bình An

unread,
Aug 14, 2025, 12:43:09 PMAug 14
to vim/vim, Subscribed
brianhuster left a comment (vim/vim#17998)

Just in case Nvim compatibility is considered, this is the document of g:clipboard, which I think is equivalent with 'clipfunc' that you propose. https://neovim.io/doc/user/provider.html#g:clipboard


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3189131396@github.com>

Foxe Chen

unread,
Aug 14, 2025, 1:50:09 PMAug 14
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#17998)

Just in case Nvim compatibility is considered, this is the document of g:clipboard in Nvim, which I think is equivalent with 'clipfunc' that you propose. https://neovim.io/doc/user/provider.html#g:clipboard

Looking at it, maybe there could be a v:clipboard vim var that is a list of dictionaries (providers), each with a paste, copy, and a function that checks if the provider is available + a name for the provider. Then those names of the providers can be used in clipmethod. Don't know if that is just overcomplicated but sounds straightforward enough


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3189359757@github.com>

Foxe Chen

unread,
Aug 14, 2025, 11:57:13 PMAug 14
to vim/vim, Push

@64-bitman pushed 4 commits.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/4c4677eb15733eb2b87deeb68bfc9656488384aa/after/929ee9f1dc5d9dcea27614bc9286d4661326ed26@github.com>

Foxe Chen

unread,
Aug 14, 2025, 11:58:51 PMAug 14
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/929ee9f1dc5d9dcea27614bc9286d4661326ed26/after/ad362fbbb30a971aa45ebb32bb4c117111d75161@github.com>

Maxim Kim

unread,
Aug 15, 2025, 12:18:46 AMAug 15
to vim/vim, Subscribed
habamax left a comment (vim/vim#17998)

and a function that checks if the provider is available

If you do so, please don't query for executable existence as it may slowdown vim startup on windows. It is quite slow there.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3190556640@github.com>

Foxe Chen

unread,
Aug 15, 2025, 12:31:45 AMAug 15
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#17998)

and a function that checks if the provider is available

If you do so, please don't query for executable existence as it may slowdown vim startup on windows. It is quite slow there. I remember this was the issue with neovim back in a day I tried to use it on my windows box.

Thanks, I will take that into consideration


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3190571881@github.com>

Foxe Chen

unread,
Aug 17, 2025, 11:05:41 AMAug 17
to vim/vim, Push

@64-bitman pushed 5 commits.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/ad362fbbb30a971aa45ebb32bb4c117111d75161/after/25ac6f9c7d33c53bb98c890069539f4a281b55d6@github.com>

Foxe Chen

unread,
Aug 17, 2025, 10:00:52 PMAug 17
to vim/vim, Push

@64-bitman pushed 1 commit.

  • e7c3825 add provider to clipboard callbacks

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/25ac6f9c7d33c53bb98c890069539f4a281b55d6/after/e7c3825ee9a0a179f1b019299493f665fc2a9420@github.com>

Foxe Chen

unread,
Aug 18, 2025, 4:55:34 PMAug 18
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 5717320 add provider to clipboard callbacks

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/e7c3825ee9a0a179f1b019299493f665fc2a9420/after/5717320b13ca8f6cfcb62191c73a298faccdf4bd@github.com>

Foxe Chen

unread,
Aug 18, 2025, 6:35:37 PMAug 18
to vim/vim, Push

@64-bitman pushed 5 commits.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/5717320b13ca8f6cfcb62191c73a298faccdf4bd/after/a112f0ff7230e6925d22f6d72f535ba11ed1b105@github.com>

Foxe Chen

unread,
Aug 18, 2025, 7:35:43 PMAug 18
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 9e6d643 add provider to clipboard callbacks

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/a112f0ff7230e6925d22f6d72f535ba11ed1b105/after/9e6d6436a7feab9ecb442e3f0d3e32052c43e1d9@github.com>

Foxe Chen

unread,
Aug 18, 2025, 7:43:23 PMAug 18
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 2706acf add provider to clipboard callbacks

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/9e6d6436a7feab9ecb442e3f0d3e32052c43e1d9/after/2706acf56bf3524650db965f0473983431e83dc2@github.com>

Foxe Chen

unread,
Aug 18, 2025, 7:49:29 PMAug 18
to vim/vim, Push

@64-bitman pushed 1 commit.

  • ae6a5b4 add provider to clipboard callbacks

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/2706acf56bf3524650db965f0473983431e83dc2/after/ae6a5b498af51be63253e0029d00f484c7ef89f1@github.com>

Foxe Chen

unread,
Aug 18, 2025, 8:20:54 PMAug 18
to vim/vim, Push

@64-bitman pushed 1 commit.

  • dc1d3b8 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/ae6a5b498af51be63253e0029d00f484c7ef89f1/after/dc1d3b86445736a3b92ee05e6be47db95a7c530e@github.com>

Foxe Chen

unread,
Aug 18, 2025, 8:26:14 PMAug 18
to vim/vim, Push

@64-bitman pushed 1 commit.

  • a48cef7 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/dc1d3b86445736a3b92ee05e6be47db95a7c530e/after/a48cef79ddf2eaeea10809028dfd7cd5e9da7ee4@github.com>

Foxe Chen

unread,
Aug 18, 2025, 8:32:49 PMAug 18
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 7fea023 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/a48cef79ddf2eaeea10809028dfd7cd5e9da7ee4/after/7fea023fb4174275002bec5e541683969cac4ffb@github.com>

Foxe Chen

unread,
Aug 19, 2025, 7:28:41 AMAug 19
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 8739c72 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/7fea023fb4174275002bec5e541683969cac4ffb/after/8739c72d80f142dd30b74b7495518d33bf33c58a@github.com>

Foxe Chen

unread,
Aug 20, 2025, 2:46:57 AMAug 20
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 00dbe4f add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/8739c72d80f142dd30b74b7495518d33bf33c58a/after/00dbe4fc4a10fed4fc8cff4ec1507fb547ec3487@github.com>

Foxe Chen

unread,
Aug 20, 2025, 2:59:41 AMAug 20
to vim/vim, Push

@64-bitman pushed 1 commit.

  • dd1ac4c add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/41efdb25d1e043d7a4abfe56eaf4da0bb86c9da0/after/dd1ac4cd1d689306a58568a0105546b50b50a5c7@github.com>

Foxe Chen

unread,
Aug 20, 2025, 3:01:05 AMAug 20
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 8cadd9e add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/dd1ac4cd1d689306a58568a0105546b50b50a5c7/after/8cadd9e0247cbf63e7e46d7569eca4056bb63421@github.com>

Foxe Chen

unread,
Aug 20, 2025, 3:02:43 AMAug 20
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 22837db add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/8cadd9e0247cbf63e7e46d7569eca4056bb63421/after/22837db2d44b47adcf46d7479447f4828d770cff@github.com>

Foxe Chen

unread,
Aug 20, 2025, 3:47:02 AMAug 20
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 7203a00 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/22837db2d44b47adcf46d7479447f4828d770cff/after/7203a006ecbc312fb3df561934c24f0abe3ede76@github.com>

Foxe Chen

unread,
Aug 20, 2025, 3:52:44 AMAug 20
to vim/vim, Push

@64-bitman pushed 1 commit.

  • ae5f9ac add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/7203a006ecbc312fb3df561934c24f0abe3ede76/after/ae5f9ace1ed906a3754bd1302706ddd828ebd2ab@github.com>

Foxe Chen

unread,
Aug 20, 2025, 4:28:36 AMAug 20
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 104eb4e add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/ae5f9ace1ed906a3754bd1302706ddd828ebd2ab/after/104eb4ef8c44e1925759c3e155f3305b6aa6db7b@github.com>

Foxe Chen

unread,
Aug 31, 2025, 9:27:06 AMAug 31
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 6ad16d4 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/104eb4ef8c44e1925759c3e155f3305b6aa6db7b/after/6ad16d4ca7d7bfe5cd9144a8d4ee14e8a1816885@github.com>

Foxe Chen

unread,
Aug 31, 2025, 9:39:13 AMAug 31
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 361add4 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/6ad16d4ca7d7bfe5cd9144a8d4ee14e8a1816885/after/361add4b297544f9be5608137e11a2b2ed9eb9cf@github.com>

Foxe Chen

unread,
Aug 31, 2025, 9:57:05 AMAug 31
to vim/vim, Push

@64-bitman pushed 1 commit.

  • bbcba4e add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/361add4b297544f9be5608137e11a2b2ed9eb9cf/after/bbcba4eb2b90c3ee07d4c042518e61da1b8c5a2b@github.com>

Foxe Chen

unread,
Aug 31, 2025, 9:57:59 AMAug 31
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#17998)

I think this is ready


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3240164162@github.com>

Foxe Chen

unread,
Aug 31, 2025, 10:00:33 AMAug 31
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 3215d95 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/bbcba4eb2b90c3ee07d4c042518e61da1b8c5a2b/after/3215d9582fde6f81cc9d9b293fdf76365719b48d@github.com>

Foxe Chen

unread,
Aug 31, 2025, 10:05:23 AMAug 31
to vim/vim, Push

@64-bitman pushed 1 commit.

  • cb51082 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/3215d9582fde6f81cc9d9b293fdf76365719b48d/after/cb5108227ce6ada6fdb6e0762a80de0f735f7bc5@github.com>

Foxe Chen

unread,
Aug 31, 2025, 10:06:23 AMAug 31
to vim/vim, Push

@64-bitman pushed 1 commit.

  • f9cadf1 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/cb5108227ce6ada6fdb6e0762a80de0f735f7bc5/after/f9cadf186e277e96cf1d91cb1813e6a115946e7e@github.com>

h_east

unread,
Aug 31, 2025, 10:36:08 AMAug 31
to vim/vim, Subscribed

@h-east commented on this pull request.


In src/testdir/test_clipboard_provider.vim:

> +
+  " Check if texlock is working
+  call assert_fails("call setline(1, 'test')", "E565:")
+endfunc
+
+" Test if 'paste' callback works properly
+func Test_clipboard_provider_cb_paste()
+  new
+  let v:clipproviders["test"] = {
+        \   "available": {-> v:true},
+        \   "paste": function("Paste")
+        \ }
+  set clipmethod=test
+
+  if has('unnamedplus')
+      call assert_equal("reg: +", getreg('+')) 

CI error has occurred.

From test_codestyle.vim:
Found errors in Test_test_files():
command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[636]..function RunTheTest[63]..Test_test_files[33]..<SNR>8_ReportError line 2: testdir/test_clipboard_provider.vim line 74: trailing white space
make[2]: *** [Makefile:187: opt_test.vim] Error 1
⬇️ Suggested change
-      call assert_equal("reg: +", getreg('+')) 
+      call assert_equal("reg: +", getreg('+'))


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/review/3171665617@github.com>

Foxe Chen

unread,
Aug 31, 2025, 10:38:49 AMAug 31
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 600ddf3 add clipboard provider feature


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/f9cadf186e277e96cf1d91cb1813e6a115946e7e/after/600ddf3846af8d749599b56aef6707f50f8bb898@github.com>

Foxe Chen

unread,
Aug 31, 2025, 10:49:05 AMAug 31
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 3fb2efe add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/600ddf3846af8d749599b56aef6707f50f8bb898/after/3fb2efe02a1fd6af0c26d6335c8dbf30aa3215f7@github.com>

Foxe Chen

unread,
Aug 31, 2025, 11:26:36 AMAug 31
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 6abc567 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/3fb2efe02a1fd6af0c26d6335c8dbf30aa3215f7/after/6abc567a37963da4127076fc79954a5120db439c@github.com>

Foxe Chen

unread,
Aug 31, 2025, 11:47:49 AMAug 31
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 41518e9 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/6abc567a37963da4127076fc79954a5120db439c/after/41518e9c87c1d3c91472d09c2d6b4f7e5b11c0c1@github.com>

Foxe Chen

unread,
Sep 1, 2025, 10:01:37 PMSep 1
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 9dcffb4 add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/41518e9c87c1d3c91472d09c2d6b4f7e5b11c0c1/after/9dcffb4cbc35971ccbcf0053bbf18f4a4b5a9105@github.com>

h_east

unread,
Sep 4, 2025, 4:42:26 AMSep 4
to vim/vim, Subscribed

@h-east commented on this pull request.


In runtime/doc/options.txt:

>  
 	Note: "other" is used on systems without X11/Wayland, such as
 	MS-Windows or MacOS, when running Vim without the GUI.
 
+	Note that the name of the clipboard provider should be used when you
+	want to use a clipboard provider. See |clipboard-providers| for more
⬇️ Suggested change
-	want to use a clipboard provider. See |clipboard-providers| for more
+	want to use a clipboard provider.  See |clipboard-providers| for more


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/review/3184072627@github.com>

Foxe Chen

unread,
Sep 17, 2025, 7:27:32 PMSep 17
to vim/vim, Push

@64-bitman pushed 1 commit.

  • f2905d9 add clipboard provider feature


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/9dcffb4cbc35971ccbcf0053bbf18f4a4b5a9105/after/f2905d981b973e4fa0e086cc66b6bdabd92dbd8f@github.com>

Foxe Chen

unread,
Sep 17, 2025, 7:29:08 PMSep 17
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 16374cf add clipboard provider feature

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/f2905d981b973e4fa0e086cc66b6bdabd92dbd8f/after/16374cf6cdd81b0a49004a7b26ae483a26c076a5@github.com>

Christian Brabandt

unread,
Sep 22, 2025, 3:20:59 PMSep 22
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#17998)

can you please regenerate configure script on latest HEAD?


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3320980582@github.com>

Foxe Chen

unread,
Sep 24, 2025, 3:43:10 PMSep 24
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#17998)

Turning this into a draft again for now because I've decided to go a different direction with the design


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3330405832@github.com>

Foxe Chen

unread,
Sep 24, 2025, 3:47:15 PMSep 24
to vim/vim, Push

@64-bitman pushed 2 commits.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/16374cf6cdd81b0a49004a7b26ae483a26c076a5/after/10dd18a1a4e04f506b68d6db5fbbd60d0f137abf@github.com>

Foxe Chen

unread,
Sep 24, 2025, 8:32:14 PMSep 24
to vim/vim, Push

@64-bitman pushed 1 commit.

  • de77622 copy and paste callbacks working

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/10dd18a1a4e04f506b68d6db5fbbd60d0f137abf/after/de776227b59bedb617ebb347822d6d6ed6f5bddd@github.com>

Foxe Chen

unread,
Sep 24, 2025, 8:34:25 PMSep 24
to vim/vim, Push

@64-bitman pushed 1 commit.

  • dd07a7c copy and paste callbacks working

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/de776227b59bedb617ebb347822d6d6ed6f5bddd/after/dd07a7cbc25a52326c053875a541e82e57077d81@github.com>

Foxe Chen

unread,
Sep 24, 2025, 8:35:26 PMSep 24
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 7ef6b31 copy and paste callbacks working

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/dd07a7cbc25a52326c053875a541e82e57077d81/after/7ef6b31bf245eaeaa6a9a1f2c341cbbb0e2ad04c@github.com>

Foxe Chen

unread,
Oct 8, 2025, 7:59:19 PMOct 8
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/7ef6b31bf245eaeaa6a9a1f2c341cbbb0e2ad04c/after/d82089ff04e2bc56d9d484ca8e3aa8039b8bf86f@github.com>

Foxe Chen

unread,
Oct 8, 2025, 8:53:23 PMOct 8
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/d82089ff04e2bc56d9d484ca8e3aa8039b8bf86f/after/ba719af09528a8a2f14fbc929aa20b5b98fb27cc@github.com>

Foxe Chen

unread,
Oct 8, 2025, 8:56:45 PMOct 8
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/ba719af09528a8a2f14fbc929aa20b5b98fb27cc/after/a380b117c605282aa8d376f73b5f1110eed8012a@github.com>

Foxe Chen

unread,
Oct 8, 2025, 8:58:40 PMOct 8
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/a380b117c605282aa8d376f73b5f1110eed8012a/after/abcfde40ff4917006747878a8f4bbfe32831a153@github.com>

Foxe Chen

unread,
Oct 8, 2025, 9:21:26 PMOct 8
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 162cfc8 make paste callback use list of strings not a string

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/b4a1a96a0deff109d0cdf96c16272083234c5bc2/after/162cfc8f03ea5858475f2f00fcc1fd0f7beefa7c@github.com>

Foxe Chen

unread,
Oct 8, 2025, 10:25:18 PMOct 8
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/162cfc8f03ea5858475f2f00fcc1fd0f7beefa7c/after/9969b15e21e4fa78c46c9477b377f3815f2db01e@github.com>

Foxe Chen

unread,
Oct 8, 2025, 10:53:01 PMOct 8
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 6e9c754 don't request selecioon when getting regtype

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/9969b15e21e4fa78c46c9477b377f3815f2db01e/after/6e9c75487ca47d1c91d29252c468454bf92f016a@github.com>

Foxe Chen

unread,
Oct 8, 2025, 11:26:12 PMOct 8
to vim/vim, Push

@64-bitman pushed 0 commits.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/6e9c75487ca47d1c91d29252c468454bf92f016a/after/9969b15e21e4fa78c46c9477b377f3815f2db01e@github.com>

Foxe Chen

unread,
Oct 9, 2025, 8:13:32 PMOct 9
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/9969b15e21e4fa78c46c9477b377f3815f2db01e/after/7621d0f785b28bdcc8b3de1a55fc05190f46dc0c@github.com>

Foxe Chen

unread,
Oct 10, 2025, 6:21:54 PMOct 10
to vim/vim, Push

@64-bitman pushed 2 commits.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/d7aca379ff852e250621f18ed8e5d6612040b4c1/after/b1c131dbf05534301458f72f4a5ad3391de70dd6@github.com>

Foxe Chen

unread,
Oct 10, 2025, 6:22:25 PMOct 10
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#17998)

I think this is ready


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3392476434@github.com>

Foxe Chen

unread,
Oct 10, 2025, 6:47:51 PMOct 10
to vim/vim, Push

@64-bitman pushed 1 commit.

  • d952c15 initialize buffer to zero

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/b1c131dbf05534301458f72f4a5ad3391de70dd6/after/d952c15db7884d713e3de3a6ed7c710c8caab3c8@github.com>

Foxe Chen

unread,
Oct 10, 2025, 6:55:24 PMOct 10
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/d952c15db7884d713e3de3a6ed7c710c8caab3c8/after/683dab1127d9e51c408679e6320486439550f123@github.com>

Foxe Chen

unread,
Oct 10, 2025, 7:08:00 PMOct 10
to vim/vim, Push

@64-bitman pushed 12 commits.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/683dab1127d9e51c408679e6320486439550f123/after/f0bfadccc6b0962c4488a1d0300f52f912f39b53@github.com>

Foxe Chen

unread,
Oct 10, 2025, 7:09:41 PMOct 10
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/f0bfadccc6b0962c4488a1d0300f52f912f39b53/after/e0f84d8442f997d47f9cf2deeb1506a20598930b@github.com>

Foxe Chen

unread,
Oct 10, 2025, 7:52:38 PMOct 10
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/e0f84d8442f997d47f9cf2deeb1506a20598930b/after/677004318757f9824389321d4da01c0252875366@github.com>

Foxe Chen

unread,
Oct 10, 2025, 8:27:18 PMOct 10
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 3d7d9f7 make "other" clipmethod only work if not on unix

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/before/677004318757f9824389321d4da01c0252875366/after/3d7d9f719fd6478337f06b76e2128bfc48cedc85@github.com>

Foxe Chen

unread,
Oct 10, 2025, 8:57:09 PMOct 10
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#17998)

I think this is ready


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3392693117@github.com>

Christian Brabandt

unread,
Oct 12, 2025, 11:46:08 AMOct 12
to vim/vim, Subscribed

@chrisbra commented on this pull request.

Is the clipboard provider feature compatible with Neovim? I think we should call this out then. Also can a few people try this please?


In src/globals.h:

> @@ -972,7 +972,8 @@ EXTERN int	gui_win_y INIT(= -1);
 
 #ifdef FEAT_CLIPBOARD
 EXTERN Clipboard_T clip_star;	// PRIMARY selection in X11/Wayland
-# if defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD)
+# if defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD) \
+    || ((defined(UNIX) || defined(VMS)) && defined(FEAT_CLIPBOARD_PROVIDER))

That looks wrong. Why would clip_plus depend on FEAT_CLIPBOARD_PROVIDER?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/review/3328940292@github.com>

Foxe Chen

unread,
Oct 12, 2025, 11:49:46 AMOct 12
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#17998)

Is the clipboard provider feature compatible with Neovim? I think we should call this out then. Also can a few people try this please?

It is not compatible with neovim.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3394734163@github.com>

Foxe Chen

unread,
Oct 12, 2025, 2:45:40 PMOct 12
to vim/vim, Subscribed

@64-bitman commented on this pull request.


In src/globals.h:

> @@ -972,7 +972,8 @@ EXTERN int	gui_win_y INIT(= -1);
 
 #ifdef FEAT_CLIPBOARD
 EXTERN Clipboard_T clip_star;	// PRIMARY selection in X11/Wayland
-# if defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD)
+# if defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD) \
+    || ((defined(UNIX) || defined(VMS)) && defined(FEAT_CLIPBOARD_PROVIDER))

It doesn't. clip_plus is enabled if on UNIX/VMS and the clipboard provider feature exists. But it does not depend on it


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/review/3329352528@github.com>

Christian Brabandt

unread,
Oct 13, 2025, 3:33:23 PMOct 13
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#17998)

Is the clipboard provider feature compatible with Neovim? I think we should call this out then. Also can a few people try this please?

It is not compatible with neovim.

Even the configuration of the clipboard provider? Would it make sense to to try to be compatible with a Vim-Script provider for Neovim? Or does it not make sense? In any case, I think it should be mentioned that this is incompatible then.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3398794572@github.com>

Christian Brabandt

unread,
Oct 13, 2025, 3:57:55 PMOct 13
to vim/vim, Subscribed

@chrisbra commented on this pull request.


In src/globals.h:

> @@ -972,7 +972,8 @@ EXTERN int	gui_win_y INIT(= -1);
 
 #ifdef FEAT_CLIPBOARD
 EXTERN Clipboard_T clip_star;	// PRIMARY selection in X11/Wayland
-# if defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD)
+# if defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD) \
+    || ((defined(UNIX) || defined(VMS)) && defined(FEAT_CLIPBOARD_PROVIDER))

okay


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/review/3332890986@github.com>

Foxe Chen

unread,
Oct 13, 2025, 4:13:08 PMOct 13
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#17998)

Is the clipboard provider feature compatible with Neovim? I think we should call this out then. Also can a few people try this please?

It is not compatible with neovim.

Even the configuration of the clipboard provider? Would it make sense to to try to be compatible with a Vim-Script provider for Neovim? Or does it not make sense? In any case, I think it should be mentioned that this is incompatible then.

The configuration of the clipboard provider is very similar to neovim. However it seems that Neovim uses g:clipboard unlike this PR which uses a dedicated vim var v:. I also don't see the point in being fully one to one compatible with Neovim. The only major difference I would say is that you can directly create a process like this in Neovim:

let g:clipboard = {
  \   'name': 'myClipboard',
  \   'copy': {
  \      '+': ['tmux', 'load-buffer', '-'],
  \      '*': ['tmux', 'load-buffer', '-'],
  \    },
  \   'paste': {
  \      '+': ['tmux', 'save-buffer', '-'],
  \      '*': ['tmux', 'save-buffer', '-'],
  \   },
  \   'cache_enabled': 1,
  \ }

In this PR this must be done manually, but that should be more than easy enough to emulate. There also seems to be a cache feature Neovim provides, but I think that can be simulated using Vimscript anyways:

If "cache_enabled" is TRUE then when a selection is copied Nvim will cache the selection until the copy command process dies. When pasting, if the copy process has not died the cached selection is applied.

I also don't see many separate community maintained clipboard provider plugins for Neovim. They all seem to provide a different way of supporting the Wayland, X11, or Windows clipboard, which we already have native support for. Additionally, from Neovim:

The presence of a working clipboard tool implicitly enables the "+" and "*" registers. Nvim supports these clipboard tools, in order of priority:
g:clipboard : User override (if set to a dict or any string "name" below; e.g. g:clipboard="tmux" forces tmux clipboard and skips auto-detection).
"pbcopy" : pbcopy, pbpaste (macOS)
"wl-copy" : wl-copy, wl-paste (if $WAYLAND_DISPLAY is set)
"wayclip" : waycopy, waypaste (if $WAYLAND_DISPLAY is set)
"xsel" : xsel (if $DISPLAY is set)
"xclip" : xclip (if $DISPLAY is set)
"lemonade" : lemonade (for SSH) https://github.com/pocke/lemonade
"doitclient": doitclient (for SSH) https://www.chiark.greenend.org.uk/~sgtatham/doit/
"win32yank" : win32yank (Windows)
"putclip" : putclip, getclip (Windows) https://cygwin.com/packages/summary/cygutils.html
"clip" : clip, powershell (Windows) https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/clip
"termux" : termux (via termux-clipboard-set, termux-clipboard-get)
"tmux" : tmux (if $TMUX is set)
"osc52" : clipboard-osc52 (if supported by your terminal)

We already have native clipboard support for 80% of the platforms these tools operate on.

Moreover, a big difference is that this PR utilizes the clipmethod option Vim has, meaning we can support multiple custom clipboard providers, while the g:clipboard variable for Neovim seems to only be for one clipboard provider.

Overall, I think it would just be too much work to try to be compatible with Neovim with little benefit.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3398920962@github.com>

Christian Brabandt

unread,
Oct 13, 2025, 4:51:35 PMOct 13
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#17998)

thanks, makes sense.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3399038178@github.com>

Christian Brabandt

unread,
Oct 14, 2025, 3:40:00 PMOct 14
to vim/vim, Subscribed

Closed #17998 via 67860ef.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/issue_event/20277981622@github.com>

Yee Cheng Chin

unread,
Oct 24, 2025, 5:45:21 AMOct 24
to vim/vim, Subscribed
ychin left a comment (vim/vim#17998)

Hi @64-bitman , this seems to completely break clipboard on macOS. How was this verified/tested on macOS? When I build and run the latest Vim, pasting from clipboard gives me a W23 warning, and inspecting v:clipmethod shows "none", and from local investigation it was caused by this commit.

I'm also surprised that we don't have tests that make sure this functionality works. We should probably add something for this.

I'm working on a fix (along with other more minor improvements related to this PR) but just wanted to see if I'm missing something here.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3442186535@github.com>

Yee Cheng Chin

unread,
Oct 24, 2025, 7:24:33 PMOct 24
to vim/vim, Subscribed
ychin left a comment (vim/vim#17998)

Also, what's the point of the "gui" clip method? In what situation does it serve a purpose than the other methods? It basically calls the same functionality as the other methods. Is it just to make it so GVim will automatically swap to GUI when starting up, but otherwise the user may not want to initialize Wayland/X11? I don't think the documentation is describing the intent enough. If that's the case shouldn't the default have "gui,wayland,x11,other" rather than "wayland,x11,gui,other"?

I'm also struggling to understand this piece of code:

#if defined(FEAT_GUI) && defined(FEAT_WAYLAND)
    if (method == CLIPMETHOD_GUI)
	// We only interact with Wayland for the clipboard, we can just deinit
	// everything.
	wayland_uninit_connection();
#endif

If the clip method is "GUI" doesn't that mean the GUI is indeed initialized? Why are we de-initializing Wayland here?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3445212136@github.com>

Yee Cheng Chin

unread,
Oct 24, 2025, 8:42:48 PMOct 24
to vim/vim, Subscribed
ychin left a comment (vim/vim#17998)

From looking into it, seems like #18574 tried to fix some ifdef issues, but I don't think that really changed anything regarding the broken nature of it. Can we revert these two changes until we can properly implement and test the feature? This blocks Vim from working properly on other platforms. Vim needs to work on Windows and macOS and changes that touch those functionality should have been tested on those platforms.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3445368028@github.com>

Foxe Chen

unread,
Oct 24, 2025, 10:18:35 PMOct 24
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#17998)

From looking into it, seems like #18574 tried to fix some ifdef issues, but I don't think that really changed anything regarding the broken nature of it. @chrisbra Can we revert these two changes until we can properly implement and test the feature on the relevant platforms to make sure they work? This currently blocks Vim from working properly on other platforms.

I plan on refactoring the code to address these issues when I have time


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3445493871@github.com>

Yee Cheng Chin

unread,
Oct 25, 2025, 2:16:53 AMOct 25
to vim/vim, Subscribed
ychin left a comment (vim/vim#17998)

I plan on refactoring the code to address these issues when I have time, see this #18600 (comment). Essentially I will remove the "gui" and "other" values from clipmethod, as they were made for the clipboard feature to work via the clipmethod option. I'll move the clipboard provider code to not be under the clipboard feature to get rid of all these confusing ifdefs.

I commented on the linked issue, but just duplicating it here. I think what you said sounds good. The current "gui" / "other" are quite confusing and they seem to be from a consequence of the option being originally from just supporting Wayland clipboards (for example, "other" actually means the actual platform native method).

That said, if this isn't fixed in less than 1 day I think we should just revert it. Things should not remain broken. And it gives you more time to properly fix it rather than having to hack around it under time pressure.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3445972063@github.com>

Shane-XB-Qian

unread,
Oct 26, 2025, 2:51:14 AMOct 26
to vim/vim, Subscribed
Shane-XB-Qian left a comment (vim/vim#17998)
> That said, if this isn't fixed in less than 1 day I think we should just revert it. Things should not remain broken. And it gives you more time to properly fix it rather than having to hack around it under time pressure.

Looking this and think what i said in #18583 and #18498,
so am i a `!operator`?

or @girishji you are a "mad" `joker`?
or @nickspoons do you plan to "kick" something?
or @chrisbra how about this is the "last" to warn me sth?

dear jokers, very enjoying~
***@***.*** how is this feeling? offensive or condescending?)
***@***.*** what is this feeling to mix tech with political/manner like playing in your stackoverflow or "reddit"?)

p.s: @64-bitman @ychin sry, i took this as as example.

--
shane.xb.qian


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3448067945@github.com>

Christian Brabandt

unread,
Oct 26, 2025, 2:20:54 PMOct 26
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#17998)

or @chrisbra how about this is the "last" to warn me sth?

I warned you before and I'm sorry that I have to resort to such drastic measures, but you’re now being blocked for 3 months.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17998/c3448748261@github.com>

shane qian

unread,
Oct 26, 2025, 2:39:20 PMOct 26
to vim...@googlegroups.com, vim/vim, Subscribed
thanks. this is my "last" to reply you as well.
but I think i would be back vim community someday tho not sure when.
if people like to know detail can check #18498 and see these jokers played (but I am not interested to continue to play with these stupid  excellent political players for now), otherwise bye~

--
shane.xb.qian
Reply all
Reply to author
Forward
0 new messages