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

Re: vertical split width

Expand Messages
  • Tim Chase
    ... The mappings you give are broken, given the extra space in them. For changing the width of vertical windows, you want ... which do the same horizontally as
    Message 1 of 6 , Dec 1, 2007
    • 0 Attachment
      > how do i change the width of a vertical split window?. i know how to
      > do that with a horizontal split by adding the folowing to .vimrc
      >
      > if buffwin(1)
      > map + <C-W> +
      > map - <C-W> -
      > endif
      >
      > but it seams harder to do it on a vertical splited window...

      The mappings you give are broken, given the extra space in them.

      For changing the width of vertical windows, you want

      :help ctrl-w_<
      :help ctrl-w_>

      which do the same horizontally as <C-W> followed by +/- do
      vertically. You can map these to make them more accessible if
      you need.

      > another question: how do i copy text from vim to outside vim? e.g. i
      > had to write down the previous piece of my vimrc because i just didn't
      > figure out a way to copy it to this post...

      Vim can yank/paste from your system clipboard buffer(s). Under
      Windows, there's only one, so the "+" register and the "*"
      register are synonyms. Under X, the "+" register is the analog
      to the copy/paste clipboard, and the "*" register is the "select"
      clipboard where selections are stashed. It took me a while to
      figure out the difference, but once I understood them, they each
      have their advantages in the rights situations, so I use both
      accordingly.

      Thus, you'd use

      "+p

      to paste the register just as you would use to paste any other
      register, or use

      "+yy

      to yank the current line to the clipboard.

      :help quotestar
      :help quoteplus

      to read more about these registers. If you're not running X on a
      *nix box, it's a bit more complex. I've seen some mappings to
      copy/paste to/from the "screen" clipboard if you're running under
      "screen", but otherwise, there's not much other than temp-files
      or fifo pipes for transferring content between files.

      -tim




      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... To copy to the clipboard from gvim (or from X-enabled console Vim running in an xterm, or from Windows console Vim compiled with +clipboard), yank to
      Message 2 of 6 , Dec 1, 2007
      • 0 Attachment
        molecula21 wrote:
        > how do i change the width of a vertical split window?. i know how to
        > do that with a horizontal split by adding the folowing to .vimrc
        >
        > if buffwin(1)
        > map + <C-W> +
        > map - <C-W> -
        > endif
        >
        > but it seams harder to do it on a vertical splited window...
        >
        >
        > another question: how do i copy text from vim to outside vim? e.g. i
        > had to write down the previous piece of my vimrc because i just didn't
        > figure out a way to copy it to this post...

        To copy to the clipboard from gvim (or from X-enabled console Vim running in
        an xterm, or from Windows console Vim compiled with +clipboard), yank to
        register plus.

        For a snippet of your vimrc: use linewise-visual, then

        "+y
        or
        :'<,'>y +

        (where Vim fills in '<,'> when you hit the colon key). The latter can also be
        used outside Visual mode with a normal range, as in

        :.-2,.+4y+

        to yank the current line to the clipboard, together with 2 lines above it and
        4 lines below it.

        To copy the whole file currently being edited to the clipboard, use a
        different range:

        :1,$y+
        or
        :%y+

        For something that Vim prints out on the bottom line (such as the output of
        ":version") use the ":redir" command, as in

        :redir @+
        :version
        :redir END

        which copies the "version" page of your current Vim to the clipboard.

        For non-clipboard-enabled versions of Vim, you will have to save to a file
        instead, as in

        :.-2,.+4w! clipboard.txt
        or
        :redir! version.txt
        :version
        :redir END


        Best regards,
        Tony.
        --
        "As an adolescent I aspired to lasting fame, I craved factual
        certainty, and I thirsted for a meaningful vision of human life -- so I
        became a scientist. This is like becoming an archbishop so you can
        meet girls."
        -- Matt Cartmill

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Tony Mechelynck
        ... Easiest IMHO is dragging the vertical separation with the mouse. Or else, in a script you could use e.g. ... to give (if possible) 50 columns to the
        Message 3 of 6 , Dec 1, 2007
        • 0 Attachment
          molecula21 wrote:
          > how do i change the width of a vertical split window?. i know how to
          > do that with a horizontal split by adding the folowing to .vimrc
          >
          > if buffwin(1)
          > map + <C-W> +
          > map - <C-W> -
          > endif
          >
          > but it seams harder to do it on a vertical splited window...

          Easiest IMHO is dragging the vertical separation with the mouse. Or else, in a
          script you could use e.g.

          :setlocal winwidth=50

          to give (if possible) 50 columns to the current vertically-split window.

          See also
          :help CTRL-W_<
          :help CTRL-W_>

          Best regards,
          Tony.
          --
          "Benson, you are so free of the ravages of intelligence"
          -- Time Bandits


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Bill McCarthy
          ... Since you didn t specify your OS, I ll assume it s Windows. If you set the clipboard to unnamed, a simple yank, or any operation that goes to unnamed, will
          Message 4 of 6 , Dec 1, 2007
          • 0 Attachment
            On Sat 1-Dec-07 7:24pm -0600, molecula21 wrote:

            > another question: how do i copy text from vim to outside vim? e.g. i
            > had to write down the previous piece of my vimrc because i just didn't
            > figure out a way to copy it to this post...

            Since you didn't specify your OS, I'll assume it's Windows.
            If you set the clipboard to unnamed, a simple yank, or any
            operation that goes to unnamed, will save to the clipboard.

            Then from your windows app, paste from the clipboard
            (usually ctrl-v).

            :h 'cb'|/unnamed

            --
            Best regards,
            Bill


            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • molecula21
            thank you all! problem solved! --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_use maillist. For more
            Message 5 of 6 , Dec 3, 2007
            • 0 Attachment
              thank you all! problem solved!
              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            Your message has been successfully submitted and would be delivered to recipients shortly.