Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7977847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:19:37+00:00 2026-06-04T09:19:37+00:00

Is there a config entry I can place in my .vimrc which will achieve

  • 0

Is there a config entry I can place in my .vimrc which will achieve the same as passing the -X flag when running vim.

To provide some context:
I recently found that my vim startup time in a screen (tmux) session was extremely long (~6 seconds)

Using the vim --startuptime flag, it is clear that the issue is due to the connection to the X server in order to setup the X clipboard.

Running vim -X has fixed my slow startup time. I would prefer to modify my .vimrc, rather than creating a bash alias to solve this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:19:39+00:00Added an answer on June 4, 2026 at 9:19 am

    You may want to take a look at the clipboard setting (:help 'clipboard'). What follows is a recommendation from Gary Johnson (source, via web.archive.org).


    You may want to set ‘clipboard’ in your .vimrc so that you don’t
    have to use -X all the time. In my situation, I use vim on a
    machine that I log in to from various other machines, some of which
    have $DISPLAY set even though they don’t have an X server. Here is
    what I have in my .vimrc:

    " Prevent vim from trying to connect to the X server when connecting 
    " from home, which causes a startup delay of about 14 seconds. I 
    " usually connect from home via screen. 
    " 
    "set clipboard=autoselect,exclude:cons\\\|linux\\\|screen 
    " 
    " Using $DISPLAY instead of 'term' should be more reliable. It avoids 
    " the problem of starting vim without first starting screen and allows 
    " screen to be used locally without losing vim's X features. 
    " 
    if $DISPLAY =~ '\(\(cos\|scs\)\d\+nai\d\+\)\|\(spkpc\d\+\)\|\(tc-garyjohn\)' 
    set clipboard=autoselect,exclude:.* 
    endif 
    

    (Do notice that you’ll need to tweak the if $DISPLAY line to match your own $DISPLAY variable).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a build-in way in C# to work with simple config files which
I'm hoping there's a way in a config file or something that will allow
I'm running an online food journal where users can record journal entries. There are
I have the following entry in the web.config: <customErrors mode=RemoteOnly defaultRedirect=Error.aspx /> Is there
In the Portable Executable format, there is a directory named IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG. Can someone provide
In my app's config there is a impersonation tag containing username and password and
In my web.config file there are below entries. It seems like it is used
There are questions pertaining to reading settings from a separate config file and others
Is there a way to write in a app.config file the information about endpoints?
Why are there multiple (2) web.config files: 1 in the root directory 1 in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.