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

clipboard=unnamedplus is breaking my .vim startup #564

Closed
lukedomanski opened this issue Feb 18, 2014 · 11 comments
Closed

clipboard=unnamedplus is breaking my .vim startup #564

lukedomanski opened this issue Feb 18, 2014 · 11 comments

Comments

@lukedomanski
Copy link
Contributor

@johntyree
This commit 47547b8 at line 73, or this one (unlikely) c5addb9 at line 73, seems to have broken my loading of vim in all of the following:

  • Remote Linux terminal via Putty
  • Local gnome-terminal in X
  • Local xterm terminal in X

with error:

Error detected while processing $HOME/.vimrc:
line   75:
E474: Invalid argument: clipboard=unnamedplus
Press ENTER or type command to continue

replacing if Linux() with the previous if has('x') && has ('gui') solves the problem for me.

@johntyree
Copy link
Collaborator

What's the output of vim --version for you? Maybe you don't have
+clipboard ?

Gvim always has it, but some distros package the two separately to
allow machines with X installed at all to just install vim.

2014-02-17 18:06 UTC−06:00, Luke Domanski notifications@github.com:

@johntyree
This commit 47547b8 at line 73, or this one
(unlikely) c5addb9 at line 73, seems to
have broken my loading of vim in all of the following:

  • Remote Linux terminal via Putty
  • Local gnome-terminal in X
  • Local xterm terminal in X

with error:

Error detected while processing $HOME/.vimrc:
line   75:
E474: Invalid argument: clipboard=unnamedplus
Press ENTER or type command to continue

replacing if Linux() with the previous if has('x') && has ('gui') solves
the problem for me.


Reply to this email directly or view it on GitHub:
#564

@lukedomanski
Copy link
Contributor Author

Vim 7.3 and it has +clipboard enabled.

But wouldn't the has('clipboard') check cover that anyway? Perhaps +clipboard should NOT be compiled for terminal use?

@johntyree
Copy link
Collaborator

OK I see, it is +X11 that's required there, not +clipboard. I assume your terminal vim doesn't have +X11?

In any case, you're right, that line needs to change.

@johntyree
Copy link
Collaborator

@lukedomanski should work now. Test that PR with git checkout pr/565 in your spf13 repo.

@lukedomanski
Copy link
Contributor Author

Thanks ill check tonight. I'm suspecting it doesn't have +X11, it is on a headless login node of a compute cluster. I'll check anyway.

Regards,
Luke Domanski

On 19/02/2014, at 10:08 AM, John Tyree notifications@github.com wrote:

OK I see, it is +X11 that's required there, not +clipboard. I assume your terminal vim doesn't have +X11?

In any case, you're right, that line needs to change.


Reply to this email directly or view it on GitHub.

@lukedomanski
Copy link
Contributor Author

I lied, I didn't test it last night :)

Anyway, that pull request does not solve the problem. I checked vim --version again, and noted that:

  • +X11 is present, and :echo has('X11') prints 1 (makes sense)
  • +gui is not present, but :echo has('gui') prints 1! (so obviously this is set by another compile feature)
  • :echo has('gui_running') prints 0 (make sense, this might be our winner)
  • +x is not present, and :echo has('x') prints 0 (makes sense), but then again...i dont think "x" is a feature anymore??

So, the original if has('x') && has ('gui') "solves" the problem, but only because has('x') probably always returns 0.

if has('X11') && has('gui') does not solve the problem, maybe because it does not allow for the fact that a vim version is compiled for dual use with terminal-only and gui.

if has('gui_running') solved the problem on the system I'm using, but this does not mean that has('clipboard') && has('gui_running') is the only situation in which clipboard=unnamedplus is invalid. An interesting feature that might have relevance is +xterm_clipboard, see docs in :help 'clipboard',

Interestingly, :helpgrep unnamedplus only turned up results in the changelog of the YankRing.txt file. So on a whim I uninstalled YankRing and tried again...still not fixed. I could not find documentation for it anywhere else in vim.

@lukedomanski
Copy link
Contributor Author

http://vim.wikia.com/wiki/Accessing_the_system_clipboard says that unnnamedplus is available from 7.3.34. How do i confirm my patch number? The one after the second "." (found it, http://www.packtpub.com/article/vim-7-2-scripting, as per :help v:version)

has('patch34') returns 0 for me, maybe I have not got the appropriate patch installed?

@johntyree
Copy link
Collaborator

@lukedomanski vim --version and look at the Included Patches line. The highest patch is your minor version.

@johntyree
Copy link
Collaborator

@lukedomanski funny enough, the help says right there.

            Availability can be checked with: >
                if has('unnamedplus')

I'll update the PR.

@lukedomanski
Copy link
Contributor Author

@johntyree
"vim --version and look at the Included Patches line. The highest patch is your minor version."

Okay, so it looks like the version of 7.3 installed on the system I'm logged into has no patches applied. As it does not have an Included Patches section. I looked at version 7.2 output on this system to check against 7.3 output, and it did have an "Included Patches" section.

"funny enough, the help says right there.

            Availability can be checked with: >
                if has('unnamedplus')

I'll update the PR."

Thanks. Yeah that is not in my help/docs, so a backwards compatibility check like that is a good idea for those people logging in to multiple systems that have little control over the install.

@lukedomanski
Copy link
Contributor Author

Cheers! it works see #565

johntyree added a commit that referenced this issue Feb 20, 2014
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

2 participants