Loading ...
Sorry, an error occurred while loading the content.

disable X when vim is in a console over ssh

Expand Messages
  • dman
    I want to disable using the X clipboard when I run vim in a console over ssh because it makes the startup time becomes too long. I ve RTFMed and come up with
    Message 1 of 3 , Jan 3, 2002
    • 0 Attachment
      I want to disable using the X clipboard when I run vim in a console
      over ssh because it makes the startup time becomes too long. I've
      RTFMed and come up with this (for .vimrc)


      if ! has( "gui_running" )
      let g:display_num =
      \ substitute(
      \ substitute( $DISPLAY , "^[[:alpha:]]*:" , "" , "" ) ,
      \ "\.[[:digit:]]*$" , "" , "" )
      if ( g:display_num >= 10 )
      set clipboard=exclude:.*
      endif
      endif


      While this seems to work, I'd rather use just one substitute. However
      the regex that works in vim for regular buffers (ie :s command)
      doesn't work here :

      let g:display_num =
      \ substitute( $DISPLAY ,
      \ "^[[:alpha:]]*:\([[:digit:]]\+\)\.[[:digit:]]\+$" ,
      \ "\1" , "" )


      TIA for any suggestions,
      -D

      --

      There are six things the Lord hates,
      seven that are detestable to him :
      haughty eyes,
      a lying tongue,
      hands that shed innocent blood,
      a heart that devises wicked schemes,
      feet that are quick to rush into evil,
      a false witness who pours out lies
      and a man who stirs up dissension among brothers.

      Proverbs 6:16-19
    • Benji Fisher
      ... Try using single quotes instead of double quotes. To see what argument the substitute() function is actually getting, try ... HTH --Benji Fisher
      Message 2 of 3 , Jan 3, 2002
      • 0 Attachment
        On Thursday, January 3, 2002, at 02:27 PM, dman wrote:

        >
        > I want to disable using the X clipboard when I run vim in a console
        > over ssh because it makes the startup time becomes too long. I've
        > RTFMed and come up with this (for .vimrc)
        >
        >
        > if ! has( "gui_running" )
        > let g:display_num =
        > \ substitute(
        > \ substitute( $DISPLAY , "^[[:alpha:]]*:" , "" , "" ) ,
        > \ "\.[[:digit:]]*$" , "" , "" )
        > if ( g:display_num >= 10 )
        > set clipboard=exclude:.*
        > endif
        > endif
        >
        >
        > While this seems to work, I'd rather use just one substitute. However
        > the regex that works in vim for regular buffers (ie :s command)
        > doesn't work here :
        >
        > let g:display_num =
        > \ substitute( $DISPLAY ,
        > \ "^[[:alpha:]]*:\([[:digit:]]\+\)\.[[:digit:]]\+$" ,
        > \ "\1" , "" )

        Try using single quotes instead of double quotes. To see what
        argument the substitute() function is actually getting, try

        :echo "^[[:alpha:]]*:\([[:digit:]]\+\)\.[[:digit:]]\+$" "\1"

        :help literal-string

        HTH --Benji Fisher
      • dman
        ... Ahh, thanks! That fixes it. -D -- Only two things are infinite, the universe and human stupidity, and I m not sure about the former. Albert Einstein
        Message 3 of 3 , Jan 3, 2002
        • 0 Attachment
          On Thu, Jan 03, 2002 at 02:28:50PM -0500, Benji Fisher wrote:
          | On Thursday, January 3, 2002, at 02:27 PM, dman wrote:
          | >
          | >I want to disable using the X clipboard when I run vim in a console
          | >over ssh because it makes the startup time becomes too long. I've
          | >RTFMed and come up with this (for .vimrc)
          ...
          | >the regex that works in vim for regular buffers (ie :s command)
          | >doesn't work here :
          | >
          | > let g:display_num =
          | > \ substitute( $DISPLAY ,
          | > \ "^[[:alpha:]]*:\([[:digit:]]\+\)\.[[:digit:]]\+$" ,
          | > \ "\1" , "" )
          |
          | Try using single quotes instead of double quotes. To see what
          | argument the substitute() function is actually getting, try
          |
          | :echo "^[[:alpha:]]*:\([[:digit:]]\+\)\.[[:digit:]]\+$" "\1"

          Ahh, thanks! That fixes it.

          -D

          --

          Only two things are infinite, the universe and human stupidity, and I'm
          not sure about the former.
          Albert Einstein
        Your message has been successfully submitted and would be delivered to recipients shortly.